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