Show More
@@ -92,11 +92,10 b' def show_doc(ui):' | |||||
92 | ui.write(_(" aliases: %s\n\n") % " ".join(d['aliases'])) |
|
92 | ui.write(_(" aliases: %s\n\n") % " ".join(d['aliases'])) | |
93 |
|
93 | |||
94 | # print topics |
|
94 | # print topics | |
95 | for t in helptable: |
|
95 | for t, doc in helptable: | |
96 | l = t.split("|") |
|
96 | l = t.split("|") | |
97 | section = l[-1] |
|
97 | section = l[-1] | |
98 | underlined(_(section).upper()) |
|
98 | underlined(_(section).upper()) | |
99 | doc = helptable[t] |
|
|||
100 | if callable(doc): |
|
99 | if callable(doc): | |
101 | doc = doc() |
|
100 | doc = doc() | |
102 | ui.write(_(doc)) |
|
101 | ui.write(_(doc)) |
@@ -1321,16 +1321,16 b' def help_(ui, name=None, with_version=Fa' | |||||
1321 |
|
1321 | |||
1322 | def helptopic(name): |
|
1322 | def helptopic(name): | |
1323 | v = None |
|
1323 | v = None | |
1324 | for i in help.helptable: |
|
1324 | for i, d in help.helptable: | |
1325 | l = i.split('|') |
|
1325 | l = i.split('|') | |
1326 | if name in l: |
|
1326 | if name in l: | |
1327 | v = i |
|
1327 | v = i | |
1328 | header = l[-1] |
|
1328 | header = l[-1] | |
|
1329 | doc = d | |||
1329 | if not v: |
|
1330 | if not v: | |
1330 | raise cmdutil.UnknownCommand(name) |
|
1331 | raise cmdutil.UnknownCommand(name) | |
1331 |
|
1332 | |||
1332 | # description |
|
1333 | # description | |
1333 | doc = help.helptable[v] |
|
|||
1334 | if not doc: |
|
1334 | if not doc: | |
1335 | doc = _("(No help text available)") |
|
1335 | doc = _("(No help text available)") | |
1336 | if callable(doc): |
|
1336 | if callable(doc): | |
@@ -1404,7 +1404,7 b' def help_(ui, name=None, with_version=Fa' | |||||
1404 | if ui.verbose: |
|
1404 | if ui.verbose: | |
1405 | ui.write(_("\nspecial help topics:\n")) |
|
1405 | ui.write(_("\nspecial help topics:\n")) | |
1406 | topics = [] |
|
1406 | topics = [] | |
1407 | for i in help.helptable: |
|
1407 | for i, d in help.helptable: | |
1408 | l = i.split('|') |
|
1408 | l = i.split('|') | |
1409 | topics.append((", ".join(l[:-1]), l[-1])) |
|
1409 | topics.append((", ".join(l[:-1]), l[-1])) | |
1410 | topics_len = max([len(s[0]) for s in topics]) |
|
1410 | topics_len = max([len(s[0]) for s in topics]) |
@@ -5,8 +5,8 b'' | |||||
5 | # This software may be used and distributed according to the terms |
|
5 | # This software may be used and distributed according to the terms | |
6 | # of the GNU General Public License, incorporated herein by reference. |
|
6 | # of the GNU General Public License, incorporated herein by reference. | |
7 |
|
7 | |||
8 |
helptable = |
|
8 | helptable = ( | |
9 |
"dates|Date Formats" |
|
9 | ("dates|Date Formats", | |
10 | r''' |
|
10 | r''' | |
11 | Some commands allow the user to specify a date: |
|
11 | Some commands allow the user to specify a date: | |
12 | backout, commit, import, tag: Specify the commit date. |
|
12 | backout, commit, import, tag: Specify the commit date. | |
@@ -43,9 +43,55 b' helptable = {' | |||||
43 | ">{date}" - on or after a given date |
|
43 | ">{date}" - on or after a given date | |
44 | "{date} to {date}" - a date range, inclusive |
|
44 | "{date} to {date}" - a date range, inclusive | |
45 | "-{days}" - within a given number of days of today |
|
45 | "-{days}" - within a given number of days of today | |
46 | ''', |
|
46 | '''), | |
|
47 | ||||
|
48 | ("patterns|File Name Patterns", | |||
|
49 | r''' | |||
|
50 | Mercurial accepts several notations for identifying one or more | |||
|
51 | files at a time. | |||
|
52 | ||||
|
53 | By default, Mercurial treats filenames as shell-style extended | |||
|
54 | glob patterns. | |||
|
55 | ||||
|
56 | Alternate pattern notations must be specified explicitly. | |||
|
57 | ||||
|
58 | To use a plain path name without any pattern matching, start a | |||
|
59 | name with "path:". These path names must match completely, from | |||
|
60 | the root of the current repository. | |||
|
61 | ||||
|
62 | To use an extended glob, start a name with "glob:". Globs are | |||
|
63 | rooted at the current directory; a glob such as "*.c" will match | |||
|
64 | files ending in ".c" in the current directory only. | |||
|
65 | ||||
|
66 | The supported glob syntax extensions are "**" to match any string | |||
|
67 | across path separators, and "{a,b}" to mean "a or b". | |||
47 |
|
|
68 | ||
48 | 'environment|env|Environment Variables': |
|
69 | To use a Perl/Python regular expression, start a name with "re:". | |
|
70 | Regexp pattern matching is anchored at the root of the repository. | |||
|
71 | ||||
|
72 | Plain examples: | |||
|
73 | ||||
|
74 | path:foo/bar a name bar in a directory named foo in the root of | |||
|
75 | the repository | |||
|
76 | path:path:name a file or directory named "path:name" | |||
|
77 | ||||
|
78 | Glob examples: | |||
|
79 | ||||
|
80 | glob:*.c any name ending in ".c" in the current directory | |||
|
81 | *.c any name ending in ".c" in the current directory | |||
|
82 | **.c any name ending in ".c" in the current directory, or | |||
|
83 | any subdirectory | |||
|
84 | foo/*.c any name ending in ".c" in the directory foo | |||
|
85 | foo/**.c any name ending in ".c" in the directory foo, or any | |||
|
86 | subdirectory | |||
|
87 | ||||
|
88 | Regexp examples: | |||
|
89 | ||||
|
90 | re:.*\.c$ any name ending in ".c", anywhere in the repository | |||
|
91 | ||||
|
92 | '''), | |||
|
93 | ||||
|
94 | ('environment|env|Environment Variables', | |||
49 | r''' |
|
95 | r''' | |
50 | HG:: |
|
96 | HG:: | |
51 | Path to the 'hg' executable, automatically passed when running hooks, |
|
97 | Path to the 'hg' executable, automatically passed when running hooks, | |
@@ -114,51 +160,5 b' EDITOR::' | |||||
114 | PYTHONPATH:: |
|
160 | PYTHONPATH:: | |
115 | This is used by Python to find imported modules and may need to be set |
|
161 | This is used by Python to find imported modules and may need to be set | |
116 | appropriately if Mercurial is not installed system-wide. |
|
162 | appropriately if Mercurial is not installed system-wide. | |
117 | ''', |
|
163 | '''), | |
118 |
|
164 | ) | ||
119 | "patterns|File Name Patterns": r''' |
|
|||
120 | Mercurial accepts several notations for identifying one or more |
|
|||
121 | files at a time. |
|
|||
122 |
|
||||
123 | By default, Mercurial treats filenames as shell-style extended |
|
|||
124 | glob patterns. |
|
|||
125 |
|
||||
126 | Alternate pattern notations must be specified explicitly. |
|
|||
127 |
|
||||
128 | To use a plain path name without any pattern matching, start a |
|
|||
129 | name with "path:". These path names must match completely, from |
|
|||
130 | the root of the current repository. |
|
|||
131 |
|
||||
132 | To use an extended glob, start a name with "glob:". Globs are |
|
|||
133 | rooted at the current directory; a glob such as "*.c" will match |
|
|||
134 | files ending in ".c" in the current directory only. |
|
|||
135 |
|
||||
136 | The supported glob syntax extensions are "**" to match any string |
|
|||
137 | across path separators, and "{a,b}" to mean "a or b". |
|
|||
138 |
|
||||
139 | To use a Perl/Python regular expression, start a name with "re:". |
|
|||
140 | Regexp pattern matching is anchored at the root of the repository. |
|
|||
141 |
|
||||
142 | Plain examples: |
|
|||
143 |
|
||||
144 | path:foo/bar a name bar in a directory named foo in the root of |
|
|||
145 | the repository |
|
|||
146 | path:path:name a file or directory named "path:name" |
|
|||
147 |
|
||||
148 | Glob examples: |
|
|||
149 |
|
||||
150 | glob:*.c any name ending in ".c" in the current directory |
|
|||
151 | *.c any name ending in ".c" in the current directory |
|
|||
152 | **.c any name ending in ".c" in the current directory, or |
|
|||
153 | any subdirectory |
|
|||
154 | foo/*.c any name ending in ".c" in the directory foo |
|
|||
155 | foo/**.c any name ending in ".c" in the directory foo, or any |
|
|||
156 | subdirectory |
|
|||
157 |
|
||||
158 | Regexp examples: |
|
|||
159 |
|
||||
160 | re:.*\.c$ any name ending in ".c", anywhere in the repository |
|
|||
161 |
|
||||
162 | ''', |
|
|||
163 | } |
|
|||
164 |
|
General Comments 0
You need to be logged in to leave comments.
Login now