##// END OF EJS Templates
restructure helptable...
Martin Geisler -
r7012:78341ea6 default
parent child Browse files
Show More
@@ -92,9 +92,7 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, doc in helptable:
95 for names, section, doc in helptable:
96 l = t.split("|")
97 section = l[-1]
98 underlined(_(section).upper())
96 underlined(_(section).upper())
99 if callable(doc):
97 if callable(doc):
100 doc = doc()
98 doc = doc()
@@ -1339,14 +1339,10 b' def help_(ui, name=None, with_version=Fa'
1339 addglobalopts(True)
1339 addglobalopts(True)
1340
1340
1341 def helptopic(name):
1341 def helptopic(name):
1342 v = None
1342 for names, header, doc in help.helptable:
1343 for i, d in help.helptable:
1343 if name in names:
1344 l = i.split('|')
1344 break
1345 if name in l:
1345 else:
1346 v = i
1347 header = l[-1]
1348 doc = d
1349 if not v:
1350 raise cmdutil.UnknownCommand(name)
1346 raise cmdutil.UnknownCommand(name)
1351
1347
1352 # description
1348 # description
@@ -1423,9 +1419,8 b' def help_(ui, name=None, with_version=Fa'
1423 if ui.verbose:
1419 if ui.verbose:
1424 ui.write(_("\nspecial help topics:\n"))
1420 ui.write(_("\nspecial help topics:\n"))
1425 topics = []
1421 topics = []
1426 for i, d in help.helptable:
1422 for names, header, doc in help.helptable:
1427 l = i.split('|')
1423 topics.append((", ".join(names), header))
1428 topics.append((", ".join(l[:-1]), l[-1]))
1429 topics_len = max([len(s[0]) for s in topics])
1424 topics_len = max([len(s[0]) for s in topics])
1430 for t, desc in topics:
1425 for t, desc in topics:
1431 ui.write(" %-*s %s\n" % (topics_len, t, desc))
1426 ui.write(" %-*s %s\n" % (topics_len, t, desc))
@@ -6,7 +6,7 b''
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.
@@ -45,7 +45,7 b' helptable = ('
45 "-{days}" - within a given number of days of today
45 "-{days}" - within a given number of days of today
46 '''),
46 '''),
47
47
48 ("patterns|File Name Patterns",
48 (["patterns"], "File Name Patterns",
49 r'''
49 r'''
50 Mercurial accepts several notations for identifying one or more
50 Mercurial accepts several notations for identifying one or more
51 files at a time.
51 files at a time.
@@ -91,7 +91,7 b' helptable = ('
91
91
92 '''),
92 '''),
93
93
94 ('environment|env|Environment Variables',
94 (['environment', 'env'], 'Environment Variables',
95 r'''
95 r'''
96 HG::
96 HG::
97 Path to the 'hg' executable, automatically passed when running hooks,
97 Path to the 'hg' executable, automatically passed when running hooks,
@@ -162,7 +162,7 b' PYTHONPATH::'
162 appropriately if Mercurial is not installed system-wide.
162 appropriately if Mercurial is not installed system-wide.
163 '''),
163 '''),
164
164
165 ('revs|revisions|Specifying Single Revisions',
165 (['revs', 'revisions'], 'Specifying Single Revisions',
166 r'''
166 r'''
167 Mercurial accepts several notations for identifying individual
167 Mercurial accepts several notations for identifying individual
168 revisions.
168 revisions.
@@ -195,7 +195,7 b' PYTHONPATH::'
195 the first parent.
195 the first parent.
196 '''),
196 '''),
197
197
198 ('mrevs|multirevs|Specifying Multiple Revisions',
198 (['mrevs', 'multirevs'], 'Specifying Multiple Revisions',
199 r'''
199 r'''
200 When Mercurial accepts more than one revision, they may be
200 When Mercurial accepts more than one revision, they may be
201 specified individually, or provided as a continuous range,
201 specified individually, or provided as a continuous range,
General Comments 0
You need to be logged in to leave comments. Login now