##// END OF EJS Templates
help: sort help topics to make the output more readable (issue2751)
Yun Lee -
r13888:9e5407a6 default
parent child Browse files
Show More
@@ -1,133 +1,133
1 1 # help.py - help data for mercurial
2 2 #
3 3 # Copyright 2006 Matt Mackall <mpm@selenic.com>
4 4 #
5 5 # This software may be used and distributed according to the terms of the
6 6 # GNU General Public License version 2 or any later version.
7 7
8 8 from i18n import gettext, _
9 9 import sys, os
10 10 import extensions
11 11
12 12
13 13 def moduledoc(file):
14 14 '''return the top-level python documentation for the given file
15 15
16 16 Loosely inspired by pydoc.source_synopsis(), but rewritten to
17 17 handle triple quotes and to return the whole text instead of just
18 18 the synopsis'''
19 19 result = []
20 20
21 21 line = file.readline()
22 22 while line[:1] == '#' or not line.strip():
23 23 line = file.readline()
24 24 if not line:
25 25 break
26 26
27 27 start = line[:3]
28 28 if start == '"""' or start == "'''":
29 29 line = line[3:]
30 30 while line:
31 31 if line.rstrip().endswith(start):
32 32 line = line.split(start)[0]
33 33 if line:
34 34 result.append(line)
35 35 break
36 36 elif not line:
37 37 return None # unmatched delimiter
38 38 result.append(line)
39 39 line = file.readline()
40 40 else:
41 41 return None
42 42
43 43 return ''.join(result)
44 44
45 45 def listexts(header, exts, maxlength, indent=1):
46 46 '''return a text listing of the given extensions'''
47 47 if not exts:
48 48 return ''
49 49 result = '\n%s\n\n' % header
50 50 for name, desc in sorted(exts.iteritems()):
51 51 result += '%s%-*s %s\n' % (' ' * indent, maxlength + 2,
52 52 ':%s:' % name, desc)
53 53 return result
54 54
55 55 def extshelp():
56 56 doc = loaddoc('extensions')()
57 57
58 58 exts, maxlength = extensions.enabled()
59 59 doc += listexts(_('enabled extensions:'), exts, maxlength)
60 60
61 61 exts, maxlength = extensions.disabled()
62 62 doc += listexts(_('disabled extensions:'), exts, maxlength)
63 63
64 64 return doc
65 65
66 66 def loaddoc(topic):
67 67 """Return a delayed loader for help/topic.txt."""
68 68
69 69 def loader():
70 70 if hasattr(sys, 'frozen'):
71 71 module = sys.executable
72 72 else:
73 73 module = __file__
74 74 base = os.path.dirname(module)
75 75
76 76 for dir in ('.', '..'):
77 77 docdir = os.path.join(base, dir, 'help')
78 78 if os.path.isdir(docdir):
79 79 break
80 80
81 81 path = os.path.join(docdir, topic + ".txt")
82 82 doc = gettext(open(path).read())
83 83 for rewriter in helphooks.get(topic, []):
84 84 doc = rewriter(topic, doc)
85 85 return doc
86 86
87 87 return loader
88 88
89 helptable = [
89 helptable = sorted([
90 90 (["config", "hgrc"], _("Configuration Files"), loaddoc('config')),
91 91 (["dates"], _("Date Formats"), loaddoc('dates')),
92 92 (["patterns"], _("File Name Patterns"), loaddoc('patterns')),
93 93 (['environment', 'env'], _('Environment Variables'),
94 94 loaddoc('environment')),
95 95 (['revs', 'revisions'], _('Specifying Single Revisions'),
96 96 loaddoc('revisions')),
97 97 (['mrevs', 'multirevs'], _('Specifying Multiple Revisions'),
98 98 loaddoc('multirevs')),
99 99 (['revset', 'revsets'], _("Specifying Revision Sets"), loaddoc('revsets')),
100 100 (['diffs'], _('Diff Formats'), loaddoc('diffs')),
101 101 (['merge-tools'], _('Merge Tools'), loaddoc('merge-tools')),
102 102 (['templating', 'templates'], _('Template Usage'),
103 103 loaddoc('templates')),
104 104 (['urls'], _('URL Paths'), loaddoc('urls')),
105 105 (["extensions"], _("Using additional features"), extshelp),
106 106 (["subrepo", "subrepos"], _("Subrepositories"), loaddoc('subrepos')),
107 107 (["hgweb"], _("Configuring hgweb"), loaddoc('hgweb')),
108 108 (["glossary"], _("Glossary"), loaddoc('glossary')),
109 ]
109 ])
110 110
111 111 # Map topics to lists of callable taking the current topic help and
112 112 # returning the updated version
113 113 helphooks = {
114 114 }
115 115
116 116 def addtopichook(topic, rewriter):
117 117 helphooks.setdefault(topic, []).append(rewriter)
118 118
119 119 def makeitemsdoc(topic, doc, marker, items):
120 120 """Extract docstring from the items key to function mapping, build a
121 121 .single documentation block and use it to overwrite the marker in doc
122 122 """
123 123 entries = []
124 124 for name in sorted(items):
125 125 text = (items[name].__doc__ or '').rstrip()
126 126 if not text:
127 127 continue
128 128 text = gettext(text)
129 129 lines = text.splitlines()
130 130 lines[1:] = [(' ' + l.strip()) for l in lines[1:]]
131 131 entries.append('\n'.join(lines))
132 132 entries = '\n\n'.join(entries)
133 133 return doc.replace(marker, entries)
@@ -1,432 +1,434
1 1 $ "$TESTDIR/hghave" no-outer-repo || exit 80
2 2
3 3 $ hg init a
4 4 $ cd a
5 5 $ echo a > a
6 6 $ hg ci -A -d'1 0' -m a
7 7 adding a
8 8
9 9 $ cd ..
10 10
11 11 $ hg init b
12 12 $ cd b
13 13 $ echo b > b
14 14 $ hg ci -A -d'1 0' -m b
15 15 adding b
16 16
17 17 $ cd ..
18 18
19 19 $ hg clone a c
20 20 updating to branch default
21 21 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
22 22 $ cd c
23 23 $ cat >> .hg/hgrc <<EOF
24 24 > [paths]
25 25 > relative = ../a
26 26 > EOF
27 27 $ hg pull -f ../b
28 28 pulling from ../b
29 29 searching for changes
30 30 warning: repository is unrelated
31 31 requesting all changes
32 32 adding changesets
33 33 adding manifests
34 34 adding file changes
35 35 added 1 changesets with 1 changes to 1 files (+1 heads)
36 36 (run 'hg heads' to see heads, 'hg merge' to merge)
37 37 $ hg merge
38 38 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
39 39 (branch merge, don't forget to commit)
40 40
41 41 $ cd ..
42 42
43 43 Testing -R/--repository:
44 44
45 45 $ hg -R a tip
46 46 changeset: 0:8580ff50825a
47 47 tag: tip
48 48 user: test
49 49 date: Thu Jan 01 00:00:01 1970 +0000
50 50 summary: a
51 51
52 52 $ hg --repository b tip
53 53 changeset: 0:b6c483daf290
54 54 tag: tip
55 55 user: test
56 56 date: Thu Jan 01 00:00:01 1970 +0000
57 57 summary: b
58 58
59 59
60 60 -R with a URL:
61 61
62 62 $ hg -R file:a identify
63 63 8580ff50825a tip
64 64 $ hg -R file://localhost/`pwd`/a/ identify
65 65 8580ff50825a tip
66 66
67 67 -R with path aliases:
68 68
69 69 $ cd c
70 70 $ hg -R default identify
71 71 8580ff50825a tip
72 72 $ hg -R relative identify
73 73 8580ff50825a tip
74 74 $ echo '[paths]' >> $HGRCPATH
75 75 $ echo 'relativetohome = a' >> $HGRCPATH
76 76 $ HOME=`pwd`/../ hg -R relativetohome identify
77 77 8580ff50825a tip
78 78 $ cd ..
79 79
80 80 Implicit -R:
81 81
82 82 $ hg ann a/a
83 83 0: a
84 84 $ hg ann a/a a/a
85 85 0: a
86 86 $ hg ann a/a b/b
87 87 abort: There is no Mercurial repository here (.hg not found)!
88 88 [255]
89 89 $ hg -R b ann a/a
90 90 abort: a/a not under root
91 91 [255]
92 92 $ hg log
93 93 abort: There is no Mercurial repository here (.hg not found)!
94 94 [255]
95 95
96 96 Abbreviation of long option:
97 97
98 98 $ hg --repo c tip
99 99 changeset: 1:b6c483daf290
100 100 tag: tip
101 101 parent: -1:000000000000
102 102 user: test
103 103 date: Thu Jan 01 00:00:01 1970 +0000
104 104 summary: b
105 105
106 106
107 107 earlygetopt with duplicate options (36d23de02da1):
108 108
109 109 $ hg --cwd a --cwd b --cwd c tip
110 110 changeset: 1:b6c483daf290
111 111 tag: tip
112 112 parent: -1:000000000000
113 113 user: test
114 114 date: Thu Jan 01 00:00:01 1970 +0000
115 115 summary: b
116 116
117 117 $ hg --repo c --repository b -R a tip
118 118 changeset: 0:8580ff50825a
119 119 tag: tip
120 120 user: test
121 121 date: Thu Jan 01 00:00:01 1970 +0000
122 122 summary: a
123 123
124 124
125 125 earlygetopt short option without following space:
126 126
127 127 $ hg -q -Rb tip
128 128 0:b6c483daf290
129 129
130 130 earlygetopt with illegal abbreviations:
131 131
132 132 $ hg --confi "foo.bar=baz"
133 133 abort: option --config may not be abbreviated!
134 134 [255]
135 135 $ hg --cw a tip
136 136 abort: option --cwd may not be abbreviated!
137 137 [255]
138 138 $ hg --rep a tip
139 139 abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
140 140 [255]
141 141 $ hg --repositor a tip
142 142 abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
143 143 [255]
144 144 $ hg -qR a tip
145 145 abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
146 146 [255]
147 147 $ hg -qRa tip
148 148 abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
149 149 [255]
150 150
151 151 Testing --cwd:
152 152
153 153 $ hg --cwd a parents
154 154 changeset: 0:8580ff50825a
155 155 tag: tip
156 156 user: test
157 157 date: Thu Jan 01 00:00:01 1970 +0000
158 158 summary: a
159 159
160 160
161 161 Testing -y/--noninteractive - just be sure it is parsed:
162 162
163 163 $ hg --cwd a tip -q --noninteractive
164 164 0:8580ff50825a
165 165 $ hg --cwd a tip -q -y
166 166 0:8580ff50825a
167 167
168 168 Testing -q/--quiet:
169 169
170 170 $ hg -R a -q tip
171 171 0:8580ff50825a
172 172 $ hg -R b -q tip
173 173 0:b6c483daf290
174 174 $ hg -R c --quiet parents
175 175 0:8580ff50825a
176 176 1:b6c483daf290
177 177
178 178 Testing -v/--verbose:
179 179
180 180 $ hg --cwd c head -v
181 181 changeset: 1:b6c483daf290
182 182 tag: tip
183 183 parent: -1:000000000000
184 184 user: test
185 185 date: Thu Jan 01 00:00:01 1970 +0000
186 186 files: b
187 187 description:
188 188 b
189 189
190 190
191 191 changeset: 0:8580ff50825a
192 192 user: test
193 193 date: Thu Jan 01 00:00:01 1970 +0000
194 194 files: a
195 195 description:
196 196 a
197 197
198 198
199 199 $ hg --cwd b tip --verbose
200 200 changeset: 0:b6c483daf290
201 201 tag: tip
202 202 user: test
203 203 date: Thu Jan 01 00:00:01 1970 +0000
204 204 files: b
205 205 description:
206 206 b
207 207
208 208
209 209
210 210 Testing --config:
211 211
212 212 $ hg --cwd c --config paths.quuxfoo=bar paths | grep quuxfoo > /dev/null && echo quuxfoo
213 213 quuxfoo
214 214 $ hg --cwd c --config '' tip -q
215 215 abort: malformed --config option: '' (use --config section.name=value)
216 216 [255]
217 217 $ hg --cwd c --config a.b tip -q
218 218 abort: malformed --config option: 'a.b' (use --config section.name=value)
219 219 [255]
220 220 $ hg --cwd c --config a tip -q
221 221 abort: malformed --config option: 'a' (use --config section.name=value)
222 222 [255]
223 223 $ hg --cwd c --config a.= tip -q
224 224 abort: malformed --config option: 'a.=' (use --config section.name=value)
225 225 [255]
226 226 $ hg --cwd c --config .b= tip -q
227 227 abort: malformed --config option: '.b=' (use --config section.name=value)
228 228 [255]
229 229
230 230 Testing --debug:
231 231
232 232 $ hg --cwd c log --debug
233 233 changeset: 1:b6c483daf2907ce5825c0bb50f5716226281cc1a
234 234 tag: tip
235 235 parent: -1:0000000000000000000000000000000000000000
236 236 parent: -1:0000000000000000000000000000000000000000
237 237 manifest: 1:23226e7a252cacdc2d99e4fbdc3653441056de49
238 238 user: test
239 239 date: Thu Jan 01 00:00:01 1970 +0000
240 240 files+: b
241 241 extra: branch=default
242 242 description:
243 243 b
244 244
245 245
246 246 changeset: 0:8580ff50825a50c8f716709acdf8de0deddcd6ab
247 247 parent: -1:0000000000000000000000000000000000000000
248 248 parent: -1:0000000000000000000000000000000000000000
249 249 manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
250 250 user: test
251 251 date: Thu Jan 01 00:00:01 1970 +0000
252 252 files+: a
253 253 extra: branch=default
254 254 description:
255 255 a
256 256
257 257
258 258
259 259 Testing --traceback:
260 260
261 261 $ hg --cwd c --config x --traceback id 2>&1 | grep -i 'traceback'
262 262 Traceback (most recent call last):
263 263
264 264 Testing --time:
265 265
266 266 $ hg --cwd a --time id
267 267 8580ff50825a tip
268 268 Time: real * (glob)
269 269
270 270 Testing --version:
271 271
272 272 $ hg --version -q
273 273 Mercurial Distributed SCM * (glob)
274 274
275 275 Testing -h/--help:
276 276
277 277 $ hg -h
278 278 Mercurial Distributed SCM
279 279
280 280 list of commands:
281 281
282 282 add add the specified files on the next commit
283 283 addremove add all new files, delete all missing files
284 284 annotate show changeset information by line for each file
285 285 archive create an unversioned archive of a repository revision
286 286 backout reverse effect of earlier changeset
287 287 bisect subdivision search of changesets
288 288 bookmarks track a line of development with movable markers
289 289 branch set or show the current branch name
290 290 branches list repository named branches
291 291 bundle create a changegroup file
292 292 cat output the current or given revision of files
293 293 clone make a copy of an existing repository
294 294 commit commit the specified files or all outstanding changes
295 295 copy mark files as copied for the next commit
296 296 diff diff repository (or selected files)
297 297 export dump the header and diffs for one or more changesets
298 298 forget forget the specified files on the next commit
299 299 grep search for a pattern in specified files and revisions
300 300 heads show current repository heads or show branch heads
301 301 help show help for a given topic or a help overview
302 302 identify identify the working copy or specified revision
303 303 import import an ordered set of patches
304 304 incoming show new changesets found in source
305 305 init create a new repository in the given directory
306 306 locate locate files matching specific patterns
307 307 log show revision history of entire repository or files
308 308 manifest output the current or given revision of the project manifest
309 309 merge merge working directory with another revision
310 310 outgoing show changesets not found in the destination
311 311 parents show the parents of the working directory or revision
312 312 paths show aliases for remote repositories
313 313 pull pull changes from the specified source
314 314 push push changes to the specified destination
315 315 recover roll back an interrupted transaction
316 316 remove remove the specified files on the next commit
317 317 rename rename files; equivalent of copy + remove
318 318 resolve redo merges or set/view the merge status of files
319 319 revert restore individual files or directories to an earlier state
320 320 rollback roll back the last transaction (dangerous)
321 321 root print the root (top) of the current working directory
322 322 serve start stand-alone webserver
323 323 showconfig show combined config settings from all hgrc files
324 324 status show changed files in the working directory
325 325 summary summarize working directory state
326 326 tag add one or more tags for the current or given revision
327 327 tags list repository tags
328 328 tip show the tip revision
329 329 unbundle apply one or more changegroup files
330 330 update update working directory (or switch revisions)
331 331 verify verify the integrity of the repository
332 332 version output version and copyright information
333 333
334 334 additional help topics:
335 335
336 336 config Configuration Files
337 337 dates Date Formats
338 patterns File Name Patterns
338 diffs Diff Formats
339 339 environment Environment Variables
340 revisions Specifying Single Revisions
340 extensions Using additional features
341 glossary Glossary
342 hgweb Configuring hgweb
343 merge-tools Merge Tools
341 344 multirevs Specifying Multiple Revisions
345 patterns File Name Patterns
346 revisions Specifying Single Revisions
342 347 revsets Specifying Revision Sets
343 diffs Diff Formats
344 merge-tools Merge Tools
348 subrepos Subrepositories
345 349 templating Template Usage
346 350 urls URL Paths
347 extensions Using additional features
348 subrepos Subrepositories
349 hgweb Configuring hgweb
350 glossary Glossary
351 351
352 352 use "hg -v help" to show builtin aliases and global options
353 353
354
355
354 356 $ hg --help
355 357 Mercurial Distributed SCM
356 358
357 359 list of commands:
358 360
359 361 add add the specified files on the next commit
360 362 addremove add all new files, delete all missing files
361 363 annotate show changeset information by line for each file
362 364 archive create an unversioned archive of a repository revision
363 365 backout reverse effect of earlier changeset
364 366 bisect subdivision search of changesets
365 367 bookmarks track a line of development with movable markers
366 368 branch set or show the current branch name
367 369 branches list repository named branches
368 370 bundle create a changegroup file
369 371 cat output the current or given revision of files
370 372 clone make a copy of an existing repository
371 373 commit commit the specified files or all outstanding changes
372 374 copy mark files as copied for the next commit
373 375 diff diff repository (or selected files)
374 376 export dump the header and diffs for one or more changesets
375 377 forget forget the specified files on the next commit
376 378 grep search for a pattern in specified files and revisions
377 379 heads show current repository heads or show branch heads
378 380 help show help for a given topic or a help overview
379 381 identify identify the working copy or specified revision
380 382 import import an ordered set of patches
381 383 incoming show new changesets found in source
382 384 init create a new repository in the given directory
383 385 locate locate files matching specific patterns
384 386 log show revision history of entire repository or files
385 387 manifest output the current or given revision of the project manifest
386 388 merge merge working directory with another revision
387 389 outgoing show changesets not found in the destination
388 390 parents show the parents of the working directory or revision
389 391 paths show aliases for remote repositories
390 392 pull pull changes from the specified source
391 393 push push changes to the specified destination
392 394 recover roll back an interrupted transaction
393 395 remove remove the specified files on the next commit
394 396 rename rename files; equivalent of copy + remove
395 397 resolve redo merges or set/view the merge status of files
396 398 revert restore individual files or directories to an earlier state
397 399 rollback roll back the last transaction (dangerous)
398 400 root print the root (top) of the current working directory
399 401 serve start stand-alone webserver
400 402 showconfig show combined config settings from all hgrc files
401 403 status show changed files in the working directory
402 404 summary summarize working directory state
403 405 tag add one or more tags for the current or given revision
404 406 tags list repository tags
405 407 tip show the tip revision
406 408 unbundle apply one or more changegroup files
407 409 update update working directory (or switch revisions)
408 410 verify verify the integrity of the repository
409 411 version output version and copyright information
410 412
411 413 additional help topics:
412 414
413 415 config Configuration Files
414 416 dates Date Formats
415 patterns File Name Patterns
417 diffs Diff Formats
416 418 environment Environment Variables
417 revisions Specifying Single Revisions
419 extensions Using additional features
420 glossary Glossary
421 hgweb Configuring hgweb
422 merge-tools Merge Tools
418 423 multirevs Specifying Multiple Revisions
424 patterns File Name Patterns
425 revisions Specifying Single Revisions
419 426 revsets Specifying Revision Sets
420 diffs Diff Formats
421 merge-tools Merge Tools
427 subrepos Subrepositories
422 428 templating Template Usage
423 429 urls URL Paths
424 extensions Using additional features
425 subrepos Subrepositories
426 hgweb Configuring hgweb
427 glossary Glossary
428 430
429 431 use "hg -v help" to show builtin aliases and global options
430 432
431 433 Not tested: --debugger
432 434
@@ -1,801 +1,803
1 1 Short help:
2 2
3 3 $ hg
4 4 Mercurial Distributed SCM
5 5
6 6 basic commands:
7 7
8 8 add add the specified files on the next commit
9 9 annotate show changeset information by line for each file
10 10 clone make a copy of an existing repository
11 11 commit commit the specified files or all outstanding changes
12 12 diff diff repository (or selected files)
13 13 export dump the header and diffs for one or more changesets
14 14 forget forget the specified files on the next commit
15 15 init create a new repository in the given directory
16 16 log show revision history of entire repository or files
17 17 merge merge working directory with another revision
18 18 pull pull changes from the specified source
19 19 push push changes to the specified destination
20 20 remove remove the specified files on the next commit
21 21 serve start stand-alone webserver
22 22 status show changed files in the working directory
23 23 summary summarize working directory state
24 24 update update working directory (or switch revisions)
25 25
26 26 use "hg help" for the full list of commands or "hg -v" for details
27 27
28 28 $ hg -q
29 29 add add the specified files on the next commit
30 30 annotate show changeset information by line for each file
31 31 clone make a copy of an existing repository
32 32 commit commit the specified files or all outstanding changes
33 33 diff diff repository (or selected files)
34 34 export dump the header and diffs for one or more changesets
35 35 forget forget the specified files on the next commit
36 36 init create a new repository in the given directory
37 37 log show revision history of entire repository or files
38 38 merge merge working directory with another revision
39 39 pull pull changes from the specified source
40 40 push push changes to the specified destination
41 41 remove remove the specified files on the next commit
42 42 serve start stand-alone webserver
43 43 status show changed files in the working directory
44 44 summary summarize working directory state
45 45 update update working directory (or switch revisions)
46 46
47 47 $ hg help
48 48 Mercurial Distributed SCM
49 49
50 50 list of commands:
51 51
52 52 add add the specified files on the next commit
53 53 addremove add all new files, delete all missing files
54 54 annotate show changeset information by line for each file
55 55 archive create an unversioned archive of a repository revision
56 56 backout reverse effect of earlier changeset
57 57 bisect subdivision search of changesets
58 58 bookmarks track a line of development with movable markers
59 59 branch set or show the current branch name
60 60 branches list repository named branches
61 61 bundle create a changegroup file
62 62 cat output the current or given revision of files
63 63 clone make a copy of an existing repository
64 64 commit commit the specified files or all outstanding changes
65 65 copy mark files as copied for the next commit
66 66 diff diff repository (or selected files)
67 67 export dump the header and diffs for one or more changesets
68 68 forget forget the specified files on the next commit
69 69 grep search for a pattern in specified files and revisions
70 70 heads show current repository heads or show branch heads
71 71 help show help for a given topic or a help overview
72 72 identify identify the working copy or specified revision
73 73 import import an ordered set of patches
74 74 incoming show new changesets found in source
75 75 init create a new repository in the given directory
76 76 locate locate files matching specific patterns
77 77 log show revision history of entire repository or files
78 78 manifest output the current or given revision of the project manifest
79 79 merge merge working directory with another revision
80 80 outgoing show changesets not found in the destination
81 81 parents show the parents of the working directory or revision
82 82 paths show aliases for remote repositories
83 83 pull pull changes from the specified source
84 84 push push changes to the specified destination
85 85 recover roll back an interrupted transaction
86 86 remove remove the specified files on the next commit
87 87 rename rename files; equivalent of copy + remove
88 88 resolve redo merges or set/view the merge status of files
89 89 revert restore individual files or directories to an earlier state
90 90 rollback roll back the last transaction (dangerous)
91 91 root print the root (top) of the current working directory
92 92 serve start stand-alone webserver
93 93 showconfig show combined config settings from all hgrc files
94 94 status show changed files in the working directory
95 95 summary summarize working directory state
96 96 tag add one or more tags for the current or given revision
97 97 tags list repository tags
98 98 tip show the tip revision
99 99 unbundle apply one or more changegroup files
100 100 update update working directory (or switch revisions)
101 101 verify verify the integrity of the repository
102 102 version output version and copyright information
103 103
104 104 additional help topics:
105 105
106 106 config Configuration Files
107 107 dates Date Formats
108 patterns File Name Patterns
108 diffs Diff Formats
109 109 environment Environment Variables
110 revisions Specifying Single Revisions
110 extensions Using additional features
111 glossary Glossary
112 hgweb Configuring hgweb
113 merge-tools Merge Tools
111 114 multirevs Specifying Multiple Revisions
115 patterns File Name Patterns
116 revisions Specifying Single Revisions
112 117 revsets Specifying Revision Sets
113 diffs Diff Formats
114 merge-tools Merge Tools
118 subrepos Subrepositories
115 119 templating Template Usage
116 120 urls URL Paths
117 extensions Using additional features
118 subrepos Subrepositories
119 hgweb Configuring hgweb
120 glossary Glossary
121 121
122 122 use "hg -v help" to show builtin aliases and global options
123 123
124 124 $ hg -q help
125 125 add add the specified files on the next commit
126 126 addremove add all new files, delete all missing files
127 127 annotate show changeset information by line for each file
128 128 archive create an unversioned archive of a repository revision
129 129 backout reverse effect of earlier changeset
130 130 bisect subdivision search of changesets
131 131 bookmarks track a line of development with movable markers
132 132 branch set or show the current branch name
133 133 branches list repository named branches
134 134 bundle create a changegroup file
135 135 cat output the current or given revision of files
136 136 clone make a copy of an existing repository
137 137 commit commit the specified files or all outstanding changes
138 138 copy mark files as copied for the next commit
139 139 diff diff repository (or selected files)
140 140 export dump the header and diffs for one or more changesets
141 141 forget forget the specified files on the next commit
142 142 grep search for a pattern in specified files and revisions
143 143 heads show current repository heads or show branch heads
144 144 help show help for a given topic or a help overview
145 145 identify identify the working copy or specified revision
146 146 import import an ordered set of patches
147 147 incoming show new changesets found in source
148 148 init create a new repository in the given directory
149 149 locate locate files matching specific patterns
150 150 log show revision history of entire repository or files
151 151 manifest output the current or given revision of the project manifest
152 152 merge merge working directory with another revision
153 153 outgoing show changesets not found in the destination
154 154 parents show the parents of the working directory or revision
155 155 paths show aliases for remote repositories
156 156 pull pull changes from the specified source
157 157 push push changes to the specified destination
158 158 recover roll back an interrupted transaction
159 159 remove remove the specified files on the next commit
160 160 rename rename files; equivalent of copy + remove
161 161 resolve redo merges or set/view the merge status of files
162 162 revert restore individual files or directories to an earlier state
163 163 rollback roll back the last transaction (dangerous)
164 164 root print the root (top) of the current working directory
165 165 serve start stand-alone webserver
166 166 showconfig show combined config settings from all hgrc files
167 167 status show changed files in the working directory
168 168 summary summarize working directory state
169 169 tag add one or more tags for the current or given revision
170 170 tags list repository tags
171 171 tip show the tip revision
172 172 unbundle apply one or more changegroup files
173 173 update update working directory (or switch revisions)
174 174 verify verify the integrity of the repository
175 175 version output version and copyright information
176 176
177 177 additional help topics:
178 178
179 179 config Configuration Files
180 180 dates Date Formats
181 patterns File Name Patterns
181 diffs Diff Formats
182 182 environment Environment Variables
183 revisions Specifying Single Revisions
183 extensions Using additional features
184 glossary Glossary
185 hgweb Configuring hgweb
186 merge-tools Merge Tools
184 187 multirevs Specifying Multiple Revisions
188 patterns File Name Patterns
189 revisions Specifying Single Revisions
185 190 revsets Specifying Revision Sets
186 diffs Diff Formats
187 merge-tools Merge Tools
191 subrepos Subrepositories
188 192 templating Template Usage
189 193 urls URL Paths
190 extensions Using additional features
191 subrepos Subrepositories
192 hgweb Configuring hgweb
193 glossary Glossary
194 194
195 195 Test short command list with verbose option
196 196
197 197 $ hg -v help shortlist
198 198 Mercurial Distributed SCM (version *) (glob)
199 199 (see http://mercurial.selenic.com for more information)
200 200
201 201 Copyright (C) 2005-2011 Matt Mackall and others
202 202 This is free software; see the source for copying conditions. There is NO
203 203 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
204 204
205 205 basic commands:
206 206
207 207 add:
208 208 add the specified files on the next commit
209 209 annotate, blame:
210 210 show changeset information by line for each file
211 211 clone:
212 212 make a copy of an existing repository
213 213 commit, ci:
214 214 commit the specified files or all outstanding changes
215 215 diff:
216 216 diff repository (or selected files)
217 217 export:
218 218 dump the header and diffs for one or more changesets
219 219 forget:
220 220 forget the specified files on the next commit
221 221 init:
222 222 create a new repository in the given directory
223 223 log, history:
224 224 show revision history of entire repository or files
225 225 merge:
226 226 merge working directory with another revision
227 227 pull:
228 228 pull changes from the specified source
229 229 push:
230 230 push changes to the specified destination
231 231 remove, rm:
232 232 remove the specified files on the next commit
233 233 serve:
234 234 start stand-alone webserver
235 235 status, st:
236 236 show changed files in the working directory
237 237 summary, sum:
238 238 summarize working directory state
239 239 update, up, checkout, co:
240 240 update working directory (or switch revisions)
241 241
242 242 global options:
243 243 -R --repository REPO repository root directory or name of overlay bundle
244 244 file
245 245 --cwd DIR change working directory
246 246 -y --noninteractive do not prompt, assume 'yes' for any required answers
247 247 -q --quiet suppress output
248 248 -v --verbose enable additional output
249 249 --config CONFIG [+] set/override config option (use 'section.name=value')
250 250 --debug enable debugging output
251 251 --debugger start debugger
252 252 --encoding ENCODE set the charset encoding (default: ascii)
253 253 --encodingmode MODE set the charset encoding mode (default: strict)
254 254 --traceback always print a traceback on exception
255 255 --time time how long the command takes
256 256 --profile print command execution profile
257 257 --version output version information and exit
258 258 -h --help display help and exit
259 259
260 260 [+] marked option can be specified multiple times
261 261
262 262 use "hg help" for the full list of commands
263 263
264 264 $ hg add -h
265 265 hg add [OPTION]... [FILE]...
266 266
267 267 add the specified files on the next commit
268 268
269 269 Schedule files to be version controlled and added to the repository.
270 270
271 271 The files will be added to the repository at the next commit. To undo an
272 272 add before that, see "hg forget".
273 273
274 274 If no names are given, add all files to the repository.
275 275
276 276 Returns 0 if all files are successfully added.
277 277
278 278 use "hg -v help add" to show verbose help
279 279
280 280 options:
281 281
282 282 -I --include PATTERN [+] include names matching the given patterns
283 283 -X --exclude PATTERN [+] exclude names matching the given patterns
284 284 -S --subrepos recurse into subrepositories
285 285 -n --dry-run do not perform actions, just print output
286 286
287 287 [+] marked option can be specified multiple times
288 288
289 289 use "hg -v help add" to show global options
290 290
291 291 Verbose help for add
292 292
293 293 $ hg add -hv
294 294 hg add [OPTION]... [FILE]...
295 295
296 296 add the specified files on the next commit
297 297
298 298 Schedule files to be version controlled and added to the repository.
299 299
300 300 The files will be added to the repository at the next commit. To undo an
301 301 add before that, see "hg forget".
302 302
303 303 If no names are given, add all files to the repository.
304 304
305 305 An example showing how new (unknown) files are added automatically by "hg
306 306 add":
307 307
308 308 $ ls
309 309 foo.c
310 310 $ hg status
311 311 ? foo.c
312 312 $ hg add
313 313 adding foo.c
314 314 $ hg status
315 315 A foo.c
316 316
317 317 Returns 0 if all files are successfully added.
318 318
319 319 options:
320 320
321 321 -I --include PATTERN [+] include names matching the given patterns
322 322 -X --exclude PATTERN [+] exclude names matching the given patterns
323 323 -S --subrepos recurse into subrepositories
324 324 -n --dry-run do not perform actions, just print output
325 325
326 326 global options:
327 327 -R --repository REPO repository root directory or name of overlay bundle
328 328 file
329 329 --cwd DIR change working directory
330 330 -y --noninteractive do not prompt, assume 'yes' for any required
331 331 answers
332 332 -q --quiet suppress output
333 333 -v --verbose enable additional output
334 334 --config CONFIG [+] set/override config option (use
335 335 'section.name=value')
336 336 --debug enable debugging output
337 337 --debugger start debugger
338 338 --encoding ENCODE set the charset encoding (default: ascii)
339 339 --encodingmode MODE set the charset encoding mode (default: strict)
340 340 --traceback always print a traceback on exception
341 341 --time time how long the command takes
342 342 --profile print command execution profile
343 343 --version output version information and exit
344 344 -h --help display help and exit
345 345
346 346 [+] marked option can be specified multiple times
347 347
348 348 Test help option with version option
349 349
350 350 $ hg add -h --version
351 351 Mercurial Distributed SCM (version *) (glob)
352 352 (see http://mercurial.selenic.com for more information)
353 353
354 354 Copyright (C) 2005-2011 Matt Mackall and others
355 355 This is free software; see the source for copying conditions. There is NO
356 356 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
357 357
358 358 hg add [OPTION]... [FILE]...
359 359
360 360 add the specified files on the next commit
361 361
362 362 Schedule files to be version controlled and added to the repository.
363 363
364 364 The files will be added to the repository at the next commit. To undo an
365 365 add before that, see "hg forget".
366 366
367 367 If no names are given, add all files to the repository.
368 368
369 369 Returns 0 if all files are successfully added.
370 370
371 371 use "hg -v help add" to show verbose help
372 372
373 373 options:
374 374
375 375 -I --include PATTERN [+] include names matching the given patterns
376 376 -X --exclude PATTERN [+] exclude names matching the given patterns
377 377 -S --subrepos recurse into subrepositories
378 378 -n --dry-run do not perform actions, just print output
379 379
380 380 [+] marked option can be specified multiple times
381 381
382 382 use "hg -v help add" to show global options
383 383
384 384 $ hg add --skjdfks
385 385 hg add: option --skjdfks not recognized
386 386 hg add [OPTION]... [FILE]...
387 387
388 388 add the specified files on the next commit
389 389
390 390 Schedule files to be version controlled and added to the repository.
391 391
392 392 The files will be added to the repository at the next commit. To undo an
393 393 add before that, see "hg forget".
394 394
395 395 If no names are given, add all files to the repository.
396 396
397 397 Returns 0 if all files are successfully added.
398 398
399 399 use "hg -v help add" to show verbose help
400 400
401 401 options:
402 402
403 403 -I --include PATTERN [+] include names matching the given patterns
404 404 -X --exclude PATTERN [+] exclude names matching the given patterns
405 405 -S --subrepos recurse into subrepositories
406 406 -n --dry-run do not perform actions, just print output
407 407
408 408 [+] marked option can be specified multiple times
409 409
410 410 use "hg -v help add" to show global options
411 411 [255]
412 412
413 413 Test ambiguous command help
414 414
415 415 $ hg help ad
416 416 list of commands:
417 417
418 418 add add the specified files on the next commit
419 419 addremove add all new files, delete all missing files
420 420
421 421 use "hg -v help ad" to show builtin aliases and global options
422 422
423 423 Test command without options
424 424
425 425 $ hg help verify
426 426 hg verify
427 427
428 428 verify the integrity of the repository
429 429
430 430 Verify the integrity of the current repository.
431 431
432 432 This will perform an extensive check of the repository's integrity,
433 433 validating the hashes and checksums of each entry in the changelog,
434 434 manifest, and tracked files, as well as the integrity of their crosslinks
435 435 and indices.
436 436
437 437 Returns 0 on success, 1 if errors are encountered.
438 438
439 439 use "hg -v help verify" to show global options
440 440
441 441 $ hg help diff
442 442 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
443 443
444 444 diff repository (or selected files)
445 445
446 446 Show differences between revisions for the specified files.
447 447
448 448 Differences between files are shown using the unified diff format.
449 449
450 450 Note:
451 451 diff may generate unexpected results for merges, as it will default to
452 452 comparing against the working directory's first parent changeset if no
453 453 revisions are specified.
454 454
455 455 When two revision arguments are given, then changes are shown between
456 456 those revisions. If only one revision is specified then that revision is
457 457 compared to the working directory, and, when no revisions are specified,
458 458 the working directory files are compared to its parent.
459 459
460 460 Alternatively you can specify -c/--change with a revision to see the
461 461 changes in that changeset relative to its first parent.
462 462
463 463 Without the -a/--text option, diff will avoid generating diffs of files it
464 464 detects as binary. With -a, diff will generate a diff anyway, probably
465 465 with undesirable results.
466 466
467 467 Use the -g/--git option to generate diffs in the git extended diff format.
468 468 For more information, read "hg help diffs".
469 469
470 470 Returns 0 on success.
471 471
472 472 options:
473 473
474 474 -r --rev REV [+] revision
475 475 -c --change REV change made by revision
476 476 -a --text treat all files as text
477 477 -g --git use git extended diff format
478 478 --nodates omit dates from diff headers
479 479 -p --show-function show which function each change is in
480 480 --reverse produce a diff that undoes the changes
481 481 -w --ignore-all-space ignore white space when comparing lines
482 482 -b --ignore-space-change ignore changes in the amount of white space
483 483 -B --ignore-blank-lines ignore changes whose lines are all blank
484 484 -U --unified NUM number of lines of context to show
485 485 --stat output diffstat-style summary of changes
486 486 -I --include PATTERN [+] include names matching the given patterns
487 487 -X --exclude PATTERN [+] exclude names matching the given patterns
488 488 -S --subrepos recurse into subrepositories
489 489
490 490 [+] marked option can be specified multiple times
491 491
492 492 use "hg -v help diff" to show global options
493 493
494 494 $ hg help status
495 495 hg status [OPTION]... [FILE]...
496 496
497 497 aliases: st
498 498
499 499 show changed files in the working directory
500 500
501 501 Show status of files in the repository. If names are given, only files
502 502 that match are shown. Files that are clean or ignored or the source of a
503 503 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
504 504 -C/--copies or -A/--all are given. Unless options described with "show
505 505 only ..." are given, the options -mardu are used.
506 506
507 507 Option -q/--quiet hides untracked (unknown and ignored) files unless
508 508 explicitly requested with -u/--unknown or -i/--ignored.
509 509
510 510 Note:
511 511 status may appear to disagree with diff if permissions have changed or
512 512 a merge has occurred. The standard diff format does not report
513 513 permission changes and diff only reports changes relative to one merge
514 514 parent.
515 515
516 516 If one revision is given, it is used as the base revision. If two
517 517 revisions are given, the differences between them are shown. The --change
518 518 option can also be used as a shortcut to list the changed files of a
519 519 revision from its first parent.
520 520
521 521 The codes used to show the status of files are:
522 522
523 523 M = modified
524 524 A = added
525 525 R = removed
526 526 C = clean
527 527 ! = missing (deleted by non-hg command, but still tracked)
528 528 ? = not tracked
529 529 I = ignored
530 530 = origin of the previous file listed as A (added)
531 531
532 532 Returns 0 on success.
533 533
534 534 options:
535 535
536 536 -A --all show status of all files
537 537 -m --modified show only modified files
538 538 -a --added show only added files
539 539 -r --removed show only removed files
540 540 -d --deleted show only deleted (but tracked) files
541 541 -c --clean show only files without changes
542 542 -u --unknown show only unknown (not tracked) files
543 543 -i --ignored show only ignored files
544 544 -n --no-status hide status prefix
545 545 -C --copies show source of copied files
546 546 -0 --print0 end filenames with NUL, for use with xargs
547 547 --rev REV [+] show difference from revision
548 548 --change REV list the changed files of a revision
549 549 -I --include PATTERN [+] include names matching the given patterns
550 550 -X --exclude PATTERN [+] exclude names matching the given patterns
551 551 -S --subrepos recurse into subrepositories
552 552
553 553 [+] marked option can be specified multiple times
554 554
555 555 use "hg -v help status" to show global options
556 556
557 557 $ hg -q help status
558 558 hg status [OPTION]... [FILE]...
559 559
560 560 show changed files in the working directory
561 561
562 562 $ hg help foo
563 563 hg: unknown command 'foo'
564 564 Mercurial Distributed SCM
565 565
566 566 basic commands:
567 567
568 568 add add the specified files on the next commit
569 569 annotate show changeset information by line for each file
570 570 clone make a copy of an existing repository
571 571 commit commit the specified files or all outstanding changes
572 572 diff diff repository (or selected files)
573 573 export dump the header and diffs for one or more changesets
574 574 forget forget the specified files on the next commit
575 575 init create a new repository in the given directory
576 576 log show revision history of entire repository or files
577 577 merge merge working directory with another revision
578 578 pull pull changes from the specified source
579 579 push push changes to the specified destination
580 580 remove remove the specified files on the next commit
581 581 serve start stand-alone webserver
582 582 status show changed files in the working directory
583 583 summary summarize working directory state
584 584 update update working directory (or switch revisions)
585 585
586 586 use "hg help" for the full list of commands or "hg -v" for details
587 587 [255]
588 588
589 589 $ hg skjdfks
590 590 hg: unknown command 'skjdfks'
591 591 Mercurial Distributed SCM
592 592
593 593 basic commands:
594 594
595 595 add add the specified files on the next commit
596 596 annotate show changeset information by line for each file
597 597 clone make a copy of an existing repository
598 598 commit commit the specified files or all outstanding changes
599 599 diff diff repository (or selected files)
600 600 export dump the header and diffs for one or more changesets
601 601 forget forget the specified files on the next commit
602 602 init create a new repository in the given directory
603 603 log show revision history of entire repository or files
604 604 merge merge working directory with another revision
605 605 pull pull changes from the specified source
606 606 push push changes to the specified destination
607 607 remove remove the specified files on the next commit
608 608 serve start stand-alone webserver
609 609 status show changed files in the working directory
610 610 summary summarize working directory state
611 611 update update working directory (or switch revisions)
612 612
613 613 use "hg help" for the full list of commands or "hg -v" for details
614 614 [255]
615 615
616 616 $ cat > helpext.py <<EOF
617 617 > import os
618 618 > from mercurial import commands
619 619 >
620 620 > def nohelp(ui, *args, **kwargs):
621 621 > pass
622 622 >
623 623 > cmdtable = {
624 624 > "nohelp": (nohelp, [], "hg nohelp"),
625 625 > }
626 626 >
627 627 > commands.norepo += ' nohelp'
628 628 > EOF
629 629 $ echo '[extensions]' >> $HGRCPATH
630 630 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
631 631
632 632 Test command with no help text
633 633
634 634 $ hg help nohelp
635 635 hg nohelp
636 636
637 637 (no help text available)
638 638
639 639 use "hg -v help nohelp" to show global options
640 640
641 641 Test that default list of commands omits extension commands
642 642
643 643 $ hg help
644 644 Mercurial Distributed SCM
645 645
646 646 list of commands:
647 647
648 648 add add the specified files on the next commit
649 649 addremove add all new files, delete all missing files
650 650 annotate show changeset information by line for each file
651 651 archive create an unversioned archive of a repository revision
652 652 backout reverse effect of earlier changeset
653 653 bisect subdivision search of changesets
654 654 bookmarks track a line of development with movable markers
655 655 branch set or show the current branch name
656 656 branches list repository named branches
657 657 bundle create a changegroup file
658 658 cat output the current or given revision of files
659 659 clone make a copy of an existing repository
660 660 commit commit the specified files or all outstanding changes
661 661 copy mark files as copied for the next commit
662 662 diff diff repository (or selected files)
663 663 export dump the header and diffs for one or more changesets
664 664 forget forget the specified files on the next commit
665 665 grep search for a pattern in specified files and revisions
666 666 heads show current repository heads or show branch heads
667 667 help show help for a given topic or a help overview
668 668 identify identify the working copy or specified revision
669 669 import import an ordered set of patches
670 670 incoming show new changesets found in source
671 671 init create a new repository in the given directory
672 672 locate locate files matching specific patterns
673 673 log show revision history of entire repository or files
674 674 manifest output the current or given revision of the project manifest
675 675 merge merge working directory with another revision
676 676 outgoing show changesets not found in the destination
677 677 parents show the parents of the working directory or revision
678 678 paths show aliases for remote repositories
679 679 pull pull changes from the specified source
680 680 push push changes to the specified destination
681 681 recover roll back an interrupted transaction
682 682 remove remove the specified files on the next commit
683 683 rename rename files; equivalent of copy + remove
684 684 resolve redo merges or set/view the merge status of files
685 685 revert restore individual files or directories to an earlier state
686 686 rollback roll back the last transaction (dangerous)
687 687 root print the root (top) of the current working directory
688 688 serve start stand-alone webserver
689 689 showconfig show combined config settings from all hgrc files
690 690 status show changed files in the working directory
691 691 summary summarize working directory state
692 692 tag add one or more tags for the current or given revision
693 693 tags list repository tags
694 694 tip show the tip revision
695 695 unbundle apply one or more changegroup files
696 696 update update working directory (or switch revisions)
697 697 verify verify the integrity of the repository
698 698 version output version and copyright information
699 699
700 700 enabled extensions:
701 701
702 702 helpext (no help text available)
703 703
704 704 additional help topics:
705 705
706 706 config Configuration Files
707 707 dates Date Formats
708 patterns File Name Patterns
708 diffs Diff Formats
709 709 environment Environment Variables
710 revisions Specifying Single Revisions
710 extensions Using additional features
711 glossary Glossary
712 hgweb Configuring hgweb
713 merge-tools Merge Tools
711 714 multirevs Specifying Multiple Revisions
715 patterns File Name Patterns
716 revisions Specifying Single Revisions
712 717 revsets Specifying Revision Sets
713 diffs Diff Formats
714 merge-tools Merge Tools
718 subrepos Subrepositories
715 719 templating Template Usage
716 720 urls URL Paths
717 extensions Using additional features
718 subrepos Subrepositories
719 hgweb Configuring hgweb
720 glossary Glossary
721 721
722 722 use "hg -v help" to show builtin aliases and global options
723 723
724
725
724 726 Test list of commands with command with no help text
725 727
726 728 $ hg help helpext
727 729 helpext extension - no help text available
728 730
729 731 list of commands:
730 732
731 733 nohelp (no help text available)
732 734
733 735 use "hg -v help helpext" to show builtin aliases and global options
734 736
735 737 Test a help topic
736 738
737 739 $ hg help revs
738 740 Specifying Single Revisions
739 741
740 742 Mercurial supports several ways to specify individual revisions.
741 743
742 744 A plain integer is treated as a revision number. Negative integers are
743 745 treated as sequential offsets from the tip, with -1 denoting the tip, -2
744 746 denoting the revision prior to the tip, and so forth.
745 747
746 748 A 40-digit hexadecimal string is treated as a unique revision identifier.
747 749
748 750 A hexadecimal string less than 40 characters long is treated as a unique
749 751 revision identifier and is referred to as a short-form identifier. A
750 752 short-form identifier is only valid if it is the prefix of exactly one
751 753 full-length identifier.
752 754
753 755 Any other string is treated as a tag or branch name. A tag name is a
754 756 symbolic name associated with a revision identifier. A branch name denotes
755 757 the tipmost revision of that branch. Tag and branch names must not contain
756 758 the ":" character.
757 759
758 760 The reserved name "tip" is a special tag that always identifies the most
759 761 recent revision.
760 762
761 763 The reserved name "null" indicates the null revision. This is the revision
762 764 of an empty repository, and the parent of revision 0.
763 765
764 766 The reserved name "." indicates the working directory parent. If no
765 767 working directory is checked out, it is equivalent to null. If an
766 768 uncommitted merge is in progress, "." is the revision of the first parent.
767 769
768 770 Test templating help
769 771
770 772 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
771 773 desc String. The text of the changeset description.
772 774 diffstat String. Statistics of changes with the following format:
773 775 firstline Any text. Returns the first line of text.
774 776 nonempty Any text. Returns '(none)' if the string is empty.
775 777
776 778 Test help hooks
777 779
778 780 $ cat > helphook1.py <<EOF
779 781 > from mercurial import help
780 782 >
781 783 > def rewrite(topic, doc):
782 784 > return doc + '\nhelphook1\n'
783 785 >
784 786 > def extsetup(ui):
785 787 > help.addtopichook('revsets', rewrite)
786 788 > EOF
787 789 $ cat > helphook2.py <<EOF
788 790 > from mercurial import help
789 791 >
790 792 > def rewrite(topic, doc):
791 793 > return doc + '\nhelphook2\n'
792 794 >
793 795 > def extsetup(ui):
794 796 > help.addtopichook('revsets', rewrite)
795 797 > EOF
796 798 $ echo '[extensions]' >> $HGRCPATH
797 799 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
798 800 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
799 801 $ hg help revsets | grep helphook
800 802 helphook1
801 803 helphook2
General Comments 0
You need to be logged in to leave comments. Login now