##// END OF EJS Templates
remotenames: introduce class to encapsulate remotenames info in an extension...
Pulkit Goyal -
r36077:cabe8ef5 default
parent child Browse files
Show More
@@ -0,0 +1,77 b''
1 # remotenames.py - extension to display remotenames
2 #
3 # Copyright 2017 Augie Fackler <raf@durin42.com>
4 # Copyright 2017 Sean Farley <sean@farley.io>
5 #
6 # This software may be used and distributed according to the terms of the
7 # GNU General Public License version 2 or any later version.
8
9 """ showing remotebookmarks and remotebranches in UI """
10
11 from __future__ import absolute_import
12
13 from mercurial import (
14 logexchange,
15 )
16
17 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
18 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
19 # be specifying the version(s) of Mercurial they are tested with, or
20 # leave the attribute unspecified.
21 testedwith = 'ships-with-hg-core'
22
23 class remotenames(dict):
24 """
25 This class encapsulates all the remotenames state. It also contains
26 methods to access that state in convenient ways.
27 """
28
29 def __init__(self, repo, *args):
30 dict.__init__(self, *args)
31 self._repo = repo
32 self['bookmarks'] = {}
33 self['branches'] = {}
34 self.loadnames()
35 self._loadednames = True
36
37 def loadnames(self):
38 """ loads the remotenames information from the remotenames file """
39 for rtype in ('bookmarks', 'branches'):
40 for node, rpath, name in logexchange.readremotenamefile(self._repo,
41 rtype):
42 rname = rpath + '/' + name
43 self[rtype][rname] = [node]
44
45 def clearnames(self):
46 """ Clear all remote names state """
47 self['bookmarks'] = {}
48 self['branches'] = {}
49 self._invalidatecache()
50 self._loadednames = False
51
52 def _invalidatecache(self):
53 self._nodetobmarks = None
54 self._nodetobranch = None
55
56 def bmarktonodes(self):
57 return self['bookmarks']
58
59 def nodetobmarks(self):
60 if not self._nodetobmarks:
61 bmarktonodes = self.bmarktonodes()
62 self._nodetobmarks = {}
63 for name, node in bmarktonodes.iteritems():
64 self._nodetobmarks.setdefault(node[0], []).append(name)
65 return self._nodetobmarks
66
67 def branchtonodes(self):
68 return self['branches']
69
70 def nodetobranch(self):
71 if not self._nodetobranch:
72 branchtonodes = self.branchtonodes()
73 self._nodetobranch = {}
74 for name, nodes in branchtonodes.iteritems():
75 for node in nodes:
76 self._nodetobranch.setdefault(node, []).append(name)
77 return self._nodetobranch
@@ -1,3393 +1,3394 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 another revision into working directory
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 another revision into working directory
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 create a new bookmark or list existing bookmarks
59 59 branch set or show the current branch name
60 60 branches list repository named branches
61 61 bundle create a bundle 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 config show combined config settings from all hgrc files
66 66 copy mark files as copied for the next commit
67 67 diff diff repository (or selected files)
68 68 export dump the header and diffs for one or more changesets
69 69 files list tracked files
70 70 forget forget the specified files on the next commit
71 71 graft copy changes from other branches onto the current branch
72 72 grep search revision history for a pattern in specified files
73 73 heads show branch heads
74 74 help show help for a given topic or a help overview
75 75 identify identify the working directory or specified revision
76 76 import import an ordered set of patches
77 77 incoming show new changesets found in source
78 78 init create a new repository in the given directory
79 79 log show revision history of entire repository or files
80 80 manifest output the current or given revision of the project manifest
81 81 merge merge another revision into working directory
82 82 outgoing show changesets not found in the destination
83 83 paths show aliases for remote repositories
84 84 phase set or show the current phase name
85 85 pull pull changes from the specified source
86 86 push push changes to the specified destination
87 87 recover roll back an interrupted transaction
88 88 remove remove the specified files on the next commit
89 89 rename rename files; equivalent of copy + remove
90 90 resolve redo merges or set/view the merge status of files
91 91 revert restore files to their checkout state
92 92 root print the root (top) of the current working directory
93 93 serve start stand-alone webserver
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 unbundle apply one or more bundle 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 bundlespec Bundle File Formats
106 106 color Colorizing Outputs
107 107 config Configuration Files
108 108 dates Date Formats
109 109 diffs Diff Formats
110 110 environment Environment Variables
111 111 extensions Using Additional Features
112 112 filesets Specifying File Sets
113 113 flags Command-line flags
114 114 glossary Glossary
115 115 hgignore Syntax for Mercurial Ignore Files
116 116 hgweb Configuring hgweb
117 117 internals Technical implementation topics
118 118 merge-tools Merge Tools
119 119 pager Pager Support
120 120 patterns File Name Patterns
121 121 phases Working with Phases
122 122 revisions Specifying Revisions
123 123 scripting Using Mercurial from scripts and automation
124 124 subrepos Subrepositories
125 125 templating Template Usage
126 126 urls URL Paths
127 127
128 128 (use 'hg help -v' to show built-in aliases and global options)
129 129
130 130 $ hg -q help
131 131 add add the specified files on the next commit
132 132 addremove add all new files, delete all missing files
133 133 annotate show changeset information by line for each file
134 134 archive create an unversioned archive of a repository revision
135 135 backout reverse effect of earlier changeset
136 136 bisect subdivision search of changesets
137 137 bookmarks create a new bookmark or list existing bookmarks
138 138 branch set or show the current branch name
139 139 branches list repository named branches
140 140 bundle create a bundle file
141 141 cat output the current or given revision of files
142 142 clone make a copy of an existing repository
143 143 commit commit the specified files or all outstanding changes
144 144 config show combined config settings from all hgrc files
145 145 copy mark files as copied for the next commit
146 146 diff diff repository (or selected files)
147 147 export dump the header and diffs for one or more changesets
148 148 files list tracked files
149 149 forget forget the specified files on the next commit
150 150 graft copy changes from other branches onto the current branch
151 151 grep search revision history for a pattern in specified files
152 152 heads show branch heads
153 153 help show help for a given topic or a help overview
154 154 identify identify the working directory or specified revision
155 155 import import an ordered set of patches
156 156 incoming show new changesets found in source
157 157 init create a new repository in the given directory
158 158 log show revision history of entire repository or files
159 159 manifest output the current or given revision of the project manifest
160 160 merge merge another revision into working directory
161 161 outgoing show changesets not found in the destination
162 162 paths show aliases for remote repositories
163 163 phase set or show the current phase name
164 164 pull pull changes from the specified source
165 165 push push changes to the specified destination
166 166 recover roll back an interrupted transaction
167 167 remove remove the specified files on the next commit
168 168 rename rename files; equivalent of copy + remove
169 169 resolve redo merges or set/view the merge status of files
170 170 revert restore files to their checkout state
171 171 root print the root (top) of the current working directory
172 172 serve start stand-alone webserver
173 173 status show changed files in the working directory
174 174 summary summarize working directory state
175 175 tag add one or more tags for the current or given revision
176 176 tags list repository tags
177 177 unbundle apply one or more bundle files
178 178 update update working directory (or switch revisions)
179 179 verify verify the integrity of the repository
180 180 version output version and copyright information
181 181
182 182 additional help topics:
183 183
184 184 bundlespec Bundle File Formats
185 185 color Colorizing Outputs
186 186 config Configuration Files
187 187 dates Date Formats
188 188 diffs Diff Formats
189 189 environment Environment Variables
190 190 extensions Using Additional Features
191 191 filesets Specifying File Sets
192 192 flags Command-line flags
193 193 glossary Glossary
194 194 hgignore Syntax for Mercurial Ignore Files
195 195 hgweb Configuring hgweb
196 196 internals Technical implementation topics
197 197 merge-tools Merge Tools
198 198 pager Pager Support
199 199 patterns File Name Patterns
200 200 phases Working with Phases
201 201 revisions Specifying Revisions
202 202 scripting Using Mercurial from scripts and automation
203 203 subrepos Subrepositories
204 204 templating Template Usage
205 205 urls URL Paths
206 206
207 207 Test extension help:
208 208 $ hg help extensions --config extensions.rebase= --config extensions.children=
209 209 Using Additional Features
210 210 """""""""""""""""""""""""
211 211
212 212 Mercurial has the ability to add new features through the use of
213 213 extensions. Extensions may add new commands, add options to existing
214 214 commands, change the default behavior of commands, or implement hooks.
215 215
216 216 To enable the "foo" extension, either shipped with Mercurial or in the
217 217 Python search path, create an entry for it in your configuration file,
218 218 like this:
219 219
220 220 [extensions]
221 221 foo =
222 222
223 223 You may also specify the full path to an extension:
224 224
225 225 [extensions]
226 226 myfeature = ~/.hgext/myfeature.py
227 227
228 228 See 'hg help config' for more information on configuration files.
229 229
230 230 Extensions are not loaded by default for a variety of reasons: they can
231 231 increase startup overhead; they may be meant for advanced usage only; they
232 232 may provide potentially dangerous abilities (such as letting you destroy
233 233 or modify history); they might not be ready for prime time; or they may
234 234 alter some usual behaviors of stock Mercurial. It is thus up to the user
235 235 to activate extensions as needed.
236 236
237 237 To explicitly disable an extension enabled in a configuration file of
238 238 broader scope, prepend its path with !:
239 239
240 240 [extensions]
241 241 # disabling extension bar residing in /path/to/extension/bar.py
242 242 bar = !/path/to/extension/bar.py
243 243 # ditto, but no path was supplied for extension baz
244 244 baz = !
245 245
246 246 enabled extensions:
247 247
248 248 children command to display child changesets (DEPRECATED)
249 249 rebase command to move sets of revisions to a different ancestor
250 250
251 251 disabled extensions:
252 252
253 253 acl hooks for controlling repository access
254 254 blackbox log repository events to a blackbox for debugging
255 255 bugzilla hooks for integrating with the Bugzilla bug tracker
256 256 censor erase file content at a given revision
257 257 churn command to display statistics about repository history
258 258 clonebundles advertise pre-generated bundles to seed clones
259 259 convert import revisions from foreign VCS repositories into
260 260 Mercurial
261 261 eol automatically manage newlines in repository files
262 262 extdiff command to allow external programs to compare revisions
263 263 factotum http authentication with factotum
264 264 githelp try mapping git commands to Mercurial commands
265 265 gpg commands to sign and verify changesets
266 266 hgk browse the repository in a graphical way
267 267 highlight syntax highlighting for hgweb (requires Pygments)
268 268 histedit interactive history editing
269 269 keyword expand keywords in tracked files
270 270 largefiles track large binary files
271 271 mq manage a stack of patches
272 272 notify hooks for sending email push notifications
273 273 patchbomb command to send changesets as (a series of) patch emails
274 274 purge command to delete untracked files from the working
275 275 directory
276 276 relink recreates hardlinks between repository clones
277 remotenames showing remotebookmarks and remotebranches in UI
277 278 schemes extend schemes with shortcuts to repository swarms
278 279 share share a common history between several working directories
279 280 shelve save and restore changes to the working directory
280 281 strip strip changesets and their descendants from history
281 282 transplant command to transplant changesets from another branch
282 283 win32mbcs allow the use of MBCS paths with problematic encodings
283 284 zeroconf discover and advertise repositories on the local network
284 285
285 286 Verify that extension keywords appear in help templates
286 287
287 288 $ hg help --config extensions.transplant= templating|grep transplant > /dev/null
288 289
289 290 Test short command list with verbose option
290 291
291 292 $ hg -v help shortlist
292 293 Mercurial Distributed SCM
293 294
294 295 basic commands:
295 296
296 297 add add the specified files on the next commit
297 298 annotate, blame
298 299 show changeset information by line for each file
299 300 clone make a copy of an existing repository
300 301 commit, ci commit the specified files or all outstanding changes
301 302 diff diff repository (or selected files)
302 303 export dump the header and diffs for one or more changesets
303 304 forget forget the specified files on the next commit
304 305 init create a new repository in the given directory
305 306 log, history show revision history of entire repository or files
306 307 merge merge another revision into working directory
307 308 pull pull changes from the specified source
308 309 push push changes to the specified destination
309 310 remove, rm remove the specified files on the next commit
310 311 serve start stand-alone webserver
311 312 status, st show changed files in the working directory
312 313 summary, sum summarize working directory state
313 314 update, up, checkout, co
314 315 update working directory (or switch revisions)
315 316
316 317 global options ([+] can be repeated):
317 318
318 319 -R --repository REPO repository root directory or name of overlay bundle
319 320 file
320 321 --cwd DIR change working directory
321 322 -y --noninteractive do not prompt, automatically pick the first choice for
322 323 all prompts
323 324 -q --quiet suppress output
324 325 -v --verbose enable additional output
325 326 --color TYPE when to colorize (boolean, always, auto, never, or
326 327 debug)
327 328 --config CONFIG [+] set/override config option (use 'section.name=value')
328 329 --debug enable debugging output
329 330 --debugger start debugger
330 331 --encoding ENCODE set the charset encoding (default: ascii)
331 332 --encodingmode MODE set the charset encoding mode (default: strict)
332 333 --traceback always print a traceback on exception
333 334 --time time how long the command takes
334 335 --profile print command execution profile
335 336 --version output version information and exit
336 337 -h --help display help and exit
337 338 --hidden consider hidden changesets
338 339 --pager TYPE when to paginate (boolean, always, auto, or never)
339 340 (default: auto)
340 341
341 342 (use 'hg help' for the full list of commands)
342 343
343 344 $ hg add -h
344 345 hg add [OPTION]... [FILE]...
345 346
346 347 add the specified files on the next commit
347 348
348 349 Schedule files to be version controlled and added to the repository.
349 350
350 351 The files will be added to the repository at the next commit. To undo an
351 352 add before that, see 'hg forget'.
352 353
353 354 If no names are given, add all files to the repository (except files
354 355 matching ".hgignore").
355 356
356 357 Returns 0 if all files are successfully added.
357 358
358 359 options ([+] can be repeated):
359 360
360 361 -I --include PATTERN [+] include names matching the given patterns
361 362 -X --exclude PATTERN [+] exclude names matching the given patterns
362 363 -S --subrepos recurse into subrepositories
363 364 -n --dry-run do not perform actions, just print output
364 365
365 366 (some details hidden, use --verbose to show complete help)
366 367
367 368 Verbose help for add
368 369
369 370 $ hg add -hv
370 371 hg add [OPTION]... [FILE]...
371 372
372 373 add the specified files on the next commit
373 374
374 375 Schedule files to be version controlled and added to the repository.
375 376
376 377 The files will be added to the repository at the next commit. To undo an
377 378 add before that, see 'hg forget'.
378 379
379 380 If no names are given, add all files to the repository (except files
380 381 matching ".hgignore").
381 382
382 383 Examples:
383 384
384 385 - New (unknown) files are added automatically by 'hg add':
385 386
386 387 $ ls
387 388 foo.c
388 389 $ hg status
389 390 ? foo.c
390 391 $ hg add
391 392 adding foo.c
392 393 $ hg status
393 394 A foo.c
394 395
395 396 - Specific files to be added can be specified:
396 397
397 398 $ ls
398 399 bar.c foo.c
399 400 $ hg status
400 401 ? bar.c
401 402 ? foo.c
402 403 $ hg add bar.c
403 404 $ hg status
404 405 A bar.c
405 406 ? foo.c
406 407
407 408 Returns 0 if all files are successfully added.
408 409
409 410 options ([+] can be repeated):
410 411
411 412 -I --include PATTERN [+] include names matching the given patterns
412 413 -X --exclude PATTERN [+] exclude names matching the given patterns
413 414 -S --subrepos recurse into subrepositories
414 415 -n --dry-run do not perform actions, just print output
415 416
416 417 global options ([+] can be repeated):
417 418
418 419 -R --repository REPO repository root directory or name of overlay bundle
419 420 file
420 421 --cwd DIR change working directory
421 422 -y --noninteractive do not prompt, automatically pick the first choice for
422 423 all prompts
423 424 -q --quiet suppress output
424 425 -v --verbose enable additional output
425 426 --color TYPE when to colorize (boolean, always, auto, never, or
426 427 debug)
427 428 --config CONFIG [+] set/override config option (use 'section.name=value')
428 429 --debug enable debugging output
429 430 --debugger start debugger
430 431 --encoding ENCODE set the charset encoding (default: ascii)
431 432 --encodingmode MODE set the charset encoding mode (default: strict)
432 433 --traceback always print a traceback on exception
433 434 --time time how long the command takes
434 435 --profile print command execution profile
435 436 --version output version information and exit
436 437 -h --help display help and exit
437 438 --hidden consider hidden changesets
438 439 --pager TYPE when to paginate (boolean, always, auto, or never)
439 440 (default: auto)
440 441
441 442 Test the textwidth config option
442 443
443 444 $ hg root -h --config ui.textwidth=50
444 445 hg root
445 446
446 447 print the root (top) of the current working
447 448 directory
448 449
449 450 Print the root directory of the current
450 451 repository.
451 452
452 453 Returns 0 on success.
453 454
454 455 (some details hidden, use --verbose to show
455 456 complete help)
456 457
457 458 Test help option with version option
458 459
459 460 $ hg add -h --version
460 461 Mercurial Distributed SCM (version *) (glob)
461 462 (see https://mercurial-scm.org for more information)
462 463
463 464 Copyright (C) 2005-* Matt Mackall and others (glob)
464 465 This is free software; see the source for copying conditions. There is NO
465 466 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
466 467
467 468 $ hg add --skjdfks
468 469 hg add: option --skjdfks not recognized
469 470 hg add [OPTION]... [FILE]...
470 471
471 472 add the specified files on the next commit
472 473
473 474 options ([+] can be repeated):
474 475
475 476 -I --include PATTERN [+] include names matching the given patterns
476 477 -X --exclude PATTERN [+] exclude names matching the given patterns
477 478 -S --subrepos recurse into subrepositories
478 479 -n --dry-run do not perform actions, just print output
479 480
480 481 (use 'hg add -h' to show more help)
481 482 [255]
482 483
483 484 Test ambiguous command help
484 485
485 486 $ hg help ad
486 487 list of commands:
487 488
488 489 add add the specified files on the next commit
489 490 addremove add all new files, delete all missing files
490 491
491 492 (use 'hg help -v ad' to show built-in aliases and global options)
492 493
493 494 Test command without options
494 495
495 496 $ hg help verify
496 497 hg verify
497 498
498 499 verify the integrity of the repository
499 500
500 501 Verify the integrity of the current repository.
501 502
502 503 This will perform an extensive check of the repository's integrity,
503 504 validating the hashes and checksums of each entry in the changelog,
504 505 manifest, and tracked files, as well as the integrity of their crosslinks
505 506 and indices.
506 507
507 508 Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
508 509 information about recovery from corruption of the repository.
509 510
510 511 Returns 0 on success, 1 if errors are encountered.
511 512
512 513 (some details hidden, use --verbose to show complete help)
513 514
514 515 $ hg help diff
515 516 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
516 517
517 518 diff repository (or selected files)
518 519
519 520 Show differences between revisions for the specified files.
520 521
521 522 Differences between files are shown using the unified diff format.
522 523
523 524 Note:
524 525 'hg diff' may generate unexpected results for merges, as it will
525 526 default to comparing against the working directory's first parent
526 527 changeset if no revisions are specified.
527 528
528 529 When two revision arguments are given, then changes are shown between
529 530 those revisions. If only one revision is specified then that revision is
530 531 compared to the working directory, and, when no revisions are specified,
531 532 the working directory files are compared to its first parent.
532 533
533 534 Alternatively you can specify -c/--change with a revision to see the
534 535 changes in that changeset relative to its first parent.
535 536
536 537 Without the -a/--text option, diff will avoid generating diffs of files it
537 538 detects as binary. With -a, diff will generate a diff anyway, probably
538 539 with undesirable results.
539 540
540 541 Use the -g/--git option to generate diffs in the git extended diff format.
541 542 For more information, read 'hg help diffs'.
542 543
543 544 Returns 0 on success.
544 545
545 546 options ([+] can be repeated):
546 547
547 548 -r --rev REV [+] revision
548 549 -c --change REV change made by revision
549 550 -a --text treat all files as text
550 551 -g --git use git extended diff format
551 552 --binary generate binary diffs in git mode (default)
552 553 --nodates omit dates from diff headers
553 554 --noprefix omit a/ and b/ prefixes from filenames
554 555 -p --show-function show which function each change is in
555 556 --reverse produce a diff that undoes the changes
556 557 -w --ignore-all-space ignore white space when comparing lines
557 558 -b --ignore-space-change ignore changes in the amount of white space
558 559 -B --ignore-blank-lines ignore changes whose lines are all blank
559 560 -Z --ignore-space-at-eol ignore changes in whitespace at EOL
560 561 -U --unified NUM number of lines of context to show
561 562 --stat output diffstat-style summary of changes
562 563 --root DIR produce diffs relative to subdirectory
563 564 -I --include PATTERN [+] include names matching the given patterns
564 565 -X --exclude PATTERN [+] exclude names matching the given patterns
565 566 -S --subrepos recurse into subrepositories
566 567
567 568 (some details hidden, use --verbose to show complete help)
568 569
569 570 $ hg help status
570 571 hg status [OPTION]... [FILE]...
571 572
572 573 aliases: st
573 574
574 575 show changed files in the working directory
575 576
576 577 Show status of files in the repository. If names are given, only files
577 578 that match are shown. Files that are clean or ignored or the source of a
578 579 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
579 580 -C/--copies or -A/--all are given. Unless options described with "show
580 581 only ..." are given, the options -mardu are used.
581 582
582 583 Option -q/--quiet hides untracked (unknown and ignored) files unless
583 584 explicitly requested with -u/--unknown or -i/--ignored.
584 585
585 586 Note:
586 587 'hg status' may appear to disagree with diff if permissions have
587 588 changed or a merge has occurred. The standard diff format does not
588 589 report permission changes and diff only reports changes relative to one
589 590 merge parent.
590 591
591 592 If one revision is given, it is used as the base revision. If two
592 593 revisions are given, the differences between them are shown. The --change
593 594 option can also be used as a shortcut to list the changed files of a
594 595 revision from its first parent.
595 596
596 597 The codes used to show the status of files are:
597 598
598 599 M = modified
599 600 A = added
600 601 R = removed
601 602 C = clean
602 603 ! = missing (deleted by non-hg command, but still tracked)
603 604 ? = not tracked
604 605 I = ignored
605 606 = origin of the previous file (with --copies)
606 607
607 608 Returns 0 on success.
608 609
609 610 options ([+] can be repeated):
610 611
611 612 -A --all show status of all files
612 613 -m --modified show only modified files
613 614 -a --added show only added files
614 615 -r --removed show only removed files
615 616 -d --deleted show only deleted (but tracked) files
616 617 -c --clean show only files without changes
617 618 -u --unknown show only unknown (not tracked) files
618 619 -i --ignored show only ignored files
619 620 -n --no-status hide status prefix
620 621 -C --copies show source of copied files
621 622 -0 --print0 end filenames with NUL, for use with xargs
622 623 --rev REV [+] show difference from revision
623 624 --change REV list the changed files of a revision
624 625 -I --include PATTERN [+] include names matching the given patterns
625 626 -X --exclude PATTERN [+] exclude names matching the given patterns
626 627 -S --subrepos recurse into subrepositories
627 628
628 629 (some details hidden, use --verbose to show complete help)
629 630
630 631 $ hg -q help status
631 632 hg status [OPTION]... [FILE]...
632 633
633 634 show changed files in the working directory
634 635
635 636 $ hg help foo
636 637 abort: no such help topic: foo
637 638 (try 'hg help --keyword foo')
638 639 [255]
639 640
640 641 $ hg skjdfks
641 642 hg: unknown command 'skjdfks'
642 643 Mercurial Distributed SCM
643 644
644 645 basic commands:
645 646
646 647 add add the specified files on the next commit
647 648 annotate show changeset information by line for each file
648 649 clone make a copy of an existing repository
649 650 commit commit the specified files or all outstanding changes
650 651 diff diff repository (or selected files)
651 652 export dump the header and diffs for one or more changesets
652 653 forget forget the specified files on the next commit
653 654 init create a new repository in the given directory
654 655 log show revision history of entire repository or files
655 656 merge merge another revision into working directory
656 657 pull pull changes from the specified source
657 658 push push changes to the specified destination
658 659 remove remove the specified files on the next commit
659 660 serve start stand-alone webserver
660 661 status show changed files in the working directory
661 662 summary summarize working directory state
662 663 update update working directory (or switch revisions)
663 664
664 665 (use 'hg help' for the full list of commands or 'hg -v' for details)
665 666 [255]
666 667
667 668 Typoed command gives suggestion
668 669 $ hg puls
669 670 hg: unknown command 'puls'
670 671 (did you mean one of pull, push?)
671 672 [255]
672 673
673 674 Not enabled extension gets suggested
674 675
675 676 $ hg rebase
676 677 hg: unknown command 'rebase'
677 678 'rebase' is provided by the following extension:
678 679
679 680 rebase command to move sets of revisions to a different ancestor
680 681
681 682 (use 'hg help extensions' for information on enabling extensions)
682 683 [255]
683 684
684 685 Disabled extension gets suggested
685 686 $ hg --config extensions.rebase=! rebase
686 687 hg: unknown command 'rebase'
687 688 'rebase' is provided by the following extension:
688 689
689 690 rebase command to move sets of revisions to a different ancestor
690 691
691 692 (use 'hg help extensions' for information on enabling extensions)
692 693 [255]
693 694
694 695 Make sure that we don't run afoul of the help system thinking that
695 696 this is a section and erroring out weirdly.
696 697
697 698 $ hg .log
698 699 hg: unknown command '.log'
699 700 (did you mean log?)
700 701 [255]
701 702
702 703 $ hg log.
703 704 hg: unknown command 'log.'
704 705 (did you mean log?)
705 706 [255]
706 707 $ hg pu.lh
707 708 hg: unknown command 'pu.lh'
708 709 (did you mean one of pull, push?)
709 710 [255]
710 711
711 712 $ cat > helpext.py <<EOF
712 713 > import os
713 714 > from mercurial import commands, registrar
714 715 >
715 716 > cmdtable = {}
716 717 > command = registrar.command(cmdtable)
717 718 >
718 719 > @command(b'nohelp',
719 720 > [(b'', b'longdesc', 3, b'x'*90),
720 721 > (b'n', b'', None, b'normal desc'),
721 722 > (b'', b'newline', b'', b'line1\nline2')],
722 723 > b'hg nohelp',
723 724 > norepo=True)
724 725 > @command(b'debugoptADV', [(b'', b'aopt', None, b'option is (ADVANCED)')])
725 726 > @command(b'debugoptDEP', [(b'', b'dopt', None, b'option is (DEPRECATED)')])
726 727 > @command(b'debugoptEXP', [(b'', b'eopt', None, b'option is (EXPERIMENTAL)')])
727 728 > def nohelp(ui, *args, **kwargs):
728 729 > pass
729 730 >
730 731 > def uisetup(ui):
731 732 > ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext')
732 733 > ui.setconfig(b'alias', b'hgalias', b'summary', b'helpext')
733 734 >
734 735 > EOF
735 736 $ echo '[extensions]' >> $HGRCPATH
736 737 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
737 738
738 739 Test for aliases
739 740
740 741 $ hg help hgalias
741 742 hg hgalias [--remote]
742 743
743 744 alias for: hg summary
744 745
745 746 summarize working directory state
746 747
747 748 This generates a brief summary of the working directory state, including
748 749 parents, branch, commit status, phase and available updates.
749 750
750 751 With the --remote option, this will check the default paths for incoming
751 752 and outgoing changes. This can be time-consuming.
752 753
753 754 Returns 0 on success.
754 755
755 756 defined by: helpext
756 757
757 758 options:
758 759
759 760 --remote check for push and pull
760 761
761 762 (some details hidden, use --verbose to show complete help)
762 763
763 764 $ hg help shellalias
764 765 hg shellalias
765 766
766 767 shell alias for:
767 768
768 769 echo hi
769 770
770 771 defined by: helpext
771 772
772 773 (some details hidden, use --verbose to show complete help)
773 774
774 775 Test command with no help text
775 776
776 777 $ hg help nohelp
777 778 hg nohelp
778 779
779 780 (no help text available)
780 781
781 782 options:
782 783
783 784 --longdesc VALUE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
784 785 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (default: 3)
785 786 -n -- normal desc
786 787 --newline VALUE line1 line2
787 788
788 789 (some details hidden, use --verbose to show complete help)
789 790
790 791 $ hg help -k nohelp
791 792 Commands:
792 793
793 794 nohelp hg nohelp
794 795
795 796 Extension Commands:
796 797
797 798 nohelp (no help text available)
798 799
799 800 Test that default list of commands omits extension commands
800 801
801 802 $ hg help
802 803 Mercurial Distributed SCM
803 804
804 805 list of commands:
805 806
806 807 add add the specified files on the next commit
807 808 addremove add all new files, delete all missing files
808 809 annotate show changeset information by line for each file
809 810 archive create an unversioned archive of a repository revision
810 811 backout reverse effect of earlier changeset
811 812 bisect subdivision search of changesets
812 813 bookmarks create a new bookmark or list existing bookmarks
813 814 branch set or show the current branch name
814 815 branches list repository named branches
815 816 bundle create a bundle file
816 817 cat output the current or given revision of files
817 818 clone make a copy of an existing repository
818 819 commit commit the specified files or all outstanding changes
819 820 config show combined config settings from all hgrc files
820 821 copy mark files as copied for the next commit
821 822 diff diff repository (or selected files)
822 823 export dump the header and diffs for one or more changesets
823 824 files list tracked files
824 825 forget forget the specified files on the next commit
825 826 graft copy changes from other branches onto the current branch
826 827 grep search revision history for a pattern in specified files
827 828 heads show branch heads
828 829 help show help for a given topic or a help overview
829 830 identify identify the working directory or specified revision
830 831 import import an ordered set of patches
831 832 incoming show new changesets found in source
832 833 init create a new repository in the given directory
833 834 log show revision history of entire repository or files
834 835 manifest output the current or given revision of the project manifest
835 836 merge merge another revision into working directory
836 837 outgoing show changesets not found in the destination
837 838 paths show aliases for remote repositories
838 839 phase set or show the current phase name
839 840 pull pull changes from the specified source
840 841 push push changes to the specified destination
841 842 recover roll back an interrupted transaction
842 843 remove remove the specified files on the next commit
843 844 rename rename files; equivalent of copy + remove
844 845 resolve redo merges or set/view the merge status of files
845 846 revert restore files to their checkout state
846 847 root print the root (top) of the current working directory
847 848 serve start stand-alone webserver
848 849 status show changed files in the working directory
849 850 summary summarize working directory state
850 851 tag add one or more tags for the current or given revision
851 852 tags list repository tags
852 853 unbundle apply one or more bundle files
853 854 update update working directory (or switch revisions)
854 855 verify verify the integrity of the repository
855 856 version output version and copyright information
856 857
857 858 enabled extensions:
858 859
859 860 helpext (no help text available)
860 861
861 862 additional help topics:
862 863
863 864 bundlespec Bundle File Formats
864 865 color Colorizing Outputs
865 866 config Configuration Files
866 867 dates Date Formats
867 868 diffs Diff Formats
868 869 environment Environment Variables
869 870 extensions Using Additional Features
870 871 filesets Specifying File Sets
871 872 flags Command-line flags
872 873 glossary Glossary
873 874 hgignore Syntax for Mercurial Ignore Files
874 875 hgweb Configuring hgweb
875 876 internals Technical implementation topics
876 877 merge-tools Merge Tools
877 878 pager Pager Support
878 879 patterns File Name Patterns
879 880 phases Working with Phases
880 881 revisions Specifying Revisions
881 882 scripting Using Mercurial from scripts and automation
882 883 subrepos Subrepositories
883 884 templating Template Usage
884 885 urls URL Paths
885 886
886 887 (use 'hg help -v' to show built-in aliases and global options)
887 888
888 889
889 890 Test list of internal help commands
890 891
891 892 $ hg help debug
892 893 debug commands (internal and unsupported):
893 894
894 895 debugancestor
895 896 find the ancestor revision of two revisions in a given index
896 897 debugapplystreamclonebundle
897 898 apply a stream clone bundle file
898 899 debugbuilddag
899 900 builds a repo with a given DAG from scratch in the current
900 901 empty repo
901 902 debugbundle lists the contents of a bundle
902 903 debugcapabilities
903 904 lists the capabilities of a remote peer
904 905 debugcheckstate
905 906 validate the correctness of the current dirstate
906 907 debugcolor show available color, effects or style
907 908 debugcommands
908 909 list all available commands and options
909 910 debugcomplete
910 911 returns the completion list associated with the given command
911 912 debugcreatestreamclonebundle
912 913 create a stream clone bundle file
913 914 debugdag format the changelog or an index DAG as a concise textual
914 915 description
915 916 debugdata dump the contents of a data file revision
916 917 debugdate parse and display a date
917 918 debugdeltachain
918 919 dump information about delta chains in a revlog
919 920 debugdirstate
920 921 show the contents of the current dirstate
921 922 debugdiscovery
922 923 runs the changeset discovery protocol in isolation
923 924 debugdownload
924 925 download a resource using Mercurial logic and config
925 926 debugextensions
926 927 show information about active extensions
927 928 debugfileset parse and apply a fileset specification
928 929 debugformat display format information about the current repository
929 930 debugfsinfo show information detected about current filesystem
930 931 debuggetbundle
931 932 retrieves a bundle from a repo
932 933 debugignore display the combined ignore pattern and information about
933 934 ignored files
934 935 debugindex dump the contents of an index file
935 936 debugindexdot
936 937 dump an index DAG as a graphviz dot file
937 938 debuginstall test Mercurial installation
938 939 debugknown test whether node ids are known to a repo
939 940 debuglocks show or modify state of locks
940 941 debugmergestate
941 942 print merge state
942 943 debugnamecomplete
943 944 complete "names" - tags, open branch names, bookmark names
944 945 debugobsolete
945 946 create arbitrary obsolete marker
946 947 debugoptADV (no help text available)
947 948 debugoptDEP (no help text available)
948 949 debugoptEXP (no help text available)
949 950 debugpathcomplete
950 951 complete part or all of a tracked path
951 952 debugpeer establish a connection to a peer repository
952 953 debugpickmergetool
953 954 examine which merge tool is chosen for specified file
954 955 debugpushkey access the pushkey key/value protocol
955 956 debugpvec (no help text available)
956 957 debugrebuilddirstate
957 958 rebuild the dirstate as it would look like for the given
958 959 revision
959 960 debugrebuildfncache
960 961 rebuild the fncache file
961 962 debugrename dump rename information
962 963 debugrevlog show data and statistics about a revlog
963 964 debugrevspec parse and apply a revision specification
964 965 debugsetparents
965 966 manually set the parents of the current working directory
966 967 debugssl test a secure connection to a server
967 968 debugsub (no help text available)
968 969 debugsuccessorssets
969 970 show set of successors for revision
970 971 debugtemplate
971 972 parse and apply a template
972 973 debugupdatecaches
973 974 warm all known caches in the repository
974 975 debugupgraderepo
975 976 upgrade a repository to use different features
976 977 debugwalk show how files match on given patterns
977 978 debugwireargs
978 979 (no help text available)
979 980
980 981 (use 'hg help -v debug' to show built-in aliases and global options)
981 982
982 983 internals topic renders index of available sub-topics
983 984
984 985 $ hg help internals
985 986 Technical implementation topics
986 987 """""""""""""""""""""""""""""""
987 988
988 989 To access a subtopic, use "hg help internals.{subtopic-name}"
989 990
990 991 bundles Bundles
991 992 censor Censor
992 993 changegroups Changegroups
993 994 config Config Registrar
994 995 requirements Repository Requirements
995 996 revlogs Revision Logs
996 997 wireprotocol Wire Protocol
997 998
998 999 sub-topics can be accessed
999 1000
1000 1001 $ hg help internals.changegroups
1001 1002 Changegroups
1002 1003 """"""""""""
1003 1004
1004 1005 Changegroups are representations of repository revlog data, specifically
1005 1006 the changelog data, root/flat manifest data, treemanifest data, and
1006 1007 filelogs.
1007 1008
1008 1009 There are 3 versions of changegroups: "1", "2", and "3". From a high-
1009 1010 level, versions "1" and "2" are almost exactly the same, with the only
1010 1011 difference being an additional item in the *delta header*. Version "3"
1011 1012 adds support for revlog flags in the *delta header* and optionally
1012 1013 exchanging treemanifests (enabled by setting an option on the
1013 1014 "changegroup" part in the bundle2).
1014 1015
1015 1016 Changegroups when not exchanging treemanifests consist of 3 logical
1016 1017 segments:
1017 1018
1018 1019 +---------------------------------+
1019 1020 | | | |
1020 1021 | changeset | manifest | filelogs |
1021 1022 | | | |
1022 1023 | | | |
1023 1024 +---------------------------------+
1024 1025
1025 1026 When exchanging treemanifests, there are 4 logical segments:
1026 1027
1027 1028 +-------------------------------------------------+
1028 1029 | | | | |
1029 1030 | changeset | root | treemanifests | filelogs |
1030 1031 | | manifest | | |
1031 1032 | | | | |
1032 1033 +-------------------------------------------------+
1033 1034
1034 1035 The principle building block of each segment is a *chunk*. A *chunk* is a
1035 1036 framed piece of data:
1036 1037
1037 1038 +---------------------------------------+
1038 1039 | | |
1039 1040 | length | data |
1040 1041 | (4 bytes) | (<length - 4> bytes) |
1041 1042 | | |
1042 1043 +---------------------------------------+
1043 1044
1044 1045 All integers are big-endian signed integers. Each chunk starts with a
1045 1046 32-bit integer indicating the length of the entire chunk (including the
1046 1047 length field itself).
1047 1048
1048 1049 There is a special case chunk that has a value of 0 for the length
1049 1050 ("0x00000000"). We call this an *empty chunk*.
1050 1051
1051 1052 Delta Groups
1052 1053 ============
1053 1054
1054 1055 A *delta group* expresses the content of a revlog as a series of deltas,
1055 1056 or patches against previous revisions.
1056 1057
1057 1058 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
1058 1059 to signal the end of the delta group:
1059 1060
1060 1061 +------------------------------------------------------------------------+
1061 1062 | | | | | |
1062 1063 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
1063 1064 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
1064 1065 | | | | | |
1065 1066 +------------------------------------------------------------------------+
1066 1067
1067 1068 Each *chunk*'s data consists of the following:
1068 1069
1069 1070 +---------------------------------------+
1070 1071 | | |
1071 1072 | delta header | delta data |
1072 1073 | (various by version) | (various) |
1073 1074 | | |
1074 1075 +---------------------------------------+
1075 1076
1076 1077 The *delta data* is a series of *delta*s that describe a diff from an
1077 1078 existing entry (either that the recipient already has, or previously
1078 1079 specified in the bundle/changegroup).
1079 1080
1080 1081 The *delta header* is different between versions "1", "2", and "3" of the
1081 1082 changegroup format.
1082 1083
1083 1084 Version 1 (headerlen=80):
1084 1085
1085 1086 +------------------------------------------------------+
1086 1087 | | | | |
1087 1088 | node | p1 node | p2 node | link node |
1088 1089 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1089 1090 | | | | |
1090 1091 +------------------------------------------------------+
1091 1092
1092 1093 Version 2 (headerlen=100):
1093 1094
1094 1095 +------------------------------------------------------------------+
1095 1096 | | | | | |
1096 1097 | node | p1 node | p2 node | base node | link node |
1097 1098 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1098 1099 | | | | | |
1099 1100 +------------------------------------------------------------------+
1100 1101
1101 1102 Version 3 (headerlen=102):
1102 1103
1103 1104 +------------------------------------------------------------------------------+
1104 1105 | | | | | | |
1105 1106 | node | p1 node | p2 node | base node | link node | flags |
1106 1107 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
1107 1108 | | | | | | |
1108 1109 +------------------------------------------------------------------------------+
1109 1110
1110 1111 The *delta data* consists of "chunklen - 4 - headerlen" bytes, which
1111 1112 contain a series of *delta*s, densely packed (no separators). These deltas
1112 1113 describe a diff from an existing entry (either that the recipient already
1113 1114 has, or previously specified in the bundle/changegroup). The format is
1114 1115 described more fully in "hg help internals.bdiff", but briefly:
1115 1116
1116 1117 +---------------------------------------------------------------+
1117 1118 | | | | |
1118 1119 | start offset | end offset | new length | content |
1119 1120 | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) |
1120 1121 | | | | |
1121 1122 +---------------------------------------------------------------+
1122 1123
1123 1124 Please note that the length field in the delta data does *not* include
1124 1125 itself.
1125 1126
1126 1127 In version 1, the delta is always applied against the previous node from
1127 1128 the changegroup or the first parent if this is the first entry in the
1128 1129 changegroup.
1129 1130
1130 1131 In version 2 and up, the delta base node is encoded in the entry in the
1131 1132 changegroup. This allows the delta to be expressed against any parent,
1132 1133 which can result in smaller deltas and more efficient encoding of data.
1133 1134
1134 1135 Changeset Segment
1135 1136 =================
1136 1137
1137 1138 The *changeset segment* consists of a single *delta group* holding
1138 1139 changelog data. The *empty chunk* at the end of the *delta group* denotes
1139 1140 the boundary to the *manifest segment*.
1140 1141
1141 1142 Manifest Segment
1142 1143 ================
1143 1144
1144 1145 The *manifest segment* consists of a single *delta group* holding manifest
1145 1146 data. If treemanifests are in use, it contains only the manifest for the
1146 1147 root directory of the repository. Otherwise, it contains the entire
1147 1148 manifest data. The *empty chunk* at the end of the *delta group* denotes
1148 1149 the boundary to the next segment (either the *treemanifests segment* or
1149 1150 the *filelogs segment*, depending on version and the request options).
1150 1151
1151 1152 Treemanifests Segment
1152 1153 ---------------------
1153 1154
1154 1155 The *treemanifests segment* only exists in changegroup version "3", and
1155 1156 only if the 'treemanifest' param is part of the bundle2 changegroup part
1156 1157 (it is not possible to use changegroup version 3 outside of bundle2).
1157 1158 Aside from the filenames in the *treemanifests segment* containing a
1158 1159 trailing "/" character, it behaves identically to the *filelogs segment*
1159 1160 (see below). The final sub-segment is followed by an *empty chunk*
1160 1161 (logically, a sub-segment with filename size 0). This denotes the boundary
1161 1162 to the *filelogs segment*.
1162 1163
1163 1164 Filelogs Segment
1164 1165 ================
1165 1166
1166 1167 The *filelogs segment* consists of multiple sub-segments, each
1167 1168 corresponding to an individual file whose data is being described:
1168 1169
1169 1170 +--------------------------------------------------+
1170 1171 | | | | | |
1171 1172 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
1172 1173 | | | | | (4 bytes) |
1173 1174 | | | | | |
1174 1175 +--------------------------------------------------+
1175 1176
1176 1177 The final filelog sub-segment is followed by an *empty chunk* (logically,
1177 1178 a sub-segment with filename size 0). This denotes the end of the segment
1178 1179 and of the overall changegroup.
1179 1180
1180 1181 Each filelog sub-segment consists of the following:
1181 1182
1182 1183 +------------------------------------------------------+
1183 1184 | | | |
1184 1185 | filename length | filename | delta group |
1185 1186 | (4 bytes) | (<length - 4> bytes) | (various) |
1186 1187 | | | |
1187 1188 +------------------------------------------------------+
1188 1189
1189 1190 That is, a *chunk* consisting of the filename (not terminated or padded)
1190 1191 followed by N chunks constituting the *delta group* for this file. The
1191 1192 *empty chunk* at the end of each *delta group* denotes the boundary to the
1192 1193 next filelog sub-segment.
1193 1194
1194 1195 Test list of commands with command with no help text
1195 1196
1196 1197 $ hg help helpext
1197 1198 helpext extension - no help text available
1198 1199
1199 1200 list of commands:
1200 1201
1201 1202 nohelp (no help text available)
1202 1203
1203 1204 (use 'hg help -v helpext' to show built-in aliases and global options)
1204 1205
1205 1206
1206 1207 test advanced, deprecated and experimental options are hidden in command help
1207 1208 $ hg help debugoptADV
1208 1209 hg debugoptADV
1209 1210
1210 1211 (no help text available)
1211 1212
1212 1213 options:
1213 1214
1214 1215 (some details hidden, use --verbose to show complete help)
1215 1216 $ hg help debugoptDEP
1216 1217 hg debugoptDEP
1217 1218
1218 1219 (no help text available)
1219 1220
1220 1221 options:
1221 1222
1222 1223 (some details hidden, use --verbose to show complete help)
1223 1224
1224 1225 $ hg help debugoptEXP
1225 1226 hg debugoptEXP
1226 1227
1227 1228 (no help text available)
1228 1229
1229 1230 options:
1230 1231
1231 1232 (some details hidden, use --verbose to show complete help)
1232 1233
1233 1234 test advanced, deprecated and experimental options are shown with -v
1234 1235 $ hg help -v debugoptADV | grep aopt
1235 1236 --aopt option is (ADVANCED)
1236 1237 $ hg help -v debugoptDEP | grep dopt
1237 1238 --dopt option is (DEPRECATED)
1238 1239 $ hg help -v debugoptEXP | grep eopt
1239 1240 --eopt option is (EXPERIMENTAL)
1240 1241
1241 1242 #if gettext
1242 1243 test deprecated option is hidden with translation with untranslated description
1243 1244 (use many globy for not failing on changed transaction)
1244 1245 $ LANGUAGE=sv hg help debugoptDEP
1245 1246 hg debugoptDEP
1246 1247
1247 1248 (*) (glob)
1248 1249
1249 1250 options:
1250 1251
1251 1252 (some details hidden, use --verbose to show complete help)
1252 1253 #endif
1253 1254
1254 1255 Test commands that collide with topics (issue4240)
1255 1256
1256 1257 $ hg config -hq
1257 1258 hg config [-u] [NAME]...
1258 1259
1259 1260 show combined config settings from all hgrc files
1260 1261 $ hg showconfig -hq
1261 1262 hg config [-u] [NAME]...
1262 1263
1263 1264 show combined config settings from all hgrc files
1264 1265
1265 1266 Test a help topic
1266 1267
1267 1268 $ hg help dates
1268 1269 Date Formats
1269 1270 """"""""""""
1270 1271
1271 1272 Some commands allow the user to specify a date, e.g.:
1272 1273
1273 1274 - backout, commit, import, tag: Specify the commit date.
1274 1275 - log, revert, update: Select revision(s) by date.
1275 1276
1276 1277 Many date formats are valid. Here are some examples:
1277 1278
1278 1279 - "Wed Dec 6 13:18:29 2006" (local timezone assumed)
1279 1280 - "Dec 6 13:18 -0600" (year assumed, time offset provided)
1280 1281 - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
1281 1282 - "Dec 6" (midnight)
1282 1283 - "13:18" (today assumed)
1283 1284 - "3:39" (3:39AM assumed)
1284 1285 - "3:39pm" (15:39)
1285 1286 - "2006-12-06 13:18:29" (ISO 8601 format)
1286 1287 - "2006-12-6 13:18"
1287 1288 - "2006-12-6"
1288 1289 - "12-6"
1289 1290 - "12/6"
1290 1291 - "12/6/6" (Dec 6 2006)
1291 1292 - "today" (midnight)
1292 1293 - "yesterday" (midnight)
1293 1294 - "now" - right now
1294 1295
1295 1296 Lastly, there is Mercurial's internal format:
1296 1297
1297 1298 - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC)
1298 1299
1299 1300 This is the internal representation format for dates. The first number is
1300 1301 the number of seconds since the epoch (1970-01-01 00:00 UTC). The second
1301 1302 is the offset of the local timezone, in seconds west of UTC (negative if
1302 1303 the timezone is east of UTC).
1303 1304
1304 1305 The log command also accepts date ranges:
1305 1306
1306 1307 - "<DATE" - at or before a given date/time
1307 1308 - ">DATE" - on or after a given date/time
1308 1309 - "DATE to DATE" - a date range, inclusive
1309 1310 - "-DAYS" - within a given number of days of today
1310 1311
1311 1312 Test repeated config section name
1312 1313
1313 1314 $ hg help config.host
1314 1315 "http_proxy.host"
1315 1316 Host name and (optional) port of the proxy server, for example
1316 1317 "myproxy:8000".
1317 1318
1318 1319 "smtp.host"
1319 1320 Host name of mail server, e.g. "mail.example.com".
1320 1321
1321 1322 Unrelated trailing paragraphs shouldn't be included
1322 1323
1323 1324 $ hg help config.extramsg | grep '^$'
1324 1325
1325 1326
1326 1327 Test capitalized section name
1327 1328
1328 1329 $ hg help scripting.HGPLAIN > /dev/null
1329 1330
1330 1331 Help subsection:
1331 1332
1332 1333 $ hg help config.charsets |grep "Email example:" > /dev/null
1333 1334 [1]
1334 1335
1335 1336 Show nested definitions
1336 1337 ("profiling.type"[break]"ls"[break]"stat"[break])
1337 1338
1338 1339 $ hg help config.type | egrep '^$'|wc -l
1339 1340 \s*3 (re)
1340 1341
1341 1342 Separate sections from subsections
1342 1343
1343 1344 $ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq
1344 1345 "format"
1345 1346 --------
1346 1347
1347 1348 "usegeneraldelta"
1348 1349
1349 1350 "dotencode"
1350 1351
1351 1352 "usefncache"
1352 1353
1353 1354 "usestore"
1354 1355
1355 1356 "profiling"
1356 1357 -----------
1357 1358
1358 1359 "format"
1359 1360
1360 1361 "progress"
1361 1362 ----------
1362 1363
1363 1364 "format"
1364 1365
1365 1366
1366 1367 Last item in help config.*:
1367 1368
1368 1369 $ hg help config.`hg help config|grep '^ "'| \
1369 1370 > tail -1|sed 's![ "]*!!g'`| \
1370 1371 > grep 'hg help -c config' > /dev/null
1371 1372 [1]
1372 1373
1373 1374 note to use help -c for general hg help config:
1374 1375
1375 1376 $ hg help config |grep 'hg help -c config' > /dev/null
1376 1377
1377 1378 Test templating help
1378 1379
1379 1380 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
1380 1381 desc String. The text of the changeset description.
1381 1382 diffstat String. Statistics of changes with the following format:
1382 1383 firstline Any text. Returns the first line of text.
1383 1384 nonempty Any text. Returns '(none)' if the string is empty.
1384 1385
1385 1386 Test deprecated items
1386 1387
1387 1388 $ hg help -v templating | grep currentbookmark
1388 1389 currentbookmark
1389 1390 $ hg help templating | (grep currentbookmark || true)
1390 1391
1391 1392 Test help hooks
1392 1393
1393 1394 $ cat > helphook1.py <<EOF
1394 1395 > from mercurial import help
1395 1396 >
1396 1397 > def rewrite(ui, topic, doc):
1397 1398 > return doc + '\nhelphook1\n'
1398 1399 >
1399 1400 > def extsetup(ui):
1400 1401 > help.addtopichook('revisions', rewrite)
1401 1402 > EOF
1402 1403 $ cat > helphook2.py <<EOF
1403 1404 > from mercurial import help
1404 1405 >
1405 1406 > def rewrite(ui, topic, doc):
1406 1407 > return doc + '\nhelphook2\n'
1407 1408 >
1408 1409 > def extsetup(ui):
1409 1410 > help.addtopichook('revisions', rewrite)
1410 1411 > EOF
1411 1412 $ echo '[extensions]' >> $HGRCPATH
1412 1413 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
1413 1414 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
1414 1415 $ hg help revsets | grep helphook
1415 1416 helphook1
1416 1417 helphook2
1417 1418
1418 1419 help -c should only show debug --debug
1419 1420
1420 1421 $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$'
1421 1422 [1]
1422 1423
1423 1424 help -c should only show deprecated for -v
1424 1425
1425 1426 $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$'
1426 1427 [1]
1427 1428
1428 1429 Test -s / --system
1429 1430
1430 1431 $ hg help config.files -s windows |grep 'etc/mercurial' | \
1431 1432 > wc -l | sed -e 's/ //g'
1432 1433 0
1433 1434 $ hg help config.files --system unix | grep 'USER' | \
1434 1435 > wc -l | sed -e 's/ //g'
1435 1436 0
1436 1437
1437 1438 Test -e / -c / -k combinations
1438 1439
1439 1440 $ hg help -c|egrep '^[A-Z].*:|^ debug'
1440 1441 Commands:
1441 1442 $ hg help -e|egrep '^[A-Z].*:|^ debug'
1442 1443 Extensions:
1443 1444 $ hg help -k|egrep '^[A-Z].*:|^ debug'
1444 1445 Topics:
1445 1446 Commands:
1446 1447 Extensions:
1447 1448 Extension Commands:
1448 1449 $ hg help -c schemes
1449 1450 abort: no such help topic: schemes
1450 1451 (try 'hg help --keyword schemes')
1451 1452 [255]
1452 1453 $ hg help -e schemes |head -1
1453 1454 schemes extension - extend schemes with shortcuts to repository swarms
1454 1455 $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):'
1455 1456 Commands:
1456 1457 $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):'
1457 1458 Extensions:
1458 1459 $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):'
1459 1460 Extensions:
1460 1461 Commands:
1461 1462 $ hg help -c commit > /dev/null
1462 1463 $ hg help -e -c commit > /dev/null
1463 1464 $ hg help -e commit > /dev/null
1464 1465 abort: no such help topic: commit
1465 1466 (try 'hg help --keyword commit')
1466 1467 [255]
1467 1468
1468 1469 Test keyword search help
1469 1470
1470 1471 $ cat > prefixedname.py <<EOF
1471 1472 > '''matched against word "clone"
1472 1473 > '''
1473 1474 > EOF
1474 1475 $ echo '[extensions]' >> $HGRCPATH
1475 1476 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
1476 1477 $ hg help -k clone
1477 1478 Topics:
1478 1479
1479 1480 config Configuration Files
1480 1481 extensions Using Additional Features
1481 1482 glossary Glossary
1482 1483 phases Working with Phases
1483 1484 subrepos Subrepositories
1484 1485 urls URL Paths
1485 1486
1486 1487 Commands:
1487 1488
1488 1489 bookmarks create a new bookmark or list existing bookmarks
1489 1490 clone make a copy of an existing repository
1490 1491 paths show aliases for remote repositories
1491 1492 update update working directory (or switch revisions)
1492 1493
1493 1494 Extensions:
1494 1495
1495 1496 clonebundles advertise pre-generated bundles to seed clones
1496 1497 prefixedname matched against word "clone"
1497 1498 relink recreates hardlinks between repository clones
1498 1499
1499 1500 Extension Commands:
1500 1501
1501 1502 qclone clone main and patch repository at same time
1502 1503
1503 1504 Test unfound topic
1504 1505
1505 1506 $ hg help nonexistingtopicthatwillneverexisteverever
1506 1507 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
1507 1508 (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever')
1508 1509 [255]
1509 1510
1510 1511 Test unfound keyword
1511 1512
1512 1513 $ hg help --keyword nonexistingwordthatwillneverexisteverever
1513 1514 abort: no matches
1514 1515 (try 'hg help' for a list of topics)
1515 1516 [255]
1516 1517
1517 1518 Test omit indicating for help
1518 1519
1519 1520 $ cat > addverboseitems.py <<EOF
1520 1521 > '''extension to test omit indicating.
1521 1522 >
1522 1523 > This paragraph is never omitted (for extension)
1523 1524 >
1524 1525 > .. container:: verbose
1525 1526 >
1526 1527 > This paragraph is omitted,
1527 1528 > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
1528 1529 >
1529 1530 > This paragraph is never omitted, too (for extension)
1530 1531 > '''
1531 1532 > from __future__ import absolute_import
1532 1533 > from mercurial import commands, help
1533 1534 > testtopic = """This paragraph is never omitted (for topic).
1534 1535 >
1535 1536 > .. container:: verbose
1536 1537 >
1537 1538 > This paragraph is omitted,
1538 1539 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
1539 1540 >
1540 1541 > This paragraph is never omitted, too (for topic)
1541 1542 > """
1542 1543 > def extsetup(ui):
1543 1544 > help.helptable.append((["topic-containing-verbose"],
1544 1545 > "This is the topic to test omit indicating.",
1545 1546 > lambda ui: testtopic))
1546 1547 > EOF
1547 1548 $ echo '[extensions]' >> $HGRCPATH
1548 1549 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1549 1550 $ hg help addverboseitems
1550 1551 addverboseitems extension - extension to test omit indicating.
1551 1552
1552 1553 This paragraph is never omitted (for extension)
1553 1554
1554 1555 This paragraph is never omitted, too (for extension)
1555 1556
1556 1557 (some details hidden, use --verbose to show complete help)
1557 1558
1558 1559 no commands defined
1559 1560 $ hg help -v addverboseitems
1560 1561 addverboseitems extension - extension to test omit indicating.
1561 1562
1562 1563 This paragraph is never omitted (for extension)
1563 1564
1564 1565 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1565 1566 extension)
1566 1567
1567 1568 This paragraph is never omitted, too (for extension)
1568 1569
1569 1570 no commands defined
1570 1571 $ hg help topic-containing-verbose
1571 1572 This is the topic to test omit indicating.
1572 1573 """"""""""""""""""""""""""""""""""""""""""
1573 1574
1574 1575 This paragraph is never omitted (for topic).
1575 1576
1576 1577 This paragraph is never omitted, too (for topic)
1577 1578
1578 1579 (some details hidden, use --verbose to show complete help)
1579 1580 $ hg help -v topic-containing-verbose
1580 1581 This is the topic to test omit indicating.
1581 1582 """"""""""""""""""""""""""""""""""""""""""
1582 1583
1583 1584 This paragraph is never omitted (for topic).
1584 1585
1585 1586 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1586 1587 topic)
1587 1588
1588 1589 This paragraph is never omitted, too (for topic)
1589 1590
1590 1591 Test section lookup
1591 1592
1592 1593 $ hg help revset.merge
1593 1594 "merge()"
1594 1595 Changeset is a merge changeset.
1595 1596
1596 1597 $ hg help glossary.dag
1597 1598 DAG
1598 1599 The repository of changesets of a distributed version control system
1599 1600 (DVCS) can be described as a directed acyclic graph (DAG), consisting
1600 1601 of nodes and edges, where nodes correspond to changesets and edges
1601 1602 imply a parent -> child relation. This graph can be visualized by
1602 1603 graphical tools such as 'hg log --graph'. In Mercurial, the DAG is
1603 1604 limited by the requirement for children to have at most two parents.
1604 1605
1605 1606
1606 1607 $ hg help hgrc.paths
1607 1608 "paths"
1608 1609 -------
1609 1610
1610 1611 Assigns symbolic names and behavior to repositories.
1611 1612
1612 1613 Options are symbolic names defining the URL or directory that is the
1613 1614 location of the repository. Example:
1614 1615
1615 1616 [paths]
1616 1617 my_server = https://example.com/my_repo
1617 1618 local_path = /home/me/repo
1618 1619
1619 1620 These symbolic names can be used from the command line. To pull from
1620 1621 "my_server": 'hg pull my_server'. To push to "local_path": 'hg push
1621 1622 local_path'.
1622 1623
1623 1624 Options containing colons (":") denote sub-options that can influence
1624 1625 behavior for that specific path. Example:
1625 1626
1626 1627 [paths]
1627 1628 my_server = https://example.com/my_path
1628 1629 my_server:pushurl = ssh://example.com/my_path
1629 1630
1630 1631 The following sub-options can be defined:
1631 1632
1632 1633 "pushurl"
1633 1634 The URL to use for push operations. If not defined, the location
1634 1635 defined by the path's main entry is used.
1635 1636
1636 1637 "pushrev"
1637 1638 A revset defining which revisions to push by default.
1638 1639
1639 1640 When 'hg push' is executed without a "-r" argument, the revset defined
1640 1641 by this sub-option is evaluated to determine what to push.
1641 1642
1642 1643 For example, a value of "." will push the working directory's revision
1643 1644 by default.
1644 1645
1645 1646 Revsets specifying bookmarks will not result in the bookmark being
1646 1647 pushed.
1647 1648
1648 1649 The following special named paths exist:
1649 1650
1650 1651 "default"
1651 1652 The URL or directory to use when no source or remote is specified.
1652 1653
1653 1654 'hg clone' will automatically define this path to the location the
1654 1655 repository was cloned from.
1655 1656
1656 1657 "default-push"
1657 1658 (deprecated) The URL or directory for the default 'hg push' location.
1658 1659 "default:pushurl" should be used instead.
1659 1660
1660 1661 $ hg help glossary.mcguffin
1661 1662 abort: help section not found: glossary.mcguffin
1662 1663 [255]
1663 1664
1664 1665 $ hg help glossary.mc.guffin
1665 1666 abort: help section not found: glossary.mc.guffin
1666 1667 [255]
1667 1668
1668 1669 $ hg help template.files
1669 1670 files List of strings. All files modified, added, or removed by
1670 1671 this changeset.
1671 1672 files(pattern)
1672 1673 All files of the current changeset matching the pattern. See
1673 1674 'hg help patterns'.
1674 1675
1675 1676 Test section lookup by translated message
1676 1677
1677 1678 str.lower() instead of encoding.lower(str) on translated message might
1678 1679 make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z)
1679 1680 as the second or later byte of multi-byte character.
1680 1681
1681 1682 For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932)
1682 1683 contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this
1683 1684 replacement makes message meaningless.
1684 1685
1685 1686 This tests that section lookup by translated string isn't broken by
1686 1687 such str.lower().
1687 1688
1688 1689 $ $PYTHON <<EOF
1689 1690 > def escape(s):
1690 1691 > return ''.join('\u%x' % ord(uc) for uc in s.decode('cp932'))
1691 1692 > # translation of "record" in ja_JP.cp932
1692 1693 > upper = "\x8bL\x98^"
1693 1694 > # str.lower()-ed section name should be treated as different one
1694 1695 > lower = "\x8bl\x98^"
1695 1696 > with open('ambiguous.py', 'w') as fp:
1696 1697 > fp.write("""# ambiguous section names in ja_JP.cp932
1697 1698 > u'''summary of extension
1698 1699 >
1699 1700 > %s
1700 1701 > ----
1701 1702 >
1702 1703 > Upper name should show only this message
1703 1704 >
1704 1705 > %s
1705 1706 > ----
1706 1707 >
1707 1708 > Lower name should show only this message
1708 1709 >
1709 1710 > subsequent section
1710 1711 > ------------------
1711 1712 >
1712 1713 > This should be hidden at 'hg help ambiguous' with section name.
1713 1714 > '''
1714 1715 > """ % (escape(upper), escape(lower)))
1715 1716 > EOF
1716 1717
1717 1718 $ cat >> $HGRCPATH <<EOF
1718 1719 > [extensions]
1719 1720 > ambiguous = ./ambiguous.py
1720 1721 > EOF
1721 1722
1722 1723 $ $PYTHON <<EOF | sh
1723 1724 > upper = "\x8bL\x98^"
1724 1725 > print("hg --encoding cp932 help -e ambiguous.%s" % upper)
1725 1726 > EOF
1726 1727 \x8bL\x98^ (esc)
1727 1728 ----
1728 1729
1729 1730 Upper name should show only this message
1730 1731
1731 1732
1732 1733 $ $PYTHON <<EOF | sh
1733 1734 > lower = "\x8bl\x98^"
1734 1735 > print("hg --encoding cp932 help -e ambiguous.%s" % lower)
1735 1736 > EOF
1736 1737 \x8bl\x98^ (esc)
1737 1738 ----
1738 1739
1739 1740 Lower name should show only this message
1740 1741
1741 1742
1742 1743 $ cat >> $HGRCPATH <<EOF
1743 1744 > [extensions]
1744 1745 > ambiguous = !
1745 1746 > EOF
1746 1747
1747 1748 Show help content of disabled extensions
1748 1749
1749 1750 $ cat >> $HGRCPATH <<EOF
1750 1751 > [extensions]
1751 1752 > ambiguous = !./ambiguous.py
1752 1753 > EOF
1753 1754 $ hg help -e ambiguous
1754 1755 ambiguous extension - (no help text available)
1755 1756
1756 1757 (use 'hg help extensions' for information on enabling extensions)
1757 1758
1758 1759 Test dynamic list of merge tools only shows up once
1759 1760 $ hg help merge-tools
1760 1761 Merge Tools
1761 1762 """""""""""
1762 1763
1763 1764 To merge files Mercurial uses merge tools.
1764 1765
1765 1766 A merge tool combines two different versions of a file into a merged file.
1766 1767 Merge tools are given the two files and the greatest common ancestor of
1767 1768 the two file versions, so they can determine the changes made on both
1768 1769 branches.
1769 1770
1770 1771 Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg
1771 1772 backout' and in several extensions.
1772 1773
1773 1774 Usually, the merge tool tries to automatically reconcile the files by
1774 1775 combining all non-overlapping changes that occurred separately in the two
1775 1776 different evolutions of the same initial base file. Furthermore, some
1776 1777 interactive merge programs make it easier to manually resolve conflicting
1777 1778 merges, either in a graphical way, or by inserting some conflict markers.
1778 1779 Mercurial does not include any interactive merge programs but relies on
1779 1780 external tools for that.
1780 1781
1781 1782 Available merge tools
1782 1783 =====================
1783 1784
1784 1785 External merge tools and their properties are configured in the merge-
1785 1786 tools configuration section - see hgrc(5) - but they can often just be
1786 1787 named by their executable.
1787 1788
1788 1789 A merge tool is generally usable if its executable can be found on the
1789 1790 system and if it can handle the merge. The executable is found if it is an
1790 1791 absolute or relative executable path or the name of an application in the
1791 1792 executable search path. The tool is assumed to be able to handle the merge
1792 1793 if it can handle symlinks if the file is a symlink, if it can handle
1793 1794 binary files if the file is binary, and if a GUI is available if the tool
1794 1795 requires a GUI.
1795 1796
1796 1797 There are some internal merge tools which can be used. The internal merge
1797 1798 tools are:
1798 1799
1799 1800 ":dump"
1800 1801 Creates three versions of the files to merge, containing the contents of
1801 1802 local, other and base. These files can then be used to perform a merge
1802 1803 manually. If the file to be merged is named "a.txt", these files will
1803 1804 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
1804 1805 they will be placed in the same directory as "a.txt".
1805 1806
1806 1807 This implies premerge. Therefore, files aren't dumped, if premerge runs
1807 1808 successfully. Use :forcedump to forcibly write files out.
1808 1809
1809 1810 ":fail"
1810 1811 Rather than attempting to merge files that were modified on both
1811 1812 branches, it marks them as unresolved. The resolve command must be used
1812 1813 to resolve these conflicts.
1813 1814
1814 1815 ":forcedump"
1815 1816 Creates three versions of the files as same as :dump, but omits
1816 1817 premerge.
1817 1818
1818 1819 ":local"
1819 1820 Uses the local 'p1()' version of files as the merged version.
1820 1821
1821 1822 ":merge"
1822 1823 Uses the internal non-interactive simple merge algorithm for merging
1823 1824 files. It will fail if there are any conflicts and leave markers in the
1824 1825 partially merged file. Markers will have two sections, one for each side
1825 1826 of merge.
1826 1827
1827 1828 ":merge-local"
1828 1829 Like :merge, but resolve all conflicts non-interactively in favor of the
1829 1830 local 'p1()' changes.
1830 1831
1831 1832 ":merge-other"
1832 1833 Like :merge, but resolve all conflicts non-interactively in favor of the
1833 1834 other 'p2()' changes.
1834 1835
1835 1836 ":merge3"
1836 1837 Uses the internal non-interactive simple merge algorithm for merging
1837 1838 files. It will fail if there are any conflicts and leave markers in the
1838 1839 partially merged file. Marker will have three sections, one from each
1839 1840 side of the merge and one for the base content.
1840 1841
1841 1842 ":other"
1842 1843 Uses the other 'p2()' version of files as the merged version.
1843 1844
1844 1845 ":prompt"
1845 1846 Asks the user which of the local 'p1()' or the other 'p2()' version to
1846 1847 keep as the merged version.
1847 1848
1848 1849 ":tagmerge"
1849 1850 Uses the internal tag merge algorithm (experimental).
1850 1851
1851 1852 ":union"
1852 1853 Uses the internal non-interactive simple merge algorithm for merging
1853 1854 files. It will use both left and right sides for conflict regions. No
1854 1855 markers are inserted.
1855 1856
1856 1857 Internal tools are always available and do not require a GUI but will by
1857 1858 default not handle symlinks or binary files.
1858 1859
1859 1860 Choosing a merge tool
1860 1861 =====================
1861 1862
1862 1863 Mercurial uses these rules when deciding which merge tool to use:
1863 1864
1864 1865 1. If a tool has been specified with the --tool option to merge or
1865 1866 resolve, it is used. If it is the name of a tool in the merge-tools
1866 1867 configuration, its configuration is used. Otherwise the specified tool
1867 1868 must be executable by the shell.
1868 1869 2. If the "HGMERGE" environment variable is present, its value is used and
1869 1870 must be executable by the shell.
1870 1871 3. If the filename of the file to be merged matches any of the patterns in
1871 1872 the merge-patterns configuration section, the first usable merge tool
1872 1873 corresponding to a matching pattern is used. Here, binary capabilities
1873 1874 of the merge tool are not considered.
1874 1875 4. If ui.merge is set it will be considered next. If the value is not the
1875 1876 name of a configured tool, the specified value is used and must be
1876 1877 executable by the shell. Otherwise the named tool is used if it is
1877 1878 usable.
1878 1879 5. If any usable merge tools are present in the merge-tools configuration
1879 1880 section, the one with the highest priority is used.
1880 1881 6. If a program named "hgmerge" can be found on the system, it is used -
1881 1882 but it will by default not be used for symlinks and binary files.
1882 1883 7. If the file to be merged is not binary and is not a symlink, then
1883 1884 internal ":merge" is used.
1884 1885 8. Otherwise, ":prompt" is used.
1885 1886
1886 1887 Note:
1887 1888 After selecting a merge program, Mercurial will by default attempt to
1888 1889 merge the files using a simple merge algorithm first. Only if it
1889 1890 doesn't succeed because of conflicting changes will Mercurial actually
1890 1891 execute the merge program. Whether to use the simple merge algorithm
1891 1892 first can be controlled by the premerge setting of the merge tool.
1892 1893 Premerge is enabled by default unless the file is binary or a symlink.
1893 1894
1894 1895 See the merge-tools and ui sections of hgrc(5) for details on the
1895 1896 configuration of merge tools.
1896 1897
1897 1898 Compression engines listed in `hg help bundlespec`
1898 1899
1899 1900 $ hg help bundlespec | grep gzip
1900 1901 "v1" bundles can only use the "gzip", "bzip2", and "none" compression
1901 1902 An algorithm that produces smaller bundles than "gzip".
1902 1903 This engine will likely produce smaller bundles than "gzip" but will be
1903 1904 "gzip"
1904 1905 better compression than "gzip". It also frequently yields better (?)
1905 1906
1906 1907 Test usage of section marks in help documents
1907 1908
1908 1909 $ cd "$TESTDIR"/../doc
1909 1910 $ $PYTHON check-seclevel.py
1910 1911 $ cd $TESTTMP
1911 1912
1912 1913 #if serve
1913 1914
1914 1915 Test the help pages in hgweb.
1915 1916
1916 1917 Dish up an empty repo; serve it cold.
1917 1918
1918 1919 $ hg init "$TESTTMP/test"
1919 1920 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
1920 1921 $ cat hg.pid >> $DAEMON_PIDS
1921 1922
1922 1923 $ get-with-headers.py $LOCALIP:$HGPORT "help"
1923 1924 200 Script output follows
1924 1925
1925 1926 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1926 1927 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1927 1928 <head>
1928 1929 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1929 1930 <meta name="robots" content="index, nofollow" />
1930 1931 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1931 1932 <script type="text/javascript" src="/static/mercurial.js"></script>
1932 1933
1933 1934 <title>Help: Index</title>
1934 1935 </head>
1935 1936 <body>
1936 1937
1937 1938 <div class="container">
1938 1939 <div class="menu">
1939 1940 <div class="logo">
1940 1941 <a href="https://mercurial-scm.org/">
1941 1942 <img src="/static/hglogo.png" alt="mercurial" /></a>
1942 1943 </div>
1943 1944 <ul>
1944 1945 <li><a href="/shortlog">log</a></li>
1945 1946 <li><a href="/graph">graph</a></li>
1946 1947 <li><a href="/tags">tags</a></li>
1947 1948 <li><a href="/bookmarks">bookmarks</a></li>
1948 1949 <li><a href="/branches">branches</a></li>
1949 1950 </ul>
1950 1951 <ul>
1951 1952 <li class="active">help</li>
1952 1953 </ul>
1953 1954 </div>
1954 1955
1955 1956 <div class="main">
1956 1957 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1957 1958
1958 1959 <form class="search" action="/log">
1959 1960
1960 1961 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
1961 1962 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1962 1963 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1963 1964 </form>
1964 1965 <table class="bigtable">
1965 1966 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
1966 1967
1967 1968 <tr><td>
1968 1969 <a href="/help/bundlespec">
1969 1970 bundlespec
1970 1971 </a>
1971 1972 </td><td>
1972 1973 Bundle File Formats
1973 1974 </td></tr>
1974 1975 <tr><td>
1975 1976 <a href="/help/color">
1976 1977 color
1977 1978 </a>
1978 1979 </td><td>
1979 1980 Colorizing Outputs
1980 1981 </td></tr>
1981 1982 <tr><td>
1982 1983 <a href="/help/config">
1983 1984 config
1984 1985 </a>
1985 1986 </td><td>
1986 1987 Configuration Files
1987 1988 </td></tr>
1988 1989 <tr><td>
1989 1990 <a href="/help/dates">
1990 1991 dates
1991 1992 </a>
1992 1993 </td><td>
1993 1994 Date Formats
1994 1995 </td></tr>
1995 1996 <tr><td>
1996 1997 <a href="/help/diffs">
1997 1998 diffs
1998 1999 </a>
1999 2000 </td><td>
2000 2001 Diff Formats
2001 2002 </td></tr>
2002 2003 <tr><td>
2003 2004 <a href="/help/environment">
2004 2005 environment
2005 2006 </a>
2006 2007 </td><td>
2007 2008 Environment Variables
2008 2009 </td></tr>
2009 2010 <tr><td>
2010 2011 <a href="/help/extensions">
2011 2012 extensions
2012 2013 </a>
2013 2014 </td><td>
2014 2015 Using Additional Features
2015 2016 </td></tr>
2016 2017 <tr><td>
2017 2018 <a href="/help/filesets">
2018 2019 filesets
2019 2020 </a>
2020 2021 </td><td>
2021 2022 Specifying File Sets
2022 2023 </td></tr>
2023 2024 <tr><td>
2024 2025 <a href="/help/flags">
2025 2026 flags
2026 2027 </a>
2027 2028 </td><td>
2028 2029 Command-line flags
2029 2030 </td></tr>
2030 2031 <tr><td>
2031 2032 <a href="/help/glossary">
2032 2033 glossary
2033 2034 </a>
2034 2035 </td><td>
2035 2036 Glossary
2036 2037 </td></tr>
2037 2038 <tr><td>
2038 2039 <a href="/help/hgignore">
2039 2040 hgignore
2040 2041 </a>
2041 2042 </td><td>
2042 2043 Syntax for Mercurial Ignore Files
2043 2044 </td></tr>
2044 2045 <tr><td>
2045 2046 <a href="/help/hgweb">
2046 2047 hgweb
2047 2048 </a>
2048 2049 </td><td>
2049 2050 Configuring hgweb
2050 2051 </td></tr>
2051 2052 <tr><td>
2052 2053 <a href="/help/internals">
2053 2054 internals
2054 2055 </a>
2055 2056 </td><td>
2056 2057 Technical implementation topics
2057 2058 </td></tr>
2058 2059 <tr><td>
2059 2060 <a href="/help/merge-tools">
2060 2061 merge-tools
2061 2062 </a>
2062 2063 </td><td>
2063 2064 Merge Tools
2064 2065 </td></tr>
2065 2066 <tr><td>
2066 2067 <a href="/help/pager">
2067 2068 pager
2068 2069 </a>
2069 2070 </td><td>
2070 2071 Pager Support
2071 2072 </td></tr>
2072 2073 <tr><td>
2073 2074 <a href="/help/patterns">
2074 2075 patterns
2075 2076 </a>
2076 2077 </td><td>
2077 2078 File Name Patterns
2078 2079 </td></tr>
2079 2080 <tr><td>
2080 2081 <a href="/help/phases">
2081 2082 phases
2082 2083 </a>
2083 2084 </td><td>
2084 2085 Working with Phases
2085 2086 </td></tr>
2086 2087 <tr><td>
2087 2088 <a href="/help/revisions">
2088 2089 revisions
2089 2090 </a>
2090 2091 </td><td>
2091 2092 Specifying Revisions
2092 2093 </td></tr>
2093 2094 <tr><td>
2094 2095 <a href="/help/scripting">
2095 2096 scripting
2096 2097 </a>
2097 2098 </td><td>
2098 2099 Using Mercurial from scripts and automation
2099 2100 </td></tr>
2100 2101 <tr><td>
2101 2102 <a href="/help/subrepos">
2102 2103 subrepos
2103 2104 </a>
2104 2105 </td><td>
2105 2106 Subrepositories
2106 2107 </td></tr>
2107 2108 <tr><td>
2108 2109 <a href="/help/templating">
2109 2110 templating
2110 2111 </a>
2111 2112 </td><td>
2112 2113 Template Usage
2113 2114 </td></tr>
2114 2115 <tr><td>
2115 2116 <a href="/help/urls">
2116 2117 urls
2117 2118 </a>
2118 2119 </td><td>
2119 2120 URL Paths
2120 2121 </td></tr>
2121 2122 <tr><td>
2122 2123 <a href="/help/topic-containing-verbose">
2123 2124 topic-containing-verbose
2124 2125 </a>
2125 2126 </td><td>
2126 2127 This is the topic to test omit indicating.
2127 2128 </td></tr>
2128 2129
2129 2130
2130 2131 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
2131 2132
2132 2133 <tr><td>
2133 2134 <a href="/help/add">
2134 2135 add
2135 2136 </a>
2136 2137 </td><td>
2137 2138 add the specified files on the next commit
2138 2139 </td></tr>
2139 2140 <tr><td>
2140 2141 <a href="/help/annotate">
2141 2142 annotate
2142 2143 </a>
2143 2144 </td><td>
2144 2145 show changeset information by line for each file
2145 2146 </td></tr>
2146 2147 <tr><td>
2147 2148 <a href="/help/clone">
2148 2149 clone
2149 2150 </a>
2150 2151 </td><td>
2151 2152 make a copy of an existing repository
2152 2153 </td></tr>
2153 2154 <tr><td>
2154 2155 <a href="/help/commit">
2155 2156 commit
2156 2157 </a>
2157 2158 </td><td>
2158 2159 commit the specified files or all outstanding changes
2159 2160 </td></tr>
2160 2161 <tr><td>
2161 2162 <a href="/help/diff">
2162 2163 diff
2163 2164 </a>
2164 2165 </td><td>
2165 2166 diff repository (or selected files)
2166 2167 </td></tr>
2167 2168 <tr><td>
2168 2169 <a href="/help/export">
2169 2170 export
2170 2171 </a>
2171 2172 </td><td>
2172 2173 dump the header and diffs for one or more changesets
2173 2174 </td></tr>
2174 2175 <tr><td>
2175 2176 <a href="/help/forget">
2176 2177 forget
2177 2178 </a>
2178 2179 </td><td>
2179 2180 forget the specified files on the next commit
2180 2181 </td></tr>
2181 2182 <tr><td>
2182 2183 <a href="/help/init">
2183 2184 init
2184 2185 </a>
2185 2186 </td><td>
2186 2187 create a new repository in the given directory
2187 2188 </td></tr>
2188 2189 <tr><td>
2189 2190 <a href="/help/log">
2190 2191 log
2191 2192 </a>
2192 2193 </td><td>
2193 2194 show revision history of entire repository or files
2194 2195 </td></tr>
2195 2196 <tr><td>
2196 2197 <a href="/help/merge">
2197 2198 merge
2198 2199 </a>
2199 2200 </td><td>
2200 2201 merge another revision into working directory
2201 2202 </td></tr>
2202 2203 <tr><td>
2203 2204 <a href="/help/pull">
2204 2205 pull
2205 2206 </a>
2206 2207 </td><td>
2207 2208 pull changes from the specified source
2208 2209 </td></tr>
2209 2210 <tr><td>
2210 2211 <a href="/help/push">
2211 2212 push
2212 2213 </a>
2213 2214 </td><td>
2214 2215 push changes to the specified destination
2215 2216 </td></tr>
2216 2217 <tr><td>
2217 2218 <a href="/help/remove">
2218 2219 remove
2219 2220 </a>
2220 2221 </td><td>
2221 2222 remove the specified files on the next commit
2222 2223 </td></tr>
2223 2224 <tr><td>
2224 2225 <a href="/help/serve">
2225 2226 serve
2226 2227 </a>
2227 2228 </td><td>
2228 2229 start stand-alone webserver
2229 2230 </td></tr>
2230 2231 <tr><td>
2231 2232 <a href="/help/status">
2232 2233 status
2233 2234 </a>
2234 2235 </td><td>
2235 2236 show changed files in the working directory
2236 2237 </td></tr>
2237 2238 <tr><td>
2238 2239 <a href="/help/summary">
2239 2240 summary
2240 2241 </a>
2241 2242 </td><td>
2242 2243 summarize working directory state
2243 2244 </td></tr>
2244 2245 <tr><td>
2245 2246 <a href="/help/update">
2246 2247 update
2247 2248 </a>
2248 2249 </td><td>
2249 2250 update working directory (or switch revisions)
2250 2251 </td></tr>
2251 2252
2252 2253
2253 2254
2254 2255 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
2255 2256
2256 2257 <tr><td>
2257 2258 <a href="/help/addremove">
2258 2259 addremove
2259 2260 </a>
2260 2261 </td><td>
2261 2262 add all new files, delete all missing files
2262 2263 </td></tr>
2263 2264 <tr><td>
2264 2265 <a href="/help/archive">
2265 2266 archive
2266 2267 </a>
2267 2268 </td><td>
2268 2269 create an unversioned archive of a repository revision
2269 2270 </td></tr>
2270 2271 <tr><td>
2271 2272 <a href="/help/backout">
2272 2273 backout
2273 2274 </a>
2274 2275 </td><td>
2275 2276 reverse effect of earlier changeset
2276 2277 </td></tr>
2277 2278 <tr><td>
2278 2279 <a href="/help/bisect">
2279 2280 bisect
2280 2281 </a>
2281 2282 </td><td>
2282 2283 subdivision search of changesets
2283 2284 </td></tr>
2284 2285 <tr><td>
2285 2286 <a href="/help/bookmarks">
2286 2287 bookmarks
2287 2288 </a>
2288 2289 </td><td>
2289 2290 create a new bookmark or list existing bookmarks
2290 2291 </td></tr>
2291 2292 <tr><td>
2292 2293 <a href="/help/branch">
2293 2294 branch
2294 2295 </a>
2295 2296 </td><td>
2296 2297 set or show the current branch name
2297 2298 </td></tr>
2298 2299 <tr><td>
2299 2300 <a href="/help/branches">
2300 2301 branches
2301 2302 </a>
2302 2303 </td><td>
2303 2304 list repository named branches
2304 2305 </td></tr>
2305 2306 <tr><td>
2306 2307 <a href="/help/bundle">
2307 2308 bundle
2308 2309 </a>
2309 2310 </td><td>
2310 2311 create a bundle file
2311 2312 </td></tr>
2312 2313 <tr><td>
2313 2314 <a href="/help/cat">
2314 2315 cat
2315 2316 </a>
2316 2317 </td><td>
2317 2318 output the current or given revision of files
2318 2319 </td></tr>
2319 2320 <tr><td>
2320 2321 <a href="/help/config">
2321 2322 config
2322 2323 </a>
2323 2324 </td><td>
2324 2325 show combined config settings from all hgrc files
2325 2326 </td></tr>
2326 2327 <tr><td>
2327 2328 <a href="/help/copy">
2328 2329 copy
2329 2330 </a>
2330 2331 </td><td>
2331 2332 mark files as copied for the next commit
2332 2333 </td></tr>
2333 2334 <tr><td>
2334 2335 <a href="/help/files">
2335 2336 files
2336 2337 </a>
2337 2338 </td><td>
2338 2339 list tracked files
2339 2340 </td></tr>
2340 2341 <tr><td>
2341 2342 <a href="/help/graft">
2342 2343 graft
2343 2344 </a>
2344 2345 </td><td>
2345 2346 copy changes from other branches onto the current branch
2346 2347 </td></tr>
2347 2348 <tr><td>
2348 2349 <a href="/help/grep">
2349 2350 grep
2350 2351 </a>
2351 2352 </td><td>
2352 2353 search revision history for a pattern in specified files
2353 2354 </td></tr>
2354 2355 <tr><td>
2355 2356 <a href="/help/heads">
2356 2357 heads
2357 2358 </a>
2358 2359 </td><td>
2359 2360 show branch heads
2360 2361 </td></tr>
2361 2362 <tr><td>
2362 2363 <a href="/help/help">
2363 2364 help
2364 2365 </a>
2365 2366 </td><td>
2366 2367 show help for a given topic or a help overview
2367 2368 </td></tr>
2368 2369 <tr><td>
2369 2370 <a href="/help/hgalias">
2370 2371 hgalias
2371 2372 </a>
2372 2373 </td><td>
2373 2374 summarize working directory state
2374 2375 </td></tr>
2375 2376 <tr><td>
2376 2377 <a href="/help/identify">
2377 2378 identify
2378 2379 </a>
2379 2380 </td><td>
2380 2381 identify the working directory or specified revision
2381 2382 </td></tr>
2382 2383 <tr><td>
2383 2384 <a href="/help/import">
2384 2385 import
2385 2386 </a>
2386 2387 </td><td>
2387 2388 import an ordered set of patches
2388 2389 </td></tr>
2389 2390 <tr><td>
2390 2391 <a href="/help/incoming">
2391 2392 incoming
2392 2393 </a>
2393 2394 </td><td>
2394 2395 show new changesets found in source
2395 2396 </td></tr>
2396 2397 <tr><td>
2397 2398 <a href="/help/manifest">
2398 2399 manifest
2399 2400 </a>
2400 2401 </td><td>
2401 2402 output the current or given revision of the project manifest
2402 2403 </td></tr>
2403 2404 <tr><td>
2404 2405 <a href="/help/nohelp">
2405 2406 nohelp
2406 2407 </a>
2407 2408 </td><td>
2408 2409 (no help text available)
2409 2410 </td></tr>
2410 2411 <tr><td>
2411 2412 <a href="/help/outgoing">
2412 2413 outgoing
2413 2414 </a>
2414 2415 </td><td>
2415 2416 show changesets not found in the destination
2416 2417 </td></tr>
2417 2418 <tr><td>
2418 2419 <a href="/help/paths">
2419 2420 paths
2420 2421 </a>
2421 2422 </td><td>
2422 2423 show aliases for remote repositories
2423 2424 </td></tr>
2424 2425 <tr><td>
2425 2426 <a href="/help/phase">
2426 2427 phase
2427 2428 </a>
2428 2429 </td><td>
2429 2430 set or show the current phase name
2430 2431 </td></tr>
2431 2432 <tr><td>
2432 2433 <a href="/help/recover">
2433 2434 recover
2434 2435 </a>
2435 2436 </td><td>
2436 2437 roll back an interrupted transaction
2437 2438 </td></tr>
2438 2439 <tr><td>
2439 2440 <a href="/help/rename">
2440 2441 rename
2441 2442 </a>
2442 2443 </td><td>
2443 2444 rename files; equivalent of copy + remove
2444 2445 </td></tr>
2445 2446 <tr><td>
2446 2447 <a href="/help/resolve">
2447 2448 resolve
2448 2449 </a>
2449 2450 </td><td>
2450 2451 redo merges or set/view the merge status of files
2451 2452 </td></tr>
2452 2453 <tr><td>
2453 2454 <a href="/help/revert">
2454 2455 revert
2455 2456 </a>
2456 2457 </td><td>
2457 2458 restore files to their checkout state
2458 2459 </td></tr>
2459 2460 <tr><td>
2460 2461 <a href="/help/root">
2461 2462 root
2462 2463 </a>
2463 2464 </td><td>
2464 2465 print the root (top) of the current working directory
2465 2466 </td></tr>
2466 2467 <tr><td>
2467 2468 <a href="/help/shellalias">
2468 2469 shellalias
2469 2470 </a>
2470 2471 </td><td>
2471 2472 (no help text available)
2472 2473 </td></tr>
2473 2474 <tr><td>
2474 2475 <a href="/help/tag">
2475 2476 tag
2476 2477 </a>
2477 2478 </td><td>
2478 2479 add one or more tags for the current or given revision
2479 2480 </td></tr>
2480 2481 <tr><td>
2481 2482 <a href="/help/tags">
2482 2483 tags
2483 2484 </a>
2484 2485 </td><td>
2485 2486 list repository tags
2486 2487 </td></tr>
2487 2488 <tr><td>
2488 2489 <a href="/help/unbundle">
2489 2490 unbundle
2490 2491 </a>
2491 2492 </td><td>
2492 2493 apply one or more bundle files
2493 2494 </td></tr>
2494 2495 <tr><td>
2495 2496 <a href="/help/verify">
2496 2497 verify
2497 2498 </a>
2498 2499 </td><td>
2499 2500 verify the integrity of the repository
2500 2501 </td></tr>
2501 2502 <tr><td>
2502 2503 <a href="/help/version">
2503 2504 version
2504 2505 </a>
2505 2506 </td><td>
2506 2507 output version and copyright information
2507 2508 </td></tr>
2508 2509
2509 2510
2510 2511 </table>
2511 2512 </div>
2512 2513 </div>
2513 2514
2514 2515
2515 2516
2516 2517 </body>
2517 2518 </html>
2518 2519
2519 2520
2520 2521 $ get-with-headers.py $LOCALIP:$HGPORT "help/add"
2521 2522 200 Script output follows
2522 2523
2523 2524 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2524 2525 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2525 2526 <head>
2526 2527 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2527 2528 <meta name="robots" content="index, nofollow" />
2528 2529 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2529 2530 <script type="text/javascript" src="/static/mercurial.js"></script>
2530 2531
2531 2532 <title>Help: add</title>
2532 2533 </head>
2533 2534 <body>
2534 2535
2535 2536 <div class="container">
2536 2537 <div class="menu">
2537 2538 <div class="logo">
2538 2539 <a href="https://mercurial-scm.org/">
2539 2540 <img src="/static/hglogo.png" alt="mercurial" /></a>
2540 2541 </div>
2541 2542 <ul>
2542 2543 <li><a href="/shortlog">log</a></li>
2543 2544 <li><a href="/graph">graph</a></li>
2544 2545 <li><a href="/tags">tags</a></li>
2545 2546 <li><a href="/bookmarks">bookmarks</a></li>
2546 2547 <li><a href="/branches">branches</a></li>
2547 2548 </ul>
2548 2549 <ul>
2549 2550 <li class="active"><a href="/help">help</a></li>
2550 2551 </ul>
2551 2552 </div>
2552 2553
2553 2554 <div class="main">
2554 2555 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2555 2556 <h3>Help: add</h3>
2556 2557
2557 2558 <form class="search" action="/log">
2558 2559
2559 2560 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2560 2561 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2561 2562 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2562 2563 </form>
2563 2564 <div id="doc">
2564 2565 <p>
2565 2566 hg add [OPTION]... [FILE]...
2566 2567 </p>
2567 2568 <p>
2568 2569 add the specified files on the next commit
2569 2570 </p>
2570 2571 <p>
2571 2572 Schedule files to be version controlled and added to the
2572 2573 repository.
2573 2574 </p>
2574 2575 <p>
2575 2576 The files will be added to the repository at the next commit. To
2576 2577 undo an add before that, see 'hg forget'.
2577 2578 </p>
2578 2579 <p>
2579 2580 If no names are given, add all files to the repository (except
2580 2581 files matching &quot;.hgignore&quot;).
2581 2582 </p>
2582 2583 <p>
2583 2584 Examples:
2584 2585 </p>
2585 2586 <ul>
2586 2587 <li> New (unknown) files are added automatically by 'hg add':
2587 2588 <pre>
2588 2589 \$ ls (re)
2589 2590 foo.c
2590 2591 \$ hg status (re)
2591 2592 ? foo.c
2592 2593 \$ hg add (re)
2593 2594 adding foo.c
2594 2595 \$ hg status (re)
2595 2596 A foo.c
2596 2597 </pre>
2597 2598 <li> Specific files to be added can be specified:
2598 2599 <pre>
2599 2600 \$ ls (re)
2600 2601 bar.c foo.c
2601 2602 \$ hg status (re)
2602 2603 ? bar.c
2603 2604 ? foo.c
2604 2605 \$ hg add bar.c (re)
2605 2606 \$ hg status (re)
2606 2607 A bar.c
2607 2608 ? foo.c
2608 2609 </pre>
2609 2610 </ul>
2610 2611 <p>
2611 2612 Returns 0 if all files are successfully added.
2612 2613 </p>
2613 2614 <p>
2614 2615 options ([+] can be repeated):
2615 2616 </p>
2616 2617 <table>
2617 2618 <tr><td>-I</td>
2618 2619 <td>--include PATTERN [+]</td>
2619 2620 <td>include names matching the given patterns</td></tr>
2620 2621 <tr><td>-X</td>
2621 2622 <td>--exclude PATTERN [+]</td>
2622 2623 <td>exclude names matching the given patterns</td></tr>
2623 2624 <tr><td>-S</td>
2624 2625 <td>--subrepos</td>
2625 2626 <td>recurse into subrepositories</td></tr>
2626 2627 <tr><td>-n</td>
2627 2628 <td>--dry-run</td>
2628 2629 <td>do not perform actions, just print output</td></tr>
2629 2630 </table>
2630 2631 <p>
2631 2632 global options ([+] can be repeated):
2632 2633 </p>
2633 2634 <table>
2634 2635 <tr><td>-R</td>
2635 2636 <td>--repository REPO</td>
2636 2637 <td>repository root directory or name of overlay bundle file</td></tr>
2637 2638 <tr><td></td>
2638 2639 <td>--cwd DIR</td>
2639 2640 <td>change working directory</td></tr>
2640 2641 <tr><td>-y</td>
2641 2642 <td>--noninteractive</td>
2642 2643 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2643 2644 <tr><td>-q</td>
2644 2645 <td>--quiet</td>
2645 2646 <td>suppress output</td></tr>
2646 2647 <tr><td>-v</td>
2647 2648 <td>--verbose</td>
2648 2649 <td>enable additional output</td></tr>
2649 2650 <tr><td></td>
2650 2651 <td>--color TYPE</td>
2651 2652 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2652 2653 <tr><td></td>
2653 2654 <td>--config CONFIG [+]</td>
2654 2655 <td>set/override config option (use 'section.name=value')</td></tr>
2655 2656 <tr><td></td>
2656 2657 <td>--debug</td>
2657 2658 <td>enable debugging output</td></tr>
2658 2659 <tr><td></td>
2659 2660 <td>--debugger</td>
2660 2661 <td>start debugger</td></tr>
2661 2662 <tr><td></td>
2662 2663 <td>--encoding ENCODE</td>
2663 2664 <td>set the charset encoding (default: ascii)</td></tr>
2664 2665 <tr><td></td>
2665 2666 <td>--encodingmode MODE</td>
2666 2667 <td>set the charset encoding mode (default: strict)</td></tr>
2667 2668 <tr><td></td>
2668 2669 <td>--traceback</td>
2669 2670 <td>always print a traceback on exception</td></tr>
2670 2671 <tr><td></td>
2671 2672 <td>--time</td>
2672 2673 <td>time how long the command takes</td></tr>
2673 2674 <tr><td></td>
2674 2675 <td>--profile</td>
2675 2676 <td>print command execution profile</td></tr>
2676 2677 <tr><td></td>
2677 2678 <td>--version</td>
2678 2679 <td>output version information and exit</td></tr>
2679 2680 <tr><td>-h</td>
2680 2681 <td>--help</td>
2681 2682 <td>display help and exit</td></tr>
2682 2683 <tr><td></td>
2683 2684 <td>--hidden</td>
2684 2685 <td>consider hidden changesets</td></tr>
2685 2686 <tr><td></td>
2686 2687 <td>--pager TYPE</td>
2687 2688 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2688 2689 </table>
2689 2690
2690 2691 </div>
2691 2692 </div>
2692 2693 </div>
2693 2694
2694 2695
2695 2696
2696 2697 </body>
2697 2698 </html>
2698 2699
2699 2700
2700 2701 $ get-with-headers.py $LOCALIP:$HGPORT "help/remove"
2701 2702 200 Script output follows
2702 2703
2703 2704 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2704 2705 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2705 2706 <head>
2706 2707 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2707 2708 <meta name="robots" content="index, nofollow" />
2708 2709 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2709 2710 <script type="text/javascript" src="/static/mercurial.js"></script>
2710 2711
2711 2712 <title>Help: remove</title>
2712 2713 </head>
2713 2714 <body>
2714 2715
2715 2716 <div class="container">
2716 2717 <div class="menu">
2717 2718 <div class="logo">
2718 2719 <a href="https://mercurial-scm.org/">
2719 2720 <img src="/static/hglogo.png" alt="mercurial" /></a>
2720 2721 </div>
2721 2722 <ul>
2722 2723 <li><a href="/shortlog">log</a></li>
2723 2724 <li><a href="/graph">graph</a></li>
2724 2725 <li><a href="/tags">tags</a></li>
2725 2726 <li><a href="/bookmarks">bookmarks</a></li>
2726 2727 <li><a href="/branches">branches</a></li>
2727 2728 </ul>
2728 2729 <ul>
2729 2730 <li class="active"><a href="/help">help</a></li>
2730 2731 </ul>
2731 2732 </div>
2732 2733
2733 2734 <div class="main">
2734 2735 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2735 2736 <h3>Help: remove</h3>
2736 2737
2737 2738 <form class="search" action="/log">
2738 2739
2739 2740 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2740 2741 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2741 2742 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2742 2743 </form>
2743 2744 <div id="doc">
2744 2745 <p>
2745 2746 hg remove [OPTION]... FILE...
2746 2747 </p>
2747 2748 <p>
2748 2749 aliases: rm
2749 2750 </p>
2750 2751 <p>
2751 2752 remove the specified files on the next commit
2752 2753 </p>
2753 2754 <p>
2754 2755 Schedule the indicated files for removal from the current branch.
2755 2756 </p>
2756 2757 <p>
2757 2758 This command schedules the files to be removed at the next commit.
2758 2759 To undo a remove before that, see 'hg revert'. To undo added
2759 2760 files, see 'hg forget'.
2760 2761 </p>
2761 2762 <p>
2762 2763 -A/--after can be used to remove only files that have already
2763 2764 been deleted, -f/--force can be used to force deletion, and -Af
2764 2765 can be used to remove files from the next revision without
2765 2766 deleting them from the working directory.
2766 2767 </p>
2767 2768 <p>
2768 2769 The following table details the behavior of remove for different
2769 2770 file states (columns) and option combinations (rows). The file
2770 2771 states are Added [A], Clean [C], Modified [M] and Missing [!]
2771 2772 (as reported by 'hg status'). The actions are Warn, Remove
2772 2773 (from branch) and Delete (from disk):
2773 2774 </p>
2774 2775 <table>
2775 2776 <tr><td>opt/state</td>
2776 2777 <td>A</td>
2777 2778 <td>C</td>
2778 2779 <td>M</td>
2779 2780 <td>!</td></tr>
2780 2781 <tr><td>none</td>
2781 2782 <td>W</td>
2782 2783 <td>RD</td>
2783 2784 <td>W</td>
2784 2785 <td>R</td></tr>
2785 2786 <tr><td>-f</td>
2786 2787 <td>R</td>
2787 2788 <td>RD</td>
2788 2789 <td>RD</td>
2789 2790 <td>R</td></tr>
2790 2791 <tr><td>-A</td>
2791 2792 <td>W</td>
2792 2793 <td>W</td>
2793 2794 <td>W</td>
2794 2795 <td>R</td></tr>
2795 2796 <tr><td>-Af</td>
2796 2797 <td>R</td>
2797 2798 <td>R</td>
2798 2799 <td>R</td>
2799 2800 <td>R</td></tr>
2800 2801 </table>
2801 2802 <p>
2802 2803 <b>Note:</b>
2803 2804 </p>
2804 2805 <p>
2805 2806 'hg remove' never deletes files in Added [A] state from the
2806 2807 working directory, not even if &quot;--force&quot; is specified.
2807 2808 </p>
2808 2809 <p>
2809 2810 Returns 0 on success, 1 if any warnings encountered.
2810 2811 </p>
2811 2812 <p>
2812 2813 options ([+] can be repeated):
2813 2814 </p>
2814 2815 <table>
2815 2816 <tr><td>-A</td>
2816 2817 <td>--after</td>
2817 2818 <td>record delete for missing files</td></tr>
2818 2819 <tr><td>-f</td>
2819 2820 <td>--force</td>
2820 2821 <td>forget added files, delete modified files</td></tr>
2821 2822 <tr><td>-S</td>
2822 2823 <td>--subrepos</td>
2823 2824 <td>recurse into subrepositories</td></tr>
2824 2825 <tr><td>-I</td>
2825 2826 <td>--include PATTERN [+]</td>
2826 2827 <td>include names matching the given patterns</td></tr>
2827 2828 <tr><td>-X</td>
2828 2829 <td>--exclude PATTERN [+]</td>
2829 2830 <td>exclude names matching the given patterns</td></tr>
2830 2831 </table>
2831 2832 <p>
2832 2833 global options ([+] can be repeated):
2833 2834 </p>
2834 2835 <table>
2835 2836 <tr><td>-R</td>
2836 2837 <td>--repository REPO</td>
2837 2838 <td>repository root directory or name of overlay bundle file</td></tr>
2838 2839 <tr><td></td>
2839 2840 <td>--cwd DIR</td>
2840 2841 <td>change working directory</td></tr>
2841 2842 <tr><td>-y</td>
2842 2843 <td>--noninteractive</td>
2843 2844 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2844 2845 <tr><td>-q</td>
2845 2846 <td>--quiet</td>
2846 2847 <td>suppress output</td></tr>
2847 2848 <tr><td>-v</td>
2848 2849 <td>--verbose</td>
2849 2850 <td>enable additional output</td></tr>
2850 2851 <tr><td></td>
2851 2852 <td>--color TYPE</td>
2852 2853 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2853 2854 <tr><td></td>
2854 2855 <td>--config CONFIG [+]</td>
2855 2856 <td>set/override config option (use 'section.name=value')</td></tr>
2856 2857 <tr><td></td>
2857 2858 <td>--debug</td>
2858 2859 <td>enable debugging output</td></tr>
2859 2860 <tr><td></td>
2860 2861 <td>--debugger</td>
2861 2862 <td>start debugger</td></tr>
2862 2863 <tr><td></td>
2863 2864 <td>--encoding ENCODE</td>
2864 2865 <td>set the charset encoding (default: ascii)</td></tr>
2865 2866 <tr><td></td>
2866 2867 <td>--encodingmode MODE</td>
2867 2868 <td>set the charset encoding mode (default: strict)</td></tr>
2868 2869 <tr><td></td>
2869 2870 <td>--traceback</td>
2870 2871 <td>always print a traceback on exception</td></tr>
2871 2872 <tr><td></td>
2872 2873 <td>--time</td>
2873 2874 <td>time how long the command takes</td></tr>
2874 2875 <tr><td></td>
2875 2876 <td>--profile</td>
2876 2877 <td>print command execution profile</td></tr>
2877 2878 <tr><td></td>
2878 2879 <td>--version</td>
2879 2880 <td>output version information and exit</td></tr>
2880 2881 <tr><td>-h</td>
2881 2882 <td>--help</td>
2882 2883 <td>display help and exit</td></tr>
2883 2884 <tr><td></td>
2884 2885 <td>--hidden</td>
2885 2886 <td>consider hidden changesets</td></tr>
2886 2887 <tr><td></td>
2887 2888 <td>--pager TYPE</td>
2888 2889 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2889 2890 </table>
2890 2891
2891 2892 </div>
2892 2893 </div>
2893 2894 </div>
2894 2895
2895 2896
2896 2897
2897 2898 </body>
2898 2899 </html>
2899 2900
2900 2901
2901 2902 $ get-with-headers.py $LOCALIP:$HGPORT "help/dates"
2902 2903 200 Script output follows
2903 2904
2904 2905 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2905 2906 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2906 2907 <head>
2907 2908 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2908 2909 <meta name="robots" content="index, nofollow" />
2909 2910 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2910 2911 <script type="text/javascript" src="/static/mercurial.js"></script>
2911 2912
2912 2913 <title>Help: dates</title>
2913 2914 </head>
2914 2915 <body>
2915 2916
2916 2917 <div class="container">
2917 2918 <div class="menu">
2918 2919 <div class="logo">
2919 2920 <a href="https://mercurial-scm.org/">
2920 2921 <img src="/static/hglogo.png" alt="mercurial" /></a>
2921 2922 </div>
2922 2923 <ul>
2923 2924 <li><a href="/shortlog">log</a></li>
2924 2925 <li><a href="/graph">graph</a></li>
2925 2926 <li><a href="/tags">tags</a></li>
2926 2927 <li><a href="/bookmarks">bookmarks</a></li>
2927 2928 <li><a href="/branches">branches</a></li>
2928 2929 </ul>
2929 2930 <ul>
2930 2931 <li class="active"><a href="/help">help</a></li>
2931 2932 </ul>
2932 2933 </div>
2933 2934
2934 2935 <div class="main">
2935 2936 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2936 2937 <h3>Help: dates</h3>
2937 2938
2938 2939 <form class="search" action="/log">
2939 2940
2940 2941 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2941 2942 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2942 2943 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2943 2944 </form>
2944 2945 <div id="doc">
2945 2946 <h1>Date Formats</h1>
2946 2947 <p>
2947 2948 Some commands allow the user to specify a date, e.g.:
2948 2949 </p>
2949 2950 <ul>
2950 2951 <li> backout, commit, import, tag: Specify the commit date.
2951 2952 <li> log, revert, update: Select revision(s) by date.
2952 2953 </ul>
2953 2954 <p>
2954 2955 Many date formats are valid. Here are some examples:
2955 2956 </p>
2956 2957 <ul>
2957 2958 <li> &quot;Wed Dec 6 13:18:29 2006&quot; (local timezone assumed)
2958 2959 <li> &quot;Dec 6 13:18 -0600&quot; (year assumed, time offset provided)
2959 2960 <li> &quot;Dec 6 13:18 UTC&quot; (UTC and GMT are aliases for +0000)
2960 2961 <li> &quot;Dec 6&quot; (midnight)
2961 2962 <li> &quot;13:18&quot; (today assumed)
2962 2963 <li> &quot;3:39&quot; (3:39AM assumed)
2963 2964 <li> &quot;3:39pm&quot; (15:39)
2964 2965 <li> &quot;2006-12-06 13:18:29&quot; (ISO 8601 format)
2965 2966 <li> &quot;2006-12-6 13:18&quot;
2966 2967 <li> &quot;2006-12-6&quot;
2967 2968 <li> &quot;12-6&quot;
2968 2969 <li> &quot;12/6&quot;
2969 2970 <li> &quot;12/6/6&quot; (Dec 6 2006)
2970 2971 <li> &quot;today&quot; (midnight)
2971 2972 <li> &quot;yesterday&quot; (midnight)
2972 2973 <li> &quot;now&quot; - right now
2973 2974 </ul>
2974 2975 <p>
2975 2976 Lastly, there is Mercurial's internal format:
2976 2977 </p>
2977 2978 <ul>
2978 2979 <li> &quot;1165411109 0&quot; (Wed Dec 6 13:18:29 2006 UTC)
2979 2980 </ul>
2980 2981 <p>
2981 2982 This is the internal representation format for dates. The first number
2982 2983 is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
2983 2984 second is the offset of the local timezone, in seconds west of UTC
2984 2985 (negative if the timezone is east of UTC).
2985 2986 </p>
2986 2987 <p>
2987 2988 The log command also accepts date ranges:
2988 2989 </p>
2989 2990 <ul>
2990 2991 <li> &quot;&lt;DATE&quot; - at or before a given date/time
2991 2992 <li> &quot;&gt;DATE&quot; - on or after a given date/time
2992 2993 <li> &quot;DATE to DATE&quot; - a date range, inclusive
2993 2994 <li> &quot;-DAYS&quot; - within a given number of days of today
2994 2995 </ul>
2995 2996
2996 2997 </div>
2997 2998 </div>
2998 2999 </div>
2999 3000
3000 3001
3001 3002
3002 3003 </body>
3003 3004 </html>
3004 3005
3005 3006
3006 3007 Sub-topic indexes rendered properly
3007 3008
3008 3009 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals"
3009 3010 200 Script output follows
3010 3011
3011 3012 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3012 3013 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3013 3014 <head>
3014 3015 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3015 3016 <meta name="robots" content="index, nofollow" />
3016 3017 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3017 3018 <script type="text/javascript" src="/static/mercurial.js"></script>
3018 3019
3019 3020 <title>Help: internals</title>
3020 3021 </head>
3021 3022 <body>
3022 3023
3023 3024 <div class="container">
3024 3025 <div class="menu">
3025 3026 <div class="logo">
3026 3027 <a href="https://mercurial-scm.org/">
3027 3028 <img src="/static/hglogo.png" alt="mercurial" /></a>
3028 3029 </div>
3029 3030 <ul>
3030 3031 <li><a href="/shortlog">log</a></li>
3031 3032 <li><a href="/graph">graph</a></li>
3032 3033 <li><a href="/tags">tags</a></li>
3033 3034 <li><a href="/bookmarks">bookmarks</a></li>
3034 3035 <li><a href="/branches">branches</a></li>
3035 3036 </ul>
3036 3037 <ul>
3037 3038 <li><a href="/help">help</a></li>
3038 3039 </ul>
3039 3040 </div>
3040 3041
3041 3042 <div class="main">
3042 3043 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3043 3044
3044 3045 <form class="search" action="/log">
3045 3046
3046 3047 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3047 3048 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3048 3049 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3049 3050 </form>
3050 3051 <table class="bigtable">
3051 3052 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
3052 3053
3053 3054 <tr><td>
3054 3055 <a href="/help/internals.bundles">
3055 3056 bundles
3056 3057 </a>
3057 3058 </td><td>
3058 3059 Bundles
3059 3060 </td></tr>
3060 3061 <tr><td>
3061 3062 <a href="/help/internals.censor">
3062 3063 censor
3063 3064 </a>
3064 3065 </td><td>
3065 3066 Censor
3066 3067 </td></tr>
3067 3068 <tr><td>
3068 3069 <a href="/help/internals.changegroups">
3069 3070 changegroups
3070 3071 </a>
3071 3072 </td><td>
3072 3073 Changegroups
3073 3074 </td></tr>
3074 3075 <tr><td>
3075 3076 <a href="/help/internals.config">
3076 3077 config
3077 3078 </a>
3078 3079 </td><td>
3079 3080 Config Registrar
3080 3081 </td></tr>
3081 3082 <tr><td>
3082 3083 <a href="/help/internals.requirements">
3083 3084 requirements
3084 3085 </a>
3085 3086 </td><td>
3086 3087 Repository Requirements
3087 3088 </td></tr>
3088 3089 <tr><td>
3089 3090 <a href="/help/internals.revlogs">
3090 3091 revlogs
3091 3092 </a>
3092 3093 </td><td>
3093 3094 Revision Logs
3094 3095 </td></tr>
3095 3096 <tr><td>
3096 3097 <a href="/help/internals.wireprotocol">
3097 3098 wireprotocol
3098 3099 </a>
3099 3100 </td><td>
3100 3101 Wire Protocol
3101 3102 </td></tr>
3102 3103
3103 3104
3104 3105
3105 3106
3106 3107
3107 3108 </table>
3108 3109 </div>
3109 3110 </div>
3110 3111
3111 3112
3112 3113
3113 3114 </body>
3114 3115 </html>
3115 3116
3116 3117
3117 3118 Sub-topic topics rendered properly
3118 3119
3119 3120 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals.changegroups"
3120 3121 200 Script output follows
3121 3122
3122 3123 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3123 3124 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3124 3125 <head>
3125 3126 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3126 3127 <meta name="robots" content="index, nofollow" />
3127 3128 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3128 3129 <script type="text/javascript" src="/static/mercurial.js"></script>
3129 3130
3130 3131 <title>Help: internals.changegroups</title>
3131 3132 </head>
3132 3133 <body>
3133 3134
3134 3135 <div class="container">
3135 3136 <div class="menu">
3136 3137 <div class="logo">
3137 3138 <a href="https://mercurial-scm.org/">
3138 3139 <img src="/static/hglogo.png" alt="mercurial" /></a>
3139 3140 </div>
3140 3141 <ul>
3141 3142 <li><a href="/shortlog">log</a></li>
3142 3143 <li><a href="/graph">graph</a></li>
3143 3144 <li><a href="/tags">tags</a></li>
3144 3145 <li><a href="/bookmarks">bookmarks</a></li>
3145 3146 <li><a href="/branches">branches</a></li>
3146 3147 </ul>
3147 3148 <ul>
3148 3149 <li class="active"><a href="/help">help</a></li>
3149 3150 </ul>
3150 3151 </div>
3151 3152
3152 3153 <div class="main">
3153 3154 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3154 3155 <h3>Help: internals.changegroups</h3>
3155 3156
3156 3157 <form class="search" action="/log">
3157 3158
3158 3159 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3159 3160 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3160 3161 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3161 3162 </form>
3162 3163 <div id="doc">
3163 3164 <h1>Changegroups</h1>
3164 3165 <p>
3165 3166 Changegroups are representations of repository revlog data, specifically
3166 3167 the changelog data, root/flat manifest data, treemanifest data, and
3167 3168 filelogs.
3168 3169 </p>
3169 3170 <p>
3170 3171 There are 3 versions of changegroups: &quot;1&quot;, &quot;2&quot;, and &quot;3&quot;. From a
3171 3172 high-level, versions &quot;1&quot; and &quot;2&quot; are almost exactly the same, with the
3172 3173 only difference being an additional item in the *delta header*. Version
3173 3174 &quot;3&quot; adds support for revlog flags in the *delta header* and optionally
3174 3175 exchanging treemanifests (enabled by setting an option on the
3175 3176 &quot;changegroup&quot; part in the bundle2).
3176 3177 </p>
3177 3178 <p>
3178 3179 Changegroups when not exchanging treemanifests consist of 3 logical
3179 3180 segments:
3180 3181 </p>
3181 3182 <pre>
3182 3183 +---------------------------------+
3183 3184 | | | |
3184 3185 | changeset | manifest | filelogs |
3185 3186 | | | |
3186 3187 | | | |
3187 3188 +---------------------------------+
3188 3189 </pre>
3189 3190 <p>
3190 3191 When exchanging treemanifests, there are 4 logical segments:
3191 3192 </p>
3192 3193 <pre>
3193 3194 +-------------------------------------------------+
3194 3195 | | | | |
3195 3196 | changeset | root | treemanifests | filelogs |
3196 3197 | | manifest | | |
3197 3198 | | | | |
3198 3199 +-------------------------------------------------+
3199 3200 </pre>
3200 3201 <p>
3201 3202 The principle building block of each segment is a *chunk*. A *chunk*
3202 3203 is a framed piece of data:
3203 3204 </p>
3204 3205 <pre>
3205 3206 +---------------------------------------+
3206 3207 | | |
3207 3208 | length | data |
3208 3209 | (4 bytes) | (&lt;length - 4&gt; bytes) |
3209 3210 | | |
3210 3211 +---------------------------------------+
3211 3212 </pre>
3212 3213 <p>
3213 3214 All integers are big-endian signed integers. Each chunk starts with a 32-bit
3214 3215 integer indicating the length of the entire chunk (including the length field
3215 3216 itself).
3216 3217 </p>
3217 3218 <p>
3218 3219 There is a special case chunk that has a value of 0 for the length
3219 3220 (&quot;0x00000000&quot;). We call this an *empty chunk*.
3220 3221 </p>
3221 3222 <h2>Delta Groups</h2>
3222 3223 <p>
3223 3224 A *delta group* expresses the content of a revlog as a series of deltas,
3224 3225 or patches against previous revisions.
3225 3226 </p>
3226 3227 <p>
3227 3228 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
3228 3229 to signal the end of the delta group:
3229 3230 </p>
3230 3231 <pre>
3231 3232 +------------------------------------------------------------------------+
3232 3233 | | | | | |
3233 3234 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
3234 3235 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
3235 3236 | | | | | |
3236 3237 +------------------------------------------------------------------------+
3237 3238 </pre>
3238 3239 <p>
3239 3240 Each *chunk*'s data consists of the following:
3240 3241 </p>
3241 3242 <pre>
3242 3243 +---------------------------------------+
3243 3244 | | |
3244 3245 | delta header | delta data |
3245 3246 | (various by version) | (various) |
3246 3247 | | |
3247 3248 +---------------------------------------+
3248 3249 </pre>
3249 3250 <p>
3250 3251 The *delta data* is a series of *delta*s that describe a diff from an existing
3251 3252 entry (either that the recipient already has, or previously specified in the
3252 3253 bundle/changegroup).
3253 3254 </p>
3254 3255 <p>
3255 3256 The *delta header* is different between versions &quot;1&quot;, &quot;2&quot;, and
3256 3257 &quot;3&quot; of the changegroup format.
3257 3258 </p>
3258 3259 <p>
3259 3260 Version 1 (headerlen=80):
3260 3261 </p>
3261 3262 <pre>
3262 3263 +------------------------------------------------------+
3263 3264 | | | | |
3264 3265 | node | p1 node | p2 node | link node |
3265 3266 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3266 3267 | | | | |
3267 3268 +------------------------------------------------------+
3268 3269 </pre>
3269 3270 <p>
3270 3271 Version 2 (headerlen=100):
3271 3272 </p>
3272 3273 <pre>
3273 3274 +------------------------------------------------------------------+
3274 3275 | | | | | |
3275 3276 | node | p1 node | p2 node | base node | link node |
3276 3277 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3277 3278 | | | | | |
3278 3279 +------------------------------------------------------------------+
3279 3280 </pre>
3280 3281 <p>
3281 3282 Version 3 (headerlen=102):
3282 3283 </p>
3283 3284 <pre>
3284 3285 +------------------------------------------------------------------------------+
3285 3286 | | | | | | |
3286 3287 | node | p1 node | p2 node | base node | link node | flags |
3287 3288 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
3288 3289 | | | | | | |
3289 3290 +------------------------------------------------------------------------------+
3290 3291 </pre>
3291 3292 <p>
3292 3293 The *delta data* consists of &quot;chunklen - 4 - headerlen&quot; bytes, which contain a
3293 3294 series of *delta*s, densely packed (no separators). These deltas describe a diff
3294 3295 from an existing entry (either that the recipient already has, or previously
3295 3296 specified in the bundle/changegroup). The format is described more fully in
3296 3297 &quot;hg help internals.bdiff&quot;, but briefly:
3297 3298 </p>
3298 3299 <pre>
3299 3300 +---------------------------------------------------------------+
3300 3301 | | | | |
3301 3302 | start offset | end offset | new length | content |
3302 3303 | (4 bytes) | (4 bytes) | (4 bytes) | (&lt;new length&gt; bytes) |
3303 3304 | | | | |
3304 3305 +---------------------------------------------------------------+
3305 3306 </pre>
3306 3307 <p>
3307 3308 Please note that the length field in the delta data does *not* include itself.
3308 3309 </p>
3309 3310 <p>
3310 3311 In version 1, the delta is always applied against the previous node from
3311 3312 the changegroup or the first parent if this is the first entry in the
3312 3313 changegroup.
3313 3314 </p>
3314 3315 <p>
3315 3316 In version 2 and up, the delta base node is encoded in the entry in the
3316 3317 changegroup. This allows the delta to be expressed against any parent,
3317 3318 which can result in smaller deltas and more efficient encoding of data.
3318 3319 </p>
3319 3320 <h2>Changeset Segment</h2>
3320 3321 <p>
3321 3322 The *changeset segment* consists of a single *delta group* holding
3322 3323 changelog data. The *empty chunk* at the end of the *delta group* denotes
3323 3324 the boundary to the *manifest segment*.
3324 3325 </p>
3325 3326 <h2>Manifest Segment</h2>
3326 3327 <p>
3327 3328 The *manifest segment* consists of a single *delta group* holding manifest
3328 3329 data. If treemanifests are in use, it contains only the manifest for the
3329 3330 root directory of the repository. Otherwise, it contains the entire
3330 3331 manifest data. The *empty chunk* at the end of the *delta group* denotes
3331 3332 the boundary to the next segment (either the *treemanifests segment* or the
3332 3333 *filelogs segment*, depending on version and the request options).
3333 3334 </p>
3334 3335 <h3>Treemanifests Segment</h3>
3335 3336 <p>
3336 3337 The *treemanifests segment* only exists in changegroup version &quot;3&quot;, and
3337 3338 only if the 'treemanifest' param is part of the bundle2 changegroup part
3338 3339 (it is not possible to use changegroup version 3 outside of bundle2).
3339 3340 Aside from the filenames in the *treemanifests segment* containing a
3340 3341 trailing &quot;/&quot; character, it behaves identically to the *filelogs segment*
3341 3342 (see below). The final sub-segment is followed by an *empty chunk* (logically,
3342 3343 a sub-segment with filename size 0). This denotes the boundary to the
3343 3344 *filelogs segment*.
3344 3345 </p>
3345 3346 <h2>Filelogs Segment</h2>
3346 3347 <p>
3347 3348 The *filelogs segment* consists of multiple sub-segments, each
3348 3349 corresponding to an individual file whose data is being described:
3349 3350 </p>
3350 3351 <pre>
3351 3352 +--------------------------------------------------+
3352 3353 | | | | | |
3353 3354 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
3354 3355 | | | | | (4 bytes) |
3355 3356 | | | | | |
3356 3357 +--------------------------------------------------+
3357 3358 </pre>
3358 3359 <p>
3359 3360 The final filelog sub-segment is followed by an *empty chunk* (logically,
3360 3361 a sub-segment with filename size 0). This denotes the end of the segment
3361 3362 and of the overall changegroup.
3362 3363 </p>
3363 3364 <p>
3364 3365 Each filelog sub-segment consists of the following:
3365 3366 </p>
3366 3367 <pre>
3367 3368 +------------------------------------------------------+
3368 3369 | | | |
3369 3370 | filename length | filename | delta group |
3370 3371 | (4 bytes) | (&lt;length - 4&gt; bytes) | (various) |
3371 3372 | | | |
3372 3373 +------------------------------------------------------+
3373 3374 </pre>
3374 3375 <p>
3375 3376 That is, a *chunk* consisting of the filename (not terminated or padded)
3376 3377 followed by N chunks constituting the *delta group* for this file. The
3377 3378 *empty chunk* at the end of each *delta group* denotes the boundary to the
3378 3379 next filelog sub-segment.
3379 3380 </p>
3380 3381
3381 3382 </div>
3382 3383 </div>
3383 3384 </div>
3384 3385
3385 3386
3386 3387
3387 3388 </body>
3388 3389 </html>
3389 3390
3390 3391
3391 3392 $ killdaemons.py
3392 3393
3393 3394 #endif
General Comments 0
You need to be logged in to leave comments. Login now