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