[PATCH 3 of 5] preserve order of items in the list of special help topcis
Johannes Stezenbach
js at sig21.net
Sat May 24 21:11:07 UTC 2008
# HG changeset patch
# User Johannes Stezenbach <js at sig21.net>
# Date 1211658427 -7200
# Node ID fa4fc9c14e654aa2be3e40ba11a75639ba47d61e
# Parent 27401a7fa73a84d109719bbc95fb3fd4dced89a2
preserve order of items in the list of special help topcis
diff -r 27401a7fa73a -r fa4fc9c14e65 doc/gendoc.py
--- a/doc/gendoc.py Sat May 24 21:40:36 2008 +0200
+++ b/doc/gendoc.py Sat May 24 21:47:07 2008 +0200
@@ -92,11 +92,10 @@
ui.write(_(" aliases: %s\n\n") % " ".join(d['aliases']))
# print topics
- for t in helptable:
+ for t, doc in helptable:
l = t.split("|")
section = l[-1]
underlined(_(section).upper())
- doc = helptable[t]
if callable(doc):
doc = doc()
ui.write(_(doc))
diff -r 27401a7fa73a -r fa4fc9c14e65 mercurial/commands.py
--- a/mercurial/commands.py Sat May 24 21:40:36 2008 +0200
+++ b/mercurial/commands.py Sat May 24 21:47:07 2008 +0200
@@ -1315,16 +1315,16 @@
def helptopic(name):
v = None
- for i in help.helptable:
+ for i, d in help.helptable:
l = i.split('|')
if name in l:
v = i
header = l[-1]
+ doc = d
if not v:
raise cmdutil.UnknownCommand(name)
# description
- doc = help.helptable[v]
if not doc:
doc = _("(No help text available)")
if callable(doc):
@@ -1398,7 +1398,7 @@
if ui.verbose:
ui.write(_("\nspecial help topics:\n"))
topics = []
- for i in help.helptable:
+ for i, d in help.helptable:
l = i.split('|')
topics.append((", ".join(l[:-1]), l[-1]))
topics_len = max([len(s[0]) for s in topics])
diff -r 27401a7fa73a -r fa4fc9c14e65 mercurial/help.py
--- a/mercurial/help.py Sat May 24 21:40:36 2008 +0200
+++ b/mercurial/help.py Sat May 24 21:47:07 2008 +0200
@@ -5,8 +5,8 @@
# This software may be used and distributed according to the terms
# of the GNU General Public License, incorporated herein by reference.
-helptable = {
- "dates|Date Formats":
+helptable = (
+ ("dates|Date Formats",
r'''
Some commands allow the user to specify a date:
backout, commit, import, tag: Specify the commit date.
@@ -43,9 +43,107 @@
">{date}" - on or after a given date
"{date} to {date}" - a date range, inclusive
"-{days}" - within a given number of days of today
- ''',
+ '''),
- 'environment|env|Environment Variables':
+ ("patterns|File Name Patterns",
+ r'''
+ Mercurial accepts several notations for identifying one or more
+ files at a time.
+
+ By default, Mercurial treats filenames as shell-style extended
+ glob patterns.
+
+ Alternate pattern notations must be specified explicitly.
+
+ To use a plain path name without any pattern matching, start a
+ name with "path:". These path names must match completely, from
+ the root of the current repository.
+
+ To use an extended glob, start a name with "glob:". Globs are
+ rooted at the current directory; a glob such as "*.c" will match
+ files ending in ".c" in the current directory only.
+
+ The supported glob syntax extensions are "**" to match any string
+ across path separators, and "{a,b}" to mean "a or b".
+
+ To use a Perl/Python regular expression, start a name with "re:".
+ Regexp pattern matching is anchored at the root of the repository.
+
+ Plain examples:
+
+ path:foo/bar a name bar in a directory named foo in the root of
+ the repository
+ path:path:name a file or directory named "path:name"
+
+ Glob examples:
+
+ glob:*.c any name ending in ".c" in the current directory
+ *.c any name ending in ".c" in the current directory
+ **.c any name ending in ".c" in the current directory, or
+ any subdirectory
+ foo/*.c any name ending in ".c" in the directory foo
+ foo/**.c any name ending in ".c" in the directory foo, or any
+ subdirectory
+
+ Regexp examples:
+
+ re:.*\.c$ any name ending in ".c", anywhere in the repository
+
+'''),
+
+ ('revs|revisions|Specifying Single Revisions',
+ r'''
+ Mercurial accepts several notations for identifying individual
+ revisions.
+
+ A plain integer is treated as a revision number. Negative
+ integers are treated as offsets from the tip, with -1 denoting the
+ tip.
+
+ A 40-digit hexadecimal string is treated as a unique revision
+ identifier.
+
+ A hexadecimal string less than 40 characters long is treated as a
+ unique revision identifier, and referred to as a short-form
+ identifier. A short-form identifier is only valid if it is the
+ prefix of one full-length identifier.
+
+ Any other string is treated as a tag name, which is a symbolic
+ name associated with a revision identifier. Tag names may not
+ contain the ":" character.
+
+ The reserved name "tip" is a special tag that always identifies
+ the most recent revision.
+
+ The reserved name "null" indicates the null revision. This is the
+ revision of an empty repository, and the parent of revision 0.
+
+ The reserved name "." indicates the working directory parent. If
+ no working directory is checked out, it is equivalent to null.
+ If an uncommitted merge is in progress, "." is the revision of
+ the first parent.
+'''),
+
+ ('mrevs|multirevs|Specifying Multiple Revisions',
+ r'''
+ When Mercurial accepts more than one revision, they may be
+ specified individually, or provided as a continuous range,
+ separated by the ":" character.
+
+ The syntax of range notation is [BEGIN]:[END], where BEGIN and END
+ are revision identifiers. Both BEGIN and END are optional. If
+ BEGIN is not specified, it defaults to revision number 0. If END
+ is not specified, it defaults to the tip. The range ":" thus
+ means "all revisions".
+
+ If BEGIN is greater than END, revisions are treated in reverse
+ order.
+
+ A range acts as a closed interval. This means that a range of 3:5
+ gives 3, 4 and 5. Similarly, a range of 4:2 gives 4, 3, and 2.
+'''),
+
+ ('environment|env|Environment Variables',
r'''
HG::
Path to the 'hg' executable, automatically passed when running hooks,
@@ -114,103 +212,6 @@
PYTHONPATH::
This is used by Python to find imported modules and may need to be set
appropriately if Mercurial is not installed system-wide.
- ''',
+ '''),
+)
- "patterns|File Name Patterns": r'''
- Mercurial accepts several notations for identifying one or more
- files at a time.
-
- By default, Mercurial treats filenames as shell-style extended
- glob patterns.
-
- Alternate pattern notations must be specified explicitly.
-
- To use a plain path name without any pattern matching, start a
- name with "path:". These path names must match completely, from
- the root of the current repository.
-
- To use an extended glob, start a name with "glob:". Globs are
- rooted at the current directory; a glob such as "*.c" will match
- files ending in ".c" in the current directory only.
-
- The supported glob syntax extensions are "**" to match any string
- across path separators, and "{a,b}" to mean "a or b".
-
- To use a Perl/Python regular expression, start a name with "re:".
- Regexp pattern matching is anchored at the root of the repository.
-
- Plain examples:
-
- path:foo/bar a name bar in a directory named foo in the root of
- the repository
- path:path:name a file or directory named "path:name"
-
- Glob examples:
-
- glob:*.c any name ending in ".c" in the current directory
- *.c any name ending in ".c" in the current directory
- **.c any name ending in ".c" in the current directory, or
- any subdirectory
- foo/*.c any name ending in ".c" in the directory foo
- foo/**.c any name ending in ".c" in the directory foo, or any
- subdirectory
-
- Regexp examples:
-
- re:.*\.c$ any name ending in ".c", anywhere in the repository
-
-''',
-
- 'revs|revisions|Specifying Single Revisions':
- r'''
- Mercurial accepts several notations for identifying individual
- revisions.
-
- A plain integer is treated as a revision number. Negative
- integers are treated as offsets from the tip, with -1 denoting the
- tip.
-
- A 40-digit hexadecimal string is treated as a unique revision
- identifier.
-
- A hexadecimal string less than 40 characters long is treated as a
- unique revision identifier, and referred to as a short-form
- identifier. A short-form identifier is only valid if it is the
- prefix of one full-length identifier.
-
- Any other string is treated as a tag name, which is a symbolic
- name associated with a revision identifier. Tag names may not
- contain the ":" character.
-
- The reserved name "tip" is a special tag that always identifies
- the most recent revision.
-
- The reserved name "null" indicates the null revision. This is the
- revision of an empty repository, and the parent of revision 0.
-
- The reserved name "." indicates the working directory parent. If
- no working directory is checked out, it is equivalent to null.
- If an uncommitted merge is in progress, "." is the revision of
- the first parent.
-''',
-
- 'mrevs|multirevs|Specifying Multiple Revisions':
- r'''
- When Mercurial accepts more than one revision, they may be
- specified individually, or provided as a continuous range,
- separated by the ":" character.
-
- The syntax of range notation is [BEGIN]:[END], where BEGIN and END
- are revision identifiers. Both BEGIN and END are optional. If
- BEGIN is not specified, it defaults to revision number 0. If END
- is not specified, it defaults to the tip. The range ":" thus
- means "all revisions".
-
- If BEGIN is greater than END, revisions are treated in reverse
- order.
-
- A range acts as a closed interval. This means that a range of 3:5
- gives 3, 4 and 5. Similarly, a range of 4:2 gives 4, 3, and 2.
-''',
-}
-
More information about the Mercurial-devel
mailing list