1HG(1) Mercurial Manual HG(1)
2
3
4
6 hg - Mercurial source code management system
7
9 hg command [option]... [argument]...
10
12 The hg command provides a command line interface to the Mercurial sys‐
13 tem.
14
16 files...
17 indicates one or more filename or relative path filenames; see
18 File Name Patterns for information on pattern matching
19
20 path indicates a path on the local machine
21
22 revision
23 indicates a changeset which can be specified as a changeset
24 revision number, a tag, or a unique substring of the changeset
25 hash value
26
27 repository path
28 either the pathname of a local repository or the URI of a remote
29 repository.
30
32 -R, --repository
33 repository root directory or name of overlay bundle file
34
35 --cwd change working directory
36
37 -y, --noninteractive
38 do not prompt, automatically pick the first choice for all
39 prompts
40
41 -q, --quiet
42 suppress output
43
44 -v, --verbose
45 enable additional output
46
47 --config
48 set/override config option (use 'section.name=value')
49
50 --debug
51 enable debugging output
52
53 --debugger
54 start debugger
55
56 --encoding
57 set the charset encoding (default: ascii)
58
59 --encodingmode
60 set the charset encoding mode (default: strict)
61
62 --traceback
63 always print a traceback on exception
64
65 --time time how long the command takes
66
67 --profile
68 print command execution profile
69
70 --version
71 output version information and exit
72
73 -h, --help
74 display help and exit
75
76 --hidden
77 consider hidden changesets
78
80 add
81 hg add [OPTION]... [FILE]...
82
83 Schedule files to be version controlled and added to the repository.
84
85 The files will be added to the repository at the next commit. To undo
86 an add before that, see hg forget.
87
88 If no names are given, add all files to the repository.
89
90 An example showing how new (unknown) files are added automatically by
91 hg add:
92
93 $ ls
94 foo.c
95 $ hg status
96 ? foo.c
97 $ hg add
98 adding foo.c
99 $ hg status
100 A foo.c
101
102 Returns 0 if all files are successfully added.
103
104 Options:
105
106 -I, --include
107 include names matching the given patterns
108
109 -X, --exclude
110 exclude names matching the given patterns
111
112 -S, --subrepos
113 recurse into subrepositories
114
115 -n, --dry-run
116 do not perform actions, just print output
117
118 addremove
119 hg addremove [OPTION]... [FILE]...
120
121 Add all new files and remove all missing files from the repository.
122
123 New files are ignored if they match any of the patterns in .hgignore.
124 As with add, these changes take effect at the next commit.
125
126 Use the -s/--similarity option to detect renamed files. This option
127 takes a percentage between 0 (disabled) and 100 (files must be identi‐
128 cal) as its parameter. With a parameter greater than 0, this compares
129 every removed file with every added file and records those similar
130 enough as renames. Detecting renamed files this way can be expensive.
131 After using this option, hg status -C can be used to check which files
132 were identified as moved or renamed. If not specified, -s/--similarity
133 defaults to 100 and only renames of identical files are detected.
134
135 Returns 0 if all files are successfully added.
136
137 Options:
138
139 -s, --similarity
140 guess renamed files by similarity (0<=s<=100)
141
142 -I, --include
143 include names matching the given patterns
144
145 -X, --exclude
146 exclude names matching the given patterns
147
148 -n, --dry-run
149 do not perform actions, just print output
150
151 annotate
152 hg annotate [-r REV] [-f] [-a] [-u] [-d] [-n] [-c] [-l] FILE...
153
154 List changes in files, showing the revision id responsible for each
155 line
156
157 This command is useful for discovering when a change was made and by
158 whom.
159
160 Without the -a/--text option, annotate will avoid processing files it
161 detects as binary. With -a, annotate will annotate the file anyway,
162 although the results will probably be neither useful nor desirable.
163
164 Returns 0 on success.
165
166 Options:
167
168 -r, --rev
169 annotate the specified revision
170
171 --follow
172 follow copies/renames and list the filename (DEPRECATED)
173
174 --no-follow
175 don't follow copies and renames
176
177 -a, --text
178 treat all files as text
179
180 -u, --user
181 list the author (long with -v)
182
183 -f, --file
184 list the filename
185
186 -d, --date
187 list the date (short with -q)
188
189 -n, --number
190 list the revision number (default)
191
192 -c, --changeset
193 list the changeset
194
195 -l, --line-number
196 show line number at the first appearance
197
198 -w, --ignore-all-space
199 ignore white space when comparing lines
200
201 -b, --ignore-space-change
202 ignore changes in the amount of white space
203
204 -B, --ignore-blank-lines
205 ignore changes whose lines are all blank
206
207 -I, --include
208 include names matching the given patterns
209
210 -X, --exclude
211 exclude names matching the given patterns
212
213 aliases: blame
214
215 archive
216 hg archive [OPTION]... DEST
217
218 By default, the revision used is the parent of the working directory;
219 use -r/--rev to specify a different revision.
220
221 The archive type is automatically detected based on file extension (or
222 override using -t/--type).
223
224 Examples:
225
226 · create a zip file containing the 1.0 release:
227
228 hg archive -r 1.0 project-1.0.zip
229
230 · create a tarball excluding .hg files:
231
232 hg archive project.tar.gz -X ".hg*"
233
234 Valid types are:
235
236 files
237
238 a directory full of files (default)
239
240 tar
241
242 tar archive, uncompressed
243
244 tbz2
245
246 tar archive, compressed using bzip2
247
248 tgz
249
250 tar archive, compressed using gzip
251
252 uzip
253
254 zip archive, uncompressed
255
256 zip
257
258 zip archive, compressed using deflate
259
260 The exact name of the destination archive or directory is given using a
261 format string; see hg help export for details.
262
263 Each member added to an archive file has a directory prefix prepended.
264 Use -p/--prefix to specify a format string for the prefix. The default
265 is the basename of the archive, with suffixes removed.
266
267 Returns 0 on success.
268
269 Options:
270
271 --no-decode
272 do not pass files through decoders
273
274 -p, --prefix
275 directory prefix for files in archive
276
277 -r, --rev
278 revision to distribute
279
280 -t, --type
281 type of distribution to create
282
283 -S, --subrepos
284 recurse into subrepositories
285
286 -I, --include
287 include names matching the given patterns
288
289 -X, --exclude
290 exclude names matching the given patterns
291
292 backout
293 hg backout [OPTION]... [-r] REV
294
295 Prepare a new changeset with the effect of REV undone in the current
296 working directory.
297
298 If REV is the parent of the working directory, then this new changeset
299 is committed automatically. Otherwise, hg needs to merge the changes
300 and the merged result is left uncommitted.
301
302 Note backout cannot be used to fix either an unwanted or incorrect
303 merge.
304
305 By default, the pending changeset will have one parent, maintaining a
306 linear history. With --merge, the pending changeset will instead have
307 two parents: the old parent of the working directory and a new child of
308 REV that simply undoes REV.
309
310 Before version 1.7, the behavior without --merge was equivalent to
311 specifying --merge followed by hg update --clean . to cancel the merge
312 and leave the child of REV as a head to be merged separately.
313
314 See hg help dates for a list of formats valid for -d/--date.
315
316 Returns 0 on success.
317
318 Options:
319
320 --merge
321 merge with old dirstate parent after backout
322
323 --parent
324 parent to choose when backing out merge (DEPRECATED)
325
326 -r, --rev
327 revision to backout
328
329 -t, --tool
330 specify merge tool
331
332 -I, --include
333 include names matching the given patterns
334
335 -X, --exclude
336 exclude names matching the given patterns
337
338 -m, --message
339 use text as commit message
340
341 -l, --logfile
342 read commit message from file
343
344 -d, --date
345 record the specified date as commit date
346
347 -u, --user
348 record the specified user as committer
349
350 bisect
351 hg bisect [-gbsr] [-U] [-c CMD] [REV]
352
353 This command helps to find changesets which introduce problems. To use,
354 mark the earliest changeset you know exhibits the problem as bad, then
355 mark the latest changeset which is free from the problem as good.
356 Bisect will update your working directory to a revision for testing
357 (unless the -U/--noupdate option is specified). Once you have performed
358 tests, mark the working directory as good or bad, and bisect will
359 either update to another candidate changeset or announce that it has
360 found the bad revision.
361
362 As a shortcut, you can also use the revision argument to mark a revi‐
363 sion as good or bad without checking it out first.
364
365 If you supply a command, it will be used for automatic bisection. The
366 environment variable HG_NODE will contain the ID of the changeset being
367 tested. The exit status of the command will be used to mark revisions
368 as good or bad: status 0 means good, 125 means to skip the revision,
369 127 (command not found) will abort the bisection, and any other
370 non-zero exit status means the revision is bad.
371
372 Some examples:
373
374 · start a bisection with known bad revision 12, and good revision 34:
375
376 hg bisect --bad 34
377 hg bisect --good 12
378
379 · advance the current bisection by marking current revision as good or
380 bad:
381
382 hg bisect --good
383 hg bisect --bad
384
385 · mark the current revision, or a known revision, to be skipped (e.g.
386 if that revision is not usable because of another issue):
387
388 hg bisect --skip
389 hg bisect --skip 23
390
391 · skip all revisions that do not touch directories foo or bar
392
393 hg bisect --skip '!( file("path:foo") & file("path:bar") )'
394
395 · forget the current bisection:
396
397 hg bisect --reset
398
399 · use 'make && make tests' to automatically find the first broken revi‐
400 sion:
401
402 hg bisect --reset
403 hg bisect --bad 34
404 hg bisect --good 12
405 hg bisect --command 'make && make tests'
406
407 · see all changesets whose states are already known in the current
408 bisection:
409
410 hg log -r "bisect(pruned)"
411
412 · see the changeset currently being bisected (especially useful if run‐
413 ning with -U/--noupdate):
414
415 hg log -r "bisect(current)"
416
417 · see all changesets that took part in the current bisection:
418
419 hg log -r "bisect(range)"
420
421 · with the graphlog extension, you can even get a nice graph:
422
423 hg log --graph -r "bisect(range)"
424
425 See hg help revsets for more about the bisect() keyword.
426
427 Returns 0 on success.
428
429 Options:
430
431 -r, --reset
432 reset bisect state
433
434 -g, --good
435 mark changeset good
436
437 -b, --bad
438 mark changeset bad
439
440 -s, --skip
441 skip testing changeset
442
443 -e, --extend
444 extend the bisect range
445
446 -c, --command
447 use command to check changeset state
448
449 -U, --noupdate
450 do not update to target
451
452 bookmarks
453 hg bookmarks [-f] [-d] [-i] [-m NAME] [-r REV] [NAME]
454
455 Bookmarks are pointers to certain commits that move when committing.
456 Bookmarks are local. They can be renamed, copied and deleted. It is
457 possible to use hg merge NAME to merge from a given bookmark, and hg
458 update NAME to update to a given bookmark.
459
460 You can use hg bookmark NAME to set a bookmark on the working direc‐
461 tory's parent revision with the given name. If you specify a revision
462 using -r REV (where REV may be an existing bookmark), the bookmark is
463 assigned to that revision.
464
465 Bookmarks can be pushed and pulled between repositories (see hg help
466 push and hg help pull). This requires both the local and remote reposi‐
467 tories to support bookmarks. For versions prior to 1.8, this means the
468 bookmarks extension must be enabled.
469
470 If you set a bookmark called '@', new clones of the repository will
471 have that revision checked out (and the bookmark made active) by
472 default.
473
474 With -i/--inactive, the new bookmark will not be made the active book‐
475 mark. If -r/--rev is given, the new bookmark will not be made active
476 even if -i/--inactive is not given. If no NAME is given, the current
477 active bookmark will be marked inactive.
478
479 Options:
480
481 -f, --force
482 force
483
484 -r, --rev
485 revision
486
487 -d, --delete
488 delete a given bookmark
489
490 -m, --rename
491 rename a given bookmark
492
493 -i, --inactive
494 mark a bookmark inactive
495
496 aliases: bookmark
497
498 branch
499 hg branch [-fC] [NAME]
500
501 Note Branch names are permanent and global. Use hg bookmark to create
502 a light-weight bookmark instead. See hg help glossary for more
503 information about named branches and bookmarks.
504
505 With no argument, show the current branch name. With one argument, set
506 the working directory branch name (the branch will not exist in the
507 repository until the next commit). Standard practice recommends that
508 primary development take place on the 'default' branch.
509
510 Unless -f/--force is specified, branch will not let you set a branch
511 name that already exists, even if it's inactive.
512
513 Use -C/--clean to reset the working directory branch to that of the
514 parent of the working directory, negating a previous branch change.
515
516 Use the command hg update to switch to an existing branch. Use hg com‐
517 mit --close-branch to mark this branch as closed.
518
519 Returns 0 on success.
520
521 Options:
522
523 -f, --force
524 set branch name even if it shadows an existing branch
525
526 -C, --clean
527 reset branch name to parent branch name
528
529 branches
530 hg branches [-ac]
531
532 List the repository's named branches, indicating which ones are inac‐
533 tive. If -c/--closed is specified, also list branches which have been
534 marked closed (see hg commit --close-branch).
535
536 If -a/--active is specified, only show active branches. A branch is
537 considered active if it contains repository heads.
538
539 Use the command hg update to switch to an existing branch.
540
541 Returns 0.
542
543 Options:
544
545 -a, --active
546 show only branches that have unmerged heads
547
548 -c, --closed
549 show normal and closed branches
550
551 bundle
552 hg bundle [-f] [-t TYPE] [-a] [-r REV]... [--base REV]... FILE [DEST]
553
554 Generate a compressed changegroup file collecting changesets not known
555 to be in another repository.
556
557 If you omit the destination repository, then hg assumes the destination
558 will have all the nodes you specify with --base parameters. To create a
559 bundle containing all changesets, use -a/--all (or --base null).
560
561 You can change compression method with the -t/--type option. The
562 available compression methods are: none, bzip2, and gzip (by default,
563 bundles are compressed using bzip2).
564
565 The bundle file can then be transferred using conventional means and
566 applied to another repository with the unbundle or pull command. This
567 is useful when direct push and pull are not available or when exporting
568 an entire repository is undesirable.
569
570 Applying bundles preserves all changeset contents including permis‐
571 sions, copy/rename information, and revision history.
572
573 Returns 0 on success, 1 if no changes found.
574
575 Options:
576
577 -f, --force
578 run even when the destination is unrelated
579
580 -r, --rev
581 a changeset intended to be added to the destination
582
583 -b, --branch
584 a specific branch you would like to bundle
585
586 --base a base changeset assumed to be available at the destination
587
588 -a, --all
589 bundle all changesets in the repository
590
591 -t, --type
592 bundle compression type to use (default: bzip2)
593
594 -e, --ssh
595 specify ssh command to use
596
597 --remotecmd
598 specify hg command to run on the remote side
599
600 --insecure
601 do not verify server certificate (ignoring web.cacerts config)
602
603 cat
604 hg cat [OPTION]... FILE...
605
606 Print the specified files as they were at the given revision. If no
607 revision is given, the parent of the working directory is used, or tip
608 if no revision is checked out.
609
610 Output may be to a file, in which case the name of the file is given
611 using a format string. The formatting rules are the same as for the
612 export command, with the following additions:
613
614 %s
615
616 basename of file being printed
617
618 %d
619
620 dirname of file being printed, or '.' if in repository root
621
622 %p
623
624 root-relative path name of file being printed
625
626 Returns 0 on success.
627
628 Options:
629
630 -o, --output
631 print output to file with formatted name
632
633 -r, --rev
634 print the given revision
635
636 --decode
637 apply any matching decode filter
638
639 -I, --include
640 include names matching the given patterns
641
642 -X, --exclude
643 exclude names matching the given patterns
644
645 clone
646 hg clone [OPTION]... SOURCE [DEST]
647
648 Create a copy of an existing repository in a new directory.
649
650 If no destination directory name is specified, it defaults to the base‐
651 name of the source.
652
653 The location of the source is added to the new repository's .hg/hgrc
654 file, as the default to be used for future pulls.
655
656 Only local paths and ssh:// URLs are supported as destinations. For
657 ssh:// destinations, no working directory or .hg/hgrc will be created
658 on the remote side.
659
660 To pull only a subset of changesets, specify one or more revisions
661 identifiers with -r/--rev or branches with -b/--branch. The resulting
662 clone will contain only the specified changesets and their ancestors.
663 These options (or 'clone src#rev dest') imply --pull, even for local
664 source repositories. Note that specifying a tag will include the tagged
665 changeset but not the changeset containing the tag.
666
667 If the source repository has a bookmark called '@' set, that revision
668 will be checked out in the new repository by default.
669
670 To check out a particular version, use -u/--update, or -U/--noupdate to
671 create a clone with no working directory.
672
673 For efficiency, hardlinks are used for cloning whenever the source and
674 destination are on the same filesystem (note this applies only to the
675 repository data, not to the working directory). Some filesystems, such
676 as AFS, implement hardlinking incorrectly, but do not report errors. In
677 these cases, use the --pull option to avoid hardlinking.
678
679 In some cases, you can clone repositories and the working directory
680 using full hardlinks with
681
682 $ cp -al REPO REPOCLONE
683
684 This is the fastest way to clone, but it is not always safe. The opera‐
685 tion is not atomic (making sure REPO is not modified during the opera‐
686 tion is up to you) and you have to make sure your editor breaks
687 hardlinks (Emacs and most Linux Kernel tools do so). Also, this is not
688 compatible with certain extensions that place their metadata under the
689 .hg directory, such as mq.
690
691 Mercurial will update the working directory to the first applicable
692 revision from this list:
693
694 a. null if -U or the source repository has no changesets
695
696 b. if -u . and the source repository is local, the first parent of the
697 source repository's working directory
698
699 c. the changeset specified with -u (if a branch name, this means the
700 latest head of that branch)
701
702 d. the changeset specified with -r
703
704 e. the tipmost head specified with -b
705
706 f. the tipmost head specified with the url#branch source syntax
707
708 g. the revision marked with the '@' bookmark, if present
709
710 h. the tipmost head of the default branch
711
712 i. tip
713
714 Examples:
715
716 · clone a remote repository to a new directory named hg/:
717
718 hg clone http://selenic.com/hg
719
720 · create a lightweight local clone:
721
722 hg clone project/ project-feature/
723
724 · clone from an absolute path on an ssh server (note double-slash):
725
726 hg clone ssh://user@server//home/projects/alpha/
727
728 · do a high-speed clone over a LAN while checking out a specified ver‐
729 sion:
730
731 hg clone --uncompressed http://server/repo -u 1.5
732
733 · create a repository without changesets after a particular revision:
734
735 hg clone -r 04e544 experimental/ good/
736
737 · clone (and track) a particular named branch:
738
739 hg clone http://selenic.com/hg#stable
740
741 See hg help urls for details on specifying URLs.
742
743 Returns 0 on success.
744
745 Options:
746
747 -U, --noupdate
748 the clone will include an empty working copy (only a repository)
749
750 -u, --updaterev
751 revision, tag or branch to check out
752
753 -r, --rev
754 include the specified changeset
755
756 -b, --branch
757 clone only the specified branch
758
759 --pull use pull protocol to copy metadata
760
761 --uncompressed
762 use uncompressed transfer (fast over LAN)
763
764 -e, --ssh
765 specify ssh command to use
766
767 --remotecmd
768 specify hg command to run on the remote side
769
770 --insecure
771 do not verify server certificate (ignoring web.cacerts config)
772
773 commit
774 hg commit [OPTION]... [FILE]...
775
776 Commit changes to the given files into the repository. Unlike a cen‐
777 tralized SCM, this operation is a local operation. See hg push for a
778 way to actively distribute your changes.
779
780 If a list of files is omitted, all changes reported by hg status will
781 be committed.
782
783 If you are committing the result of a merge, do not provide any file‐
784 names or -I/-X filters.
785
786 If no commit message is specified, Mercurial starts your configured
787 editor where you can enter a message. In case your commit fails, you
788 will find a backup of your message in .hg/last-message.txt.
789
790 The --amend flag can be used to amend the parent of the working direc‐
791 tory with a new commit that contains the changes in the parent in addi‐
792 tion to those currently reported by hg status, if there are any. The
793 old commit is stored in a backup bundle in .hg/strip-backup (see hg
794 help bundle and hg help unbundle on how to restore it).
795
796 Message, user and date are taken from the amended commit unless speci‐
797 fied. When a message isn't specified on the command line, the editor
798 will open with the message of the amended commit.
799
800 It is not possible to amend public changesets (see hg help phases) or
801 changesets that have children.
802
803 See hg help dates for a list of formats valid for -d/--date.
804
805 Returns 0 on success, 1 if nothing changed.
806
807 Options:
808
809 -A, --addremove
810 mark new/missing files as added/removed before committing
811
812 --close-branch
813 mark a branch as closed, hiding it from the branch list
814
815 --amend
816 amend the parent of the working dir
817
818 -I, --include
819 include names matching the given patterns
820
821 -X, --exclude
822 exclude names matching the given patterns
823
824 -m, --message
825 use text as commit message
826
827 -l, --logfile
828 read commit message from file
829
830 -d, --date
831 record the specified date as commit date
832
833 -u, --user
834 record the specified user as committer
835
836 -S, --subrepos
837 recurse into subrepositories
838
839 aliases: ci
840
841 copy
842 hg copy [OPTION]... [SOURCE]... DEST
843
844 Mark dest as having copies of source files. If dest is a directory,
845 copies are put in that directory. If dest is a file, the source must be
846 a single file.
847
848 By default, this command copies the contents of files as they exist in
849 the working directory. If invoked with -A/--after, the operation is
850 recorded, but no copying is performed.
851
852 This command takes effect with the next commit. To undo a copy before
853 that, see hg revert.
854
855 Returns 0 on success, 1 if errors are encountered.
856
857 Options:
858
859 -A, --after
860 record a copy that has already occurred
861
862 -f, --force
863 forcibly copy over an existing managed file
864
865 -I, --include
866 include names matching the given patterns
867
868 -X, --exclude
869 exclude names matching the given patterns
870
871 -n, --dry-run
872 do not perform actions, just print output
873
874 aliases: cp
875
876 diff
877 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
878
879 Show differences between revisions for the specified files.
880
881 Differences between files are shown using the unified diff format.
882
883 Note diff may generate unexpected results for merges, as it will
884 default to comparing against the working directory's first par‐
885 ent changeset if no revisions are specified.
886
887 When two revision arguments are given, then changes are shown between
888 those revisions. If only one revision is specified then that revision
889 is compared to the working directory, and, when no revisions are speci‐
890 fied, the working directory files are compared to its parent.
891
892 Alternatively you can specify -c/--change with a revision to see the
893 changes in that changeset relative to its first parent.
894
895 Without the -a/--text option, diff will avoid generating diffs of files
896 it detects as binary. With -a, diff will generate a diff anyway, proba‐
897 bly with undesirable results.
898
899 Use the -g/--git option to generate diffs in the git extended diff for‐
900 mat. For more information, read hg help diffs.
901
902 Examples:
903
904 · compare a file in the current working directory to its parent:
905
906 hg diff foo.c
907
908 · compare two historical versions of a directory, with rename info:
909
910 hg diff --git -r 1.0:1.2 lib/
911
912 · get change stats relative to the last change on some date:
913
914 hg diff --stat -r "date('may 2')"
915
916 · diff all newly-added files that contain a keyword:
917
918 hg diff "set:added() and grep(GNU)"
919
920 · compare a revision and its parents:
921
922 hg diff -c 9353 # compare against first parent
923 hg diff -r 9353^:9353 # same using revset syntax
924 hg diff -r 9353^2:9353 # compare against the second parent
925
926 Returns 0 on success.
927
928 Options:
929
930 -r, --rev
931 revision
932
933 -c, --change
934 change made by revision
935
936 -a, --text
937 treat all files as text
938
939 -g, --git
940 use git extended diff format
941
942 --nodates
943 omit dates from diff headers
944
945 -p, --show-function
946 show which function each change is in
947
948 --reverse
949 produce a diff that undoes the changes
950
951 -w, --ignore-all-space
952 ignore white space when comparing lines
953
954 -b, --ignore-space-change
955 ignore changes in the amount of white space
956
957 -B, --ignore-blank-lines
958 ignore changes whose lines are all blank
959
960 -U, --unified
961 number of lines of context to show
962
963 --stat output diffstat-style summary of changes
964
965 -I, --include
966 include names matching the given patterns
967
968 -X, --exclude
969 exclude names matching the given patterns
970
971 -S, --subrepos
972 recurse into subrepositories
973
974 export
975 hg export [OPTION]... [-o OUTFILESPEC] [-r] [REV]...
976
977 Print the changeset header and diffs for one or more revisions. If no
978 revision is given, the parent of the working directory is used.
979
980 The information shown in the changeset header is: author, date, branch
981 name (if non-default), changeset hash, parent(s) and commit comment.
982
983 Note export may generate unexpected diff output for merge changesets,
984 as it will compare the merge changeset against its first parent
985 only.
986
987 Output may be to a file, in which case the name of the file is given
988 using a format string. The formatting rules are as follows:
989
990 %%
991
992 literal "%" character
993
994 %H
995
996 changeset hash (40 hexadecimal digits)
997
998 %N
999
1000 number of patches being generated
1001
1002 %R
1003
1004 changeset revision number
1005
1006 %b
1007
1008 basename of the exporting repository
1009
1010 %h
1011
1012 short-form changeset hash (12 hexadecimal digits)
1013
1014 %m
1015
1016 first line of the commit message (only alphanumeric characters)
1017
1018 %n
1019
1020 zero-padded sequence number, starting at 1
1021
1022 %r
1023
1024 zero-padded changeset revision number
1025
1026 Without the -a/--text option, export will avoid generating diffs of
1027 files it detects as binary. With -a, export will generate a diff any‐
1028 way, probably with undesirable results.
1029
1030 Use the -g/--git option to generate diffs in the git extended diff for‐
1031 mat. See hg help diffs for more information.
1032
1033 With the --switch-parent option, the diff will be against the second
1034 parent. It can be useful to review a merge.
1035
1036 Examples:
1037
1038 · use export and import to transplant a bugfix to the current branch:
1039
1040 hg export -r 9353 | hg import -
1041
1042 · export all the changesets between two revisions to a file with rename
1043 information:
1044
1045 hg export --git -r 123:150 > changes.txt
1046
1047 · split outgoing changes into a series of patches with descriptive
1048 names:
1049
1050 hg export -r "outgoing()" -o "%n-%m.patch"
1051
1052 Returns 0 on success.
1053
1054 Options:
1055
1056 -o, --output
1057 print output to file with formatted name
1058
1059 --switch-parent
1060 diff against the second parent
1061
1062 -r, --rev
1063 revisions to export
1064
1065 -a, --text
1066 treat all files as text
1067
1068 -g, --git
1069 use git extended diff format
1070
1071 --nodates
1072 omit dates from diff headers
1073
1074 forget
1075 hg forget [OPTION]... FILE...
1076
1077 Mark the specified files so they will no longer be tracked after the
1078 next commit.
1079
1080 This only removes files from the current branch, not from the entire
1081 project history, and it does not delete them from the working direc‐
1082 tory.
1083
1084 To undo a forget before the next commit, see hg add.
1085
1086 Examples:
1087
1088 · forget newly-added binary files:
1089
1090 hg forget "set:added() and binary()"
1091
1092 · forget files that would be excluded by .hgignore:
1093
1094 hg forget "set:hgignore()"
1095
1096 Returns 0 on success.
1097
1098 Options:
1099
1100 -I, --include
1101 include names matching the given patterns
1102
1103 -X, --exclude
1104 exclude names matching the given patterns
1105
1106 graft
1107 hg graft [OPTION]... [-r] REV...
1108
1109 This command uses Mercurial's merge logic to copy individual changes
1110 from other branches without merging branches in the history graph. This
1111 is sometimes known as 'backporting' or 'cherry-picking'. By default,
1112 graft will copy user, date, and description from the source changesets.
1113
1114 Changesets that are ancestors of the current revision, that have
1115 already been grafted, or that are merges will be skipped.
1116
1117 If --log is specified, log messages will have a comment appended of the
1118 form:
1119
1120 (grafted from CHANGESETHASH)
1121
1122 If a graft merge results in conflicts, the graft process is interrupted
1123 so that the current merge can be manually resolved. Once all conflicts
1124 are addressed, the graft process can be continued with the -c/--con‐
1125 tinue option.
1126
1127 Note The -c/--continue option does not reapply earlier options.
1128
1129 Examples:
1130
1131 · copy a single change to the stable branch and edit its description:
1132
1133 hg update stable
1134 hg graft --edit 9393
1135
1136 · graft a range of changesets with one exception, updating dates:
1137
1138 hg graft -D "2085::2093 and not 2091"
1139
1140 · continue a graft after resolving conflicts:
1141
1142 hg graft -c
1143
1144 · show the source of a grafted changeset:
1145
1146 hg log --debug -r tip
1147
1148 Returns 0 on successful completion.
1149
1150 Options:
1151
1152 -r, --rev
1153 revisions to graft
1154
1155 -c, --continue
1156 resume interrupted graft
1157
1158 -e, --edit
1159 invoke editor on commit messages
1160
1161 --log append graft info to log message
1162
1163 -D, --currentdate
1164 record the current date as commit date
1165
1166 -U, --currentuser
1167 record the current user as committer
1168
1169 -d, --date
1170 record the specified date as commit date
1171
1172 -u, --user
1173 record the specified user as committer
1174
1175 -t, --tool
1176 specify merge tool
1177
1178 -n, --dry-run
1179 do not perform actions, just print output
1180
1181 grep
1182 hg grep [OPTION]... PATTERN [FILE]...
1183
1184 Search revisions of files for a regular expression.
1185
1186 This command behaves differently than Unix grep. It only accepts
1187 Python/Perl regexps. It searches repository history, not the working
1188 directory. It always prints the revision number in which a match
1189 appears.
1190
1191 By default, grep only prints output for the first revision of a file in
1192 which it finds a match. To get it to print every revision that contains
1193 a change in match status ("-" for a match that becomes a non-match, or
1194 "+" for a non-match that becomes a match), use the --all flag.
1195
1196 Returns 0 if a match is found, 1 otherwise.
1197
1198 Options:
1199
1200 -0, --print0
1201 end fields with NUL
1202
1203 --all print all revisions that match
1204
1205 -a, --text
1206 treat all files as text
1207
1208 -f, --follow
1209 follow changeset history, or file history across copies and
1210 renames
1211
1212 -i, --ignore-case
1213 ignore case when matching
1214
1215 -l, --files-with-matches
1216 print only filenames and revisions that match
1217
1218 -n, --line-number
1219 print matching line numbers
1220
1221 -r, --rev
1222 only search files changed within revision range
1223
1224 -u, --user
1225 list the author (long with -v)
1226
1227 -d, --date
1228 list the date (short with -q)
1229
1230 -I, --include
1231 include names matching the given patterns
1232
1233 -X, --exclude
1234 exclude names matching the given patterns
1235
1236 heads
1237 hg heads [-ct] [-r STARTREV] [REV]...
1238
1239 With no arguments, show all repository branch heads.
1240
1241 Repository "heads" are changesets with no child changesets. They are
1242 where development generally takes place and are the usual targets for
1243 update and merge operations. Branch heads are changesets that have no
1244 child changeset on the same branch.
1245
1246 If one or more REVs are given, only branch heads on the branches asso‐
1247 ciated with the specified changesets are shown. This means that you can
1248 use hg heads foo to see the heads on a branch named foo.
1249
1250 If -c/--closed is specified, also show branch heads marked closed (see
1251 hg commit --close-branch).
1252
1253 If STARTREV is specified, only those heads that are descendants of
1254 STARTREV will be displayed.
1255
1256 If -t/--topo is specified, named branch mechanics will be ignored and
1257 only changesets without children will be shown.
1258
1259 Returns 0 if matching heads are found, 1 if not.
1260
1261 Options:
1262
1263 -r, --rev
1264 show only heads which are descendants of STARTREV
1265
1266 -t, --topo
1267 show topological heads only
1268
1269 -a, --active
1270 show active branchheads only (DEPRECATED)
1271
1272 -c, --closed
1273 show normal and closed branch heads
1274
1275 --style
1276 display using template map file
1277
1278 --template
1279 display with template
1280
1281 help
1282 hg help [-ec] [TOPIC]
1283
1284 With no arguments, print a list of commands with short help messages.
1285
1286 Given a topic, extension, or command name, print help for that topic.
1287
1288 Returns 0 if successful.
1289
1290 Options:
1291
1292 -e, --extension
1293 show only help for extensions
1294
1295 -c, --command
1296 show only help for commands
1297
1298 -k, --keyword
1299 show topics matching keyword
1300
1301 identify
1302 hg identify [-nibtB] [-r REV] [SOURCE]
1303
1304 Print a summary identifying the repository state at REV using one or
1305 two parent hash identifiers, followed by a "+" if the working directory
1306 has uncommitted changes, the branch name (if not default), a list of
1307 tags, and a list of bookmarks.
1308
1309 When REV is not given, print a summary of the current state of the
1310 repository.
1311
1312 Specifying a path to a repository root or Mercurial bundle will cause
1313 lookup to operate on that repository/bundle.
1314
1315 Examples:
1316
1317 · generate a build identifier for the working directory:
1318
1319 hg id --id > build-id.dat
1320
1321 · find the revision corresponding to a tag:
1322
1323 hg id -n -r 1.3
1324
1325 · check the most recent revision of a remote repository:
1326
1327 hg id -r tip http://selenic.com/hg/
1328
1329 Returns 0 if successful.
1330
1331 Options:
1332
1333 -r, --rev
1334 identify the specified revision
1335
1336 -n, --num
1337 show local revision number
1338
1339 -i, --id
1340 show global revision id
1341
1342 -b, --branch
1343 show branch
1344
1345 -t, --tags
1346 show tags
1347
1348 -B, --bookmarks
1349 show bookmarks
1350
1351 -e, --ssh
1352 specify ssh command to use
1353
1354 --remotecmd
1355 specify hg command to run on the remote side
1356
1357 --insecure
1358 do not verify server certificate (ignoring web.cacerts config)
1359
1360 aliases: id
1361
1362 import
1363 hg import [OPTION]... PATCH...
1364
1365 Import a list of patches and commit them individually (unless --no-com‐
1366 mit is specified).
1367
1368 If there are outstanding changes in the working directory, import will
1369 abort unless given the -f/--force flag.
1370
1371 You can import a patch straight from a mail message. Even patches as
1372 attachments work (to use the body part, it must have type text/plain or
1373 text/x-patch). From and Subject headers of email message are used as
1374 default committer and commit message. All text/plain body parts before
1375 first diff are added to commit message.
1376
1377 If the imported patch was generated by hg export, user and description
1378 from patch override values from message headers and body. Values given
1379 on command line with -m/--message and -u/--user override these.
1380
1381 If --exact is specified, import will set the working directory to the
1382 parent of each patch before applying it, and will abort if the result‐
1383 ing changeset has a different ID than the one recorded in the patch.
1384 This may happen due to character set problems or other deficiencies in
1385 the text patch format.
1386
1387 Use --bypass to apply and commit patches directly to the repository,
1388 not touching the working directory. Without --exact, patches will be
1389 applied on top of the working directory parent revision.
1390
1391 With -s/--similarity, hg will attempt to discover renames and copies in
1392 the patch in the same way as hg addremove.
1393
1394 To read a patch from standard input, use "-" as the patch name. If a
1395 URL is specified, the patch will be downloaded from it. See hg help
1396 dates for a list of formats valid for -d/--date.
1397
1398 Examples:
1399
1400 · import a traditional patch from a website and detect renames:
1401
1402 hg import -s 80 http://example.com/bugfix.patch
1403
1404 · import a changeset from an hgweb server:
1405
1406 hg import http://www.selenic.com/hg/rev/5ca8c111e9aa
1407
1408 · import all the patches in an Unix-style mbox:
1409
1410 hg import incoming-patches.mbox
1411
1412 · attempt to exactly restore an exported changeset (not always possi‐
1413 ble):
1414
1415 hg import --exact proposed-fix.patch
1416
1417 Returns 0 on success.
1418
1419 Options:
1420
1421 -p, --strip
1422 directory strip option for patch. This has the same meaning as
1423 the corresponding patch option (default: 1)
1424
1425 -b, --base
1426 base path (DEPRECATED)
1427
1428 -e, --edit
1429 invoke editor on commit messages
1430
1431 -f, --force
1432 skip check for outstanding uncommitted changes
1433
1434 --no-commit
1435 don't commit, just update the working directory
1436
1437 --bypass
1438 apply patch without touching the working directory
1439
1440 --exact
1441 apply patch to the nodes from which it was generated
1442
1443 --import-branch
1444 use any branch information in patch (implied by --exact)
1445
1446 -m, --message
1447 use text as commit message
1448
1449 -l, --logfile
1450 read commit message from file
1451
1452 -d, --date
1453 record the specified date as commit date
1454
1455 -u, --user
1456 record the specified user as committer
1457
1458 -s, --similarity
1459 guess renamed files by similarity (0<=s<=100)
1460
1461 aliases: patch
1462
1463 incoming
1464 hg incoming [-p] [-n] [-M] [-f] [-r REV]... [--bundle FILENAME] [SOURCE]
1465
1466 Show new changesets found in the specified path/URL or the default pull
1467 location. These are the changesets that would have been pulled if a
1468 pull at the time you issued this command.
1469
1470 For remote repository, using --bundle avoids downloading the changesets
1471 twice if the incoming is followed by a pull.
1472
1473 See pull for valid source format details.
1474
1475 Returns 0 if there are incoming changes, 1 otherwise.
1476
1477 Options:
1478
1479 -f, --force
1480 run even if remote repository is unrelated
1481
1482 -n, --newest-first
1483 show newest record first
1484
1485 --bundle
1486 file to store the bundles into
1487
1488 -r, --rev
1489 a remote changeset intended to be added
1490
1491 -B, --bookmarks
1492 compare bookmarks
1493
1494 -b, --branch
1495 a specific branch you would like to pull
1496
1497 -p, --patch
1498 show patch
1499
1500 -g, --git
1501 use git extended diff format
1502
1503 -l, --limit
1504 limit number of changes displayed
1505
1506 -M, --no-merges
1507 do not show merges
1508
1509 --stat output diffstat-style summary of changes
1510
1511 -G, --graph
1512 show the revision DAG
1513
1514 --style
1515 display using template map file
1516
1517 --template
1518 display with template
1519
1520 -e, --ssh
1521 specify ssh command to use
1522
1523 --remotecmd
1524 specify hg command to run on the remote side
1525
1526 --insecure
1527 do not verify server certificate (ignoring web.cacerts config)
1528
1529 -S, --subrepos
1530 recurse into subrepositories
1531
1532 aliases: in
1533
1534 init
1535 hg init [-e CMD] [--remotecmd CMD] [DEST]
1536
1537 Initialize a new repository in the given directory. If the given direc‐
1538 tory does not exist, it will be created.
1539
1540 If no directory is given, the current directory is used.
1541
1542 It is possible to specify an ssh:// URL as the destination. See hg
1543 help urls for more information.
1544
1545 Returns 0 on success.
1546
1547 Options:
1548
1549 -e, --ssh
1550 specify ssh command to use
1551
1552 --remotecmd
1553 specify hg command to run on the remote side
1554
1555 --insecure
1556 do not verify server certificate (ignoring web.cacerts config)
1557
1558 locate
1559 hg locate [OPTION]... [PATTERN]...
1560
1561 Print files under Mercurial control in the working directory whose
1562 names match the given patterns.
1563
1564 By default, this command searches all directories in the working direc‐
1565 tory. To search just the current directory and its subdirectories, use
1566 "--include .".
1567
1568 If no patterns are given to match, this command prints the names of all
1569 files under Mercurial control in the working directory.
1570
1571 If you want to feed the output of this command into the "xargs" com‐
1572 mand, use the -0 option to both this command and "xargs". This will
1573 avoid the problem of "xargs" treating single filenames that contain
1574 whitespace as multiple filenames.
1575
1576 Returns 0 if a match is found, 1 otherwise.
1577
1578 Options:
1579
1580 -r, --rev
1581 search the repository as it is in REV
1582
1583 -0, --print0
1584 end filenames with NUL, for use with xargs
1585
1586 -f, --fullpath
1587 print complete paths from the filesystem root
1588
1589 -I, --include
1590 include names matching the given patterns
1591
1592 -X, --exclude
1593 exclude names matching the given patterns
1594
1595 log
1596 hg log [OPTION]... [FILE]
1597
1598 Print the revision history of the specified files or the entire
1599 project.
1600
1601 If no revision range is specified, the default is tip:0 unless --follow
1602 is set, in which case the working directory parent is used as the
1603 starting revision.
1604
1605 File history is shown without following rename or copy history of
1606 files. Use -f/--follow with a filename to follow history across renames
1607 and copies. --follow without a filename will only show ancestors or
1608 descendants of the starting revision.
1609
1610 By default this command prints revision number and changeset id, tags,
1611 non-trivial parents, user, date and time, and a summary for each com‐
1612 mit. When the -v/--verbose switch is used, the list of changed files
1613 and full commit message are shown.
1614
1615 Note log -p/--patch may generate unexpected diff output for merge
1616 changesets, as it will only compare the merge changeset against
1617 its first parent. Also, only files different from BOTH parents
1618 will appear in files:.
1619
1620 Note for performance reasons, log FILE may omit duplicate changes
1621 made on branches and will not show deletions. To see all changes
1622 including duplicates and deletions, use the --removed switch.
1623
1624 Some examples:
1625
1626 · changesets with full descriptions and file lists:
1627
1628 hg log -v
1629
1630 · changesets ancestral to the working directory:
1631
1632 hg log -f
1633
1634 · last 10 commits on the current branch:
1635
1636 hg log -l 10 -b .
1637
1638 · changesets showing all modifications of a file, including removals:
1639
1640 hg log --removed file.c
1641
1642 · all changesets that touch a directory, with diffs, excluding merges:
1643
1644 hg log -Mp lib/
1645
1646 · all revision numbers that match a keyword:
1647
1648 hg log -k bug --template "{rev}\n"
1649
1650 · check if a given changeset is included is a tagged release:
1651
1652 hg log -r "a21ccf and ancestor(1.9)"
1653
1654 · find all changesets by some user in a date range:
1655
1656 hg log -k alice -d "may 2008 to jul 2008"
1657
1658 · summary of all changesets after the last tag:
1659
1660 hg log -r "last(tagged())::" --template "{desc|firstline}\n"
1661
1662 See hg help dates for a list of formats valid for -d/--date.
1663
1664 See hg help revisions and hg help revsets for more about specifying
1665 revisions.
1666
1667 See hg help templates for more about pre-packaged styles and specifying
1668 custom templates.
1669
1670 Returns 0 on success.
1671
1672 Options:
1673
1674 -f, --follow
1675 follow changeset history, or file history across copies and
1676 renames
1677
1678 --follow-first
1679 only follow the first parent of merge changesets (DEPRECATED)
1680
1681 -d, --date
1682 show revisions matching date spec
1683
1684 -C, --copies
1685 show copied files
1686
1687 -k, --keyword
1688 do case-insensitive search for a given text
1689
1690 -r, --rev
1691 show the specified revision or range
1692
1693 --removed
1694 include revisions where files were removed
1695
1696 -m, --only-merges
1697 show only merges (DEPRECATED)
1698
1699 -u, --user
1700 revisions committed by user
1701
1702 --only-branch
1703 show only changesets within the given named branch (DEPRECATED)
1704
1705 -b, --branch
1706 show changesets within the given named branch
1707
1708 -P, --prune
1709 do not display revision or any of its ancestors
1710
1711 -p, --patch
1712 show patch
1713
1714 -g, --git
1715 use git extended diff format
1716
1717 -l, --limit
1718 limit number of changes displayed
1719
1720 -M, --no-merges
1721 do not show merges
1722
1723 --stat output diffstat-style summary of changes
1724
1725 -G, --graph
1726 show the revision DAG
1727
1728 --style
1729 display using template map file
1730
1731 --template
1732 display with template
1733
1734 -I, --include
1735 include names matching the given patterns
1736
1737 -X, --exclude
1738 exclude names matching the given patterns
1739
1740 aliases: history
1741
1742 manifest
1743 hg manifest [-r REV]
1744
1745 Print a list of version controlled files for the given revision. If no
1746 revision is given, the first parent of the working directory is used,
1747 or the null revision if no revision is checked out.
1748
1749 With -v, print file permissions, symlink and executable bits. With
1750 --debug, print file revision hashes.
1751
1752 If option --all is specified, the list of all files from all revisions
1753 is printed. This includes deleted and renamed files.
1754
1755 Returns 0 on success.
1756
1757 Options:
1758
1759 -r, --rev
1760 revision to display
1761
1762 --all list files from all revisions
1763
1764 merge
1765 hg merge [-P] [-f] [[-r] REV]
1766
1767 The current working directory is updated with all changes made in the
1768 requested revision since the last common predecessor revision.
1769
1770 Files that changed between either parent are marked as changed for the
1771 next commit and a commit must be performed before any further updates
1772 to the repository are allowed. The next commit will have two parents.
1773
1774 --tool can be used to specify the merge tool used for file merges. It
1775 overrides the HGMERGE environment variable and your configuration
1776 files. See hg help merge-tools for options.
1777
1778 If no revision is specified, the working directory's parent is a head
1779 revision, and the current branch contains exactly one other head, the
1780 other head is merged with by default. Otherwise, an explicit revision
1781 with which to merge with must be provided.
1782
1783 hg resolve must be used to resolve unresolved files.
1784
1785 To undo an uncommitted merge, use hg update --clean . which will check
1786 out a clean copy of the original merge parent, losing all changes.
1787
1788 Returns 0 on success, 1 if there are unresolved files.
1789
1790 Options:
1791
1792 -f, --force
1793 force a merge with outstanding changes
1794
1795 -r, --rev
1796 revision to merge
1797
1798 -P, --preview
1799 review revisions to merge (no merge is performed)
1800
1801 -t, --tool
1802 specify merge tool
1803
1804 outgoing
1805 hg outgoing [-M] [-p] [-n] [-f] [-r REV]... [DEST]
1806
1807 Show changesets not found in the specified destination repository or
1808 the default push location. These are the changesets that would be
1809 pushed if a push was requested.
1810
1811 See pull for details of valid destination formats.
1812
1813 Returns 0 if there are outgoing changes, 1 otherwise.
1814
1815 Options:
1816
1817 -f, --force
1818 run even when the destination is unrelated
1819
1820 -r, --rev
1821 a changeset intended to be included in the destination
1822
1823 -n, --newest-first
1824 show newest record first
1825
1826 -B, --bookmarks
1827 compare bookmarks
1828
1829 -b, --branch
1830 a specific branch you would like to push
1831
1832 -p, --patch
1833 show patch
1834
1835 -g, --git
1836 use git extended diff format
1837
1838 -l, --limit
1839 limit number of changes displayed
1840
1841 -M, --no-merges
1842 do not show merges
1843
1844 --stat output diffstat-style summary of changes
1845
1846 -G, --graph
1847 show the revision DAG
1848
1849 --style
1850 display using template map file
1851
1852 --template
1853 display with template
1854
1855 -e, --ssh
1856 specify ssh command to use
1857
1858 --remotecmd
1859 specify hg command to run on the remote side
1860
1861 --insecure
1862 do not verify server certificate (ignoring web.cacerts config)
1863
1864 -S, --subrepos
1865 recurse into subrepositories
1866
1867 aliases: out
1868
1869 parents
1870 hg parents [-r REV] [FILE]
1871
1872 Print the working directory's parent revisions. If a revision is given
1873 via -r/--rev, the parent of that revision will be printed. If a file
1874 argument is given, the revision in which the file was last changed
1875 (before the working directory revision or the argument to --rev if
1876 given) is printed.
1877
1878 Returns 0 on success.
1879
1880 Options:
1881
1882 -r, --rev
1883 show parents of the specified revision
1884
1885 --style
1886 display using template map file
1887
1888 --template
1889 display with template
1890
1891 paths
1892 hg paths [NAME]
1893
1894 Show definition of symbolic path name NAME. If no name is given, show
1895 definition of all available names.
1896
1897 Option -q/--quiet suppresses all output when searching for NAME and
1898 shows only the path names when listing all definitions.
1899
1900 Path names are defined in the [paths] section of your configuration
1901 file and in /etc/mercurial/hgrc. If run inside a repository, .hg/hgrc
1902 is used, too.
1903
1904 The path names default and default-push have a special meaning. When
1905 performing a push or pull operation, they are used as fallbacks if no
1906 location is specified on the command-line. When default-push is set,
1907 it will be used for push and default will be used for pull; otherwise
1908 default is used as the fallback for both. When cloning a repository,
1909 the clone source is written as default in .hg/hgrc. Note that default
1910 and default-push apply to all inbound (e.g. hg incoming) and outbound
1911 (e.g. hg outgoing, hg email and hg bundle) operations.
1912
1913 See hg help urls for more information.
1914
1915 Returns 0 on success.
1916
1917 phase
1918 hg phase [-p|-d|-s] [-f] [-r] REV...
1919
1920 With no argument, show the phase name of specified revisions.
1921
1922 With one of -p/--public, -d/--draft or -s/--secret, change the phase
1923 value of the specified revisions.
1924
1925 Unless -f/--force is specified, hg phase won't move changeset from a
1926 lower phase to an higher phase. Phases are ordered as follows:
1927
1928 public < draft < secret
1929
1930 Return 0 on success, 1 if no phases were changed or some could not be
1931 changed.
1932
1933 Options:
1934
1935 -p, --public
1936 set changeset phase to public
1937
1938 -d, --draft
1939 set changeset phase to draft
1940
1941 -s, --secret
1942 set changeset phase to secret
1943
1944 -f, --force
1945 allow to move boundary backward
1946
1947 -r, --rev
1948 target revision
1949
1950 pull
1951 hg pull [-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [SOURCE]
1952
1953 Pull changes from a remote repository to a local one.
1954
1955 This finds all changes from the repository at the specified path or URL
1956 and adds them to a local repository (the current one unless -R is spec‐
1957 ified). By default, this does not update the copy of the project in the
1958 working directory.
1959
1960 Use hg incoming if you want to see what would have been added by a pull
1961 at the time you issued this command. If you then decide to add those
1962 changes to the repository, you should use hg pull -r X where X is the
1963 last changeset listed by hg incoming.
1964
1965 If SOURCE is omitted, the 'default' path will be used. See hg help
1966 urls for more information.
1967
1968 Returns 0 on success, 1 if an update had unresolved files.
1969
1970 Options:
1971
1972 -u, --update
1973 update to new branch head if changesets were pulled
1974
1975 -f, --force
1976 run even when remote repository is unrelated
1977
1978 -r, --rev
1979 a remote changeset intended to be added
1980
1981 -B, --bookmark
1982 bookmark to pull
1983
1984 -b, --branch
1985 a specific branch you would like to pull
1986
1987 -e, --ssh
1988 specify ssh command to use
1989
1990 --remotecmd
1991 specify hg command to run on the remote side
1992
1993 --insecure
1994 do not verify server certificate (ignoring web.cacerts config)
1995
1996 push
1997 hg push [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]
1998
1999 Push changesets from the local repository to the specified destination.
2000
2001 This operation is symmetrical to pull: it is identical to a pull in the
2002 destination repository from the current one.
2003
2004 By default, push will not allow creation of new heads at the destina‐
2005 tion, since multiple heads would make it unclear which head to use. In
2006 this situation, it is recommended to pull and merge before pushing.
2007
2008 Use --new-branch if you want to allow push to create a new named branch
2009 that is not present at the destination. This allows you to only create
2010 a new branch without forcing other changes.
2011
2012 Use -f/--force to override the default behavior and push all changesets
2013 on all branches.
2014
2015 If -r/--rev is used, the specified revision and all its ancestors will
2016 be pushed to the remote repository.
2017
2018 If -B/--bookmark is used, the specified bookmarked revision, its ances‐
2019 tors, and the bookmark will be pushed to the remote repository.
2020
2021 Please see hg help urls for important details about ssh:// URLs. If
2022 DESTINATION is omitted, a default path will be used.
2023
2024 Returns 0 if push was successful, 1 if nothing to push.
2025
2026 Options:
2027
2028 -f, --force
2029 force push
2030
2031 -r, --rev
2032 a changeset intended to be included in the destination
2033
2034 -B, --bookmark
2035 bookmark to push
2036
2037 -b, --branch
2038 a specific branch you would like to push
2039
2040 --new-branch
2041 allow pushing a new branch
2042
2043 -e, --ssh
2044 specify ssh command to use
2045
2046 --remotecmd
2047 specify hg command to run on the remote side
2048
2049 --insecure
2050 do not verify server certificate (ignoring web.cacerts config)
2051
2052 recover
2053 hg recover
2054
2055 Recover from an interrupted commit or pull.
2056
2057 This command tries to fix the repository status after an interrupted
2058 operation. It should only be necessary when Mercurial suggests it.
2059
2060 Returns 0 if successful, 1 if nothing to recover or verify fails.
2061
2062 remove
2063 hg remove [OPTION]... FILE...
2064
2065 Schedule the indicated files for removal from the current branch.
2066
2067 This command schedules the files to be removed at the next commit. To
2068 undo a remove before that, see hg revert. To undo added files, see hg
2069 forget.
2070
2071 -A/--after can be used to remove only files that have already been
2072 deleted, -f/--force can be used to force deletion, and -Af can be used
2073 to remove files from the next revision without deleting them from the
2074 working directory.
2075
2076 The following table details the behavior of remove for different file
2077 states (columns) and option combinations (rows). The file states are
2078 Added [A], Clean [C], Modified [M] and Missing [!] (as reported by hg
2079 status). The actions are Warn, Remove (from branch) and Delete (from
2080 disk):
2081
2082 ┌─────┬───┬────┬────┬───┐
2083 │ │ │ │ │ │
2084 ├─────┼───┼────┼────┼───┤
2085 │none │ W │ RD │ W │ R │
2086 ├─────┼───┼────┼────┼───┤
2087 │-f │ R │ RD │ RD │ R │
2088 ├─────┼───┼────┼────┼───┤
2089 │-A │ W │ W │ W │ R │
2090 ├─────┼───┼────┼────┼───┤
2091 │-Af │ R │ R │ R │ R │
2092 └─────┴───┴────┴────┴───┘
2093
2094 Note that remove never deletes files in Added [A] state from the work‐
2095 ing directory, not even if option --force is specified.
2096
2097 Returns 0 on success, 1 if any warnings encountered.
2098
2099 Options:
2100
2101 -A, --after
2102 record delete for missing files
2103
2104 -f, --force
2105 remove (and delete) file even if added or modified
2106
2107 -I, --include
2108 include names matching the given patterns
2109
2110 -X, --exclude
2111 exclude names matching the given patterns
2112
2113 aliases: rm
2114
2115 rename
2116 hg rename [OPTION]... SOURCE... DEST
2117
2118 Mark dest as copies of sources; mark sources for deletion. If dest is a
2119 directory, copies are put in that directory. If dest is a file, there
2120 can only be one source.
2121
2122 By default, this command copies the contents of files as they exist in
2123 the working directory. If invoked with -A/--after, the operation is
2124 recorded, but no copying is performed.
2125
2126 This command takes effect at the next commit. To undo a rename before
2127 that, see hg revert.
2128
2129 Returns 0 on success, 1 if errors are encountered.
2130
2131 Options:
2132
2133 -A, --after
2134 record a rename that has already occurred
2135
2136 -f, --force
2137 forcibly copy over an existing managed file
2138
2139 -I, --include
2140 include names matching the given patterns
2141
2142 -X, --exclude
2143 exclude names matching the given patterns
2144
2145 -n, --dry-run
2146 do not perform actions, just print output
2147
2148 aliases: move mv
2149
2150 resolve
2151 hg resolve [OPTION]... [FILE]...
2152
2153 Merges with unresolved conflicts are often the result of non-interac‐
2154 tive merging using the internal:merge configuration setting, or a com‐
2155 mand-line merge tool like diff3. The resolve command is used to manage
2156 the files involved in a merge, after hg merge has been run, and before
2157 hg commit is run (i.e. the working directory must have two parents).
2158 See hg help merge-tools for information on configuring merge tools.
2159
2160 The resolve command can be used in the following ways:
2161
2162 · hg resolve [--tool TOOL] FILE...: attempt to re-merge the specified
2163 files, discarding any previous merge attempts. Re-merging is not per‐
2164 formed for files already marked as resolved. Use --all/-a to select
2165 all unresolved files. --tool can be used to specify the merge tool
2166 used for the given files. It overrides the HGMERGE environment vari‐
2167 able and your configuration files. Previous file contents are saved
2168 with a .orig suffix.
2169
2170 · hg resolve -m [FILE]: mark a file as having been resolved (e.g. after
2171 having manually fixed-up the files). The default is to mark all unre‐
2172 solved files.
2173
2174 · hg resolve -u [FILE]...: mark a file as unresolved. The default is to
2175 mark all resolved files.
2176
2177 · hg resolve -l: list files which had or still have conflicts. In the
2178 printed list, U = unresolved and R = resolved.
2179
2180 Note that Mercurial will not let you commit files with unresolved merge
2181 conflicts. You must use hg resolve -m ... before you can commit after a
2182 conflicting merge.
2183
2184 Returns 0 on success, 1 if any files fail a resolve attempt.
2185
2186 Options:
2187
2188 -a, --all
2189 select all unresolved files
2190
2191 -l, --list
2192 list state of files needing merge
2193
2194 -m, --mark
2195 mark files as resolved
2196
2197 -u, --unmark
2198 mark files as unresolved
2199
2200 -n, --no-status
2201 hide status prefix
2202
2203 -t, --tool
2204 specify merge tool
2205
2206 -I, --include
2207 include names matching the given patterns
2208
2209 -X, --exclude
2210 exclude names matching the given patterns
2211
2212 revert
2213 hg revert [OPTION]... [-r REV] [NAME]...
2214
2215 Note To check out earlier revisions, you should use hg update REV.
2216 To cancel an uncommitted merge (and lose your changes), use hg
2217 update --clean ..
2218
2219 With no revision specified, revert the specified files or directories
2220 to the contents they had in the parent of the working directory. This
2221 restores the contents of files to an unmodified state and unschedules
2222 adds, removes, copies, and renames. If the working directory has two
2223 parents, you must explicitly specify a revision.
2224
2225 Using the -r/--rev or -d/--date options, revert the given files or
2226 directories to their states as of a specific revision. Because revert
2227 does not change the working directory parents, this will cause these
2228 files to appear modified. This can be helpful to "back out" some or all
2229 of an earlier change. See hg backout for a related method.
2230
2231 Modified files are saved with a .orig suffix before reverting. To dis‐
2232 able these backups, use --no-backup.
2233
2234 See hg help dates for a list of formats valid for -d/--date.
2235
2236 Returns 0 on success.
2237
2238 Options:
2239
2240 -a, --all
2241 revert all changes when no arguments given
2242
2243 -d, --date
2244 tipmost revision matching date
2245
2246 -r, --rev
2247 revert to the specified revision
2248
2249 -C, --no-backup
2250 do not save backup copies of files
2251
2252 -I, --include
2253 include names matching the given patterns
2254
2255 -X, --exclude
2256 exclude names matching the given patterns
2257
2258 -n, --dry-run
2259 do not perform actions, just print output
2260
2261 rollback
2262 hg rollback
2263
2264 This command should be used with care. There is only one level of roll‐
2265 back, and there is no way to undo a rollback. It will also restore the
2266 dirstate at the time of the last transaction, losing any dirstate
2267 changes since that time. This command does not alter the working direc‐
2268 tory.
2269
2270 Transactions are used to encapsulate the effects of all commands that
2271 create new changesets or propagate existing changesets into a reposi‐
2272 tory.
2273
2274 For example, the following commands are transactional, and their
2275 effects can be rolled back:
2276
2277 · commit
2278
2279 · import
2280
2281 · pull
2282
2283 · push (with this repository as the destination)
2284
2285 · unbundle
2286
2287 To avoid permanent data loss, rollback will refuse to rollback a commit
2288 transaction if it isn't checked out. Use --force to override this pro‐
2289 tection.
2290
2291 This command is not intended for use on public repositories. Once
2292 changes are visible for pull by other users, rolling a transaction back
2293 locally is ineffective (someone else may already have pulled the
2294 changes). Furthermore, a race is possible with readers of the reposi‐
2295 tory; for example an in-progress pull from the repository may fail if a
2296 rollback is performed.
2297
2298 Returns 0 on success, 1 if no rollback data is available.
2299
2300 Options:
2301
2302 -n, --dry-run
2303 do not perform actions, just print output
2304
2305 -f, --force
2306 ignore safety measures
2307
2308 root
2309 hg root
2310
2311 Print the root directory of the current repository.
2312
2313 Returns 0 on success.
2314
2315 serve
2316 hg serve [OPTION]...
2317
2318 Start a local HTTP repository browser and pull server. You can use this
2319 for ad-hoc sharing and browsing of repositories. It is recommended to
2320 use a real web server to serve a repository for longer periods of time.
2321
2322 Please note that the server does not implement access control. This
2323 means that, by default, anybody can read from the server and nobody can
2324 write to it by default. Set the web.allow_push option to * to allow
2325 everybody to push to the server. You should use a real web server if
2326 you need to authenticate users.
2327
2328 By default, the server logs accesses to stdout and errors to stderr.
2329 Use the -A/--accesslog and -E/--errorlog options to log to files.
2330
2331 To have the server choose a free port number to listen on, specify a
2332 port number of 0; in this case, the server will print the port number
2333 it uses.
2334
2335 Returns 0 on success.
2336
2337 Options:
2338
2339 -A, --accesslog
2340 name of access log file to write to
2341
2342 -d, --daemon
2343 run server in background
2344
2345 --daemon-pipefds
2346 used internally by daemon mode
2347
2348 -E, --errorlog
2349 name of error log file to write to
2350
2351 -p, --port
2352 port to listen on (default: 8000)
2353
2354 -a, --address
2355 address to listen on (default: all interfaces)
2356
2357 --prefix
2358 prefix path to serve from (default: server root)
2359
2360 -n, --name
2361 name to show in web pages (default: working directory)
2362
2363 --web-conf
2364 name of the hgweb config file (see "hg help hgweb")
2365
2366 --webdir-conf
2367 name of the hgweb config file (DEPRECATED)
2368
2369 --pid-file
2370 name of file to write process ID to
2371
2372 --stdio
2373 for remote clients
2374
2375 --cmdserver
2376 for remote clients
2377
2378 -t, --templates
2379 web templates to use
2380
2381 --style
2382 template style to use
2383
2384 -6, --ipv6
2385 use IPv6 in addition to IPv4
2386
2387 --certificate
2388 SSL certificate file
2389
2390 showconfig
2391 hg showconfig [-u] [NAME]...
2392
2393 With no arguments, print names and values of all config items.
2394
2395 With one argument of the form section.name, print just the value of
2396 that config item.
2397
2398 With multiple arguments, print names and values of all config items
2399 with matching section names.
2400
2401 With --debug, the source (filename and line number) is printed for each
2402 config item.
2403
2404 Returns 0 on success.
2405
2406 Options:
2407
2408 -u, --untrusted
2409 show untrusted configuration options
2410
2411 aliases: debugconfig
2412
2413 status
2414 hg status [OPTION]... [FILE]...
2415
2416 Show status of files in the repository. If names are given, only files
2417 that match are shown. Files that are clean or ignored or the source of
2418 a copy/move operation, are not listed unless -c/--clean, -i/--ignored,
2419 -C/--copies or -A/--all are given. Unless options described with "show
2420 only ..." are given, the options -mardu are used.
2421
2422 Option -q/--quiet hides untracked (unknown and ignored) files unless
2423 explicitly requested with -u/--unknown or -i/--ignored.
2424
2425 Note status may appear to disagree with diff if permissions have
2426 changed or a merge has occurred. The standard diff format does
2427 not report permission changes and diff only reports changes rel‐
2428 ative to one merge parent.
2429
2430 If one revision is given, it is used as the base revision. If two
2431 revisions are given, the differences between them are shown. The
2432 --change option can also be used as a shortcut to list the changed
2433 files of a revision from its first parent.
2434
2435 The codes used to show the status of files are:
2436
2437 M = modified
2438 A = added
2439 R = removed
2440 C = clean
2441 ! = missing (deleted by non-hg command, but still tracked)
2442 ? = not tracked
2443 I = ignored
2444 = origin of the previous file listed as A (added)
2445
2446 Examples:
2447
2448 · show changes in the working directory relative to a changeset:
2449
2450 hg status --rev 9353
2451
2452 · show all changes including copies in an existing changeset:
2453
2454 hg status --copies --change 9353
2455
2456 · get a NUL separated list of added files, suitable for xargs:
2457
2458 hg status -an0
2459
2460 Returns 0 on success.
2461
2462 Options:
2463
2464 -A, --all
2465 show status of all files
2466
2467 -m, --modified
2468 show only modified files
2469
2470 -a, --added
2471 show only added files
2472
2473 -r, --removed
2474 show only removed files
2475
2476 -d, --deleted
2477 show only deleted (but tracked) files
2478
2479 -c, --clean
2480 show only files without changes
2481
2482 -u, --unknown
2483 show only unknown (not tracked) files
2484
2485 -i, --ignored
2486 show only ignored files
2487
2488 -n, --no-status
2489 hide status prefix
2490
2491 -C, --copies
2492 show source of copied files
2493
2494 -0, --print0
2495 end filenames with NUL, for use with xargs
2496
2497 --rev show difference from revision
2498
2499 --change
2500 list the changed files of a revision
2501
2502 -I, --include
2503 include names matching the given patterns
2504
2505 -X, --exclude
2506 exclude names matching the given patterns
2507
2508 -S, --subrepos
2509 recurse into subrepositories
2510
2511 aliases: st
2512
2513 summary
2514 hg summary [--remote]
2515
2516 This generates a brief summary of the working directory state, includ‐
2517 ing parents, branch, commit status, and available updates.
2518
2519 With the --remote option, this will check the default paths for incom‐
2520 ing and outgoing changes. This can be time-consuming.
2521
2522 Returns 0 on success.
2523
2524 Options:
2525
2526 --remote
2527 check for push and pull
2528
2529 aliases: sum
2530
2531 tag
2532 hg tag [-f] [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME...
2533
2534 Name a particular revision using <name>.
2535
2536 Tags are used to name particular revisions of the repository and are
2537 very useful to compare different revisions, to go back to significant
2538 earlier versions or to mark branch points as releases, etc. Changing an
2539 existing tag is normally disallowed; use -f/--force to override.
2540
2541 If no revision is given, the parent of the working directory is used,
2542 or tip if no revision is checked out.
2543
2544 To facilitate version control, distribution, and merging of tags, they
2545 are stored as a file named ".hgtags" which is managed similarly to
2546 other project files and can be hand-edited if necessary. This also
2547 means that tagging creates a new commit. The file ".hg/localtags" is
2548 used for local tags (not shared among repositories).
2549
2550 Tag commits are usually made at the head of a branch. If the parent of
2551 the working directory is not a branch head, hg tag aborts; use
2552 -f/--force to force the tag commit to be based on a non-head changeset.
2553
2554 See hg help dates for a list of formats valid for -d/--date.
2555
2556 Since tag names have priority over branch names during revision lookup,
2557 using an existing branch name as a tag name is discouraged.
2558
2559 Returns 0 on success.
2560
2561 Options:
2562
2563 -f, --force
2564 force tag
2565
2566 -l, --local
2567 make the tag local
2568
2569 -r, --rev
2570 revision to tag
2571
2572 --remove
2573 remove a tag
2574
2575 -e, --edit
2576 edit commit message
2577
2578 -m, --message
2579 use <text> as commit message
2580
2581 -d, --date
2582 record the specified date as commit date
2583
2584 -u, --user
2585 record the specified user as committer
2586
2587 tags
2588 hg tags
2589
2590 This lists both regular and local tags. When the -v/--verbose switch is
2591 used, a third column "local" is printed for local tags.
2592
2593 Returns 0 on success.
2594
2595 tip
2596 hg tip [-p] [-g]
2597
2598 The tip revision (usually just called the tip) is the changeset most
2599 recently added to the repository (and therefore the most recently
2600 changed head).
2601
2602 If you have just made a commit, that commit will be the tip. If you
2603 have just pulled changes from another repository, the tip of that
2604 repository becomes the current tip. The "tip" tag is special and cannot
2605 be renamed or assigned to a different changeset.
2606
2607 Returns 0 on success.
2608
2609 Options:
2610
2611 -p, --patch
2612 show patch
2613
2614 -g, --git
2615 use git extended diff format
2616
2617 --style
2618 display using template map file
2619
2620 --template
2621 display with template
2622
2623 unbundle
2624 hg unbundle [-u] FILE...
2625
2626 Apply one or more compressed changegroup files generated by the bundle
2627 command.
2628
2629 Returns 0 on success, 1 if an update has unresolved files.
2630
2631 Options:
2632
2633 -u, --update
2634 update to new branch head if changesets were unbundled
2635
2636 update
2637 hg update [-c] [-C] [-d DATE] [[-r] REV]
2638
2639 Update the repository's working directory to the specified changeset.
2640 If no changeset is specified, update to the tip of the current named
2641 branch and move the current bookmark (see hg help bookmarks).
2642
2643 Update sets the working directory's parent revision to the specified
2644 changeset (see hg help parents).
2645
2646 If the changeset is not a descendant or ancestor of the working direc‐
2647 tory's parent, the update is aborted. With the -c/--check option, the
2648 working directory is checked for uncommitted changes; if none are
2649 found, the working directory is updated to the specified changeset.
2650
2651 The following rules apply when the working directory contains uncommit‐
2652 ted changes:
2653
2654 1. If neither -c/--check nor -C/--clean is specified, and if the
2655 requested changeset is an ancestor or descendant of the working
2656 directory's parent, the uncommitted changes are merged into the
2657 requested changeset and the merged result is left uncommitted. If
2658 the requested changeset is not an ancestor or descendant (that is,
2659 it is on another branch), the update is aborted and the uncommitted
2660 changes are preserved.
2661
2662 2. With the -c/--check option, the update is aborted and the uncommit‐
2663 ted changes are preserved.
2664
2665 3. With the -C/--clean option, uncommitted changes are discarded and
2666 the working directory is updated to the requested changeset.
2667
2668 To cancel an uncommitted merge (and lose your changes), use hg update
2669 --clean ..
2670
2671 Use null as the changeset to remove the working directory (like hg
2672 clone -U).
2673
2674 If you want to revert just one file to an older revision, use hg revert
2675 [-r REV] NAME.
2676
2677 See hg help dates for a list of formats valid for -d/--date.
2678
2679 Returns 0 on success, 1 if there are unresolved files.
2680
2681 Options:
2682
2683 -C, --clean
2684 discard uncommitted changes (no backup)
2685
2686 -c, --check
2687 update across branches if no uncommitted changes
2688
2689 -d, --date
2690 tipmost revision matching date
2691
2692 -r, --rev
2693 revision
2694
2695 aliases: up checkout co
2696
2697 verify
2698 hg verify
2699
2700 Verify the integrity of the current repository.
2701
2702 This will perform an extensive check of the repository's integrity,
2703 validating the hashes and checksums of each entry in the changelog,
2704 manifest, and tracked files, as well as the integrity of their
2705 crosslinks and indices.
2706
2707 Please see http://mercurial.selenic.com/wiki/RepositoryCorruption for
2708 more information about recovery from corruption of the repository.
2709
2710 Returns 0 on success, 1 if errors are encountered.
2711
2712 version
2713 hg version
2714
2715 output version and copyright information
2716
2718 Some commands allow the user to specify a date, e.g.:
2719
2720 · backout, commit, import, tag: Specify the commit date.
2721
2722 · log, revert, update: Select revision(s) by date.
2723
2724 Many date formats are valid. Here are some examples:
2725
2726 · Wed Dec 6 13:18:29 2006 (local timezone assumed)
2727
2728 · Dec 6 13:18 -0600 (year assumed, time offset provided)
2729
2730 · Dec 6 13:18 UTC (UTC and GMT are aliases for +0000)
2731
2732 · Dec 6 (midnight)
2733
2734 · 13:18 (today assumed)
2735
2736 · 3:39 (3:39AM assumed)
2737
2738 · 3:39pm (15:39)
2739
2740 · 2006-12-06 13:18:29 (ISO 8601 format)
2741
2742 · 2006-12-6 13:18
2743
2744 · 2006-12-6
2745
2746 · 12-6
2747
2748 · 12/6
2749
2750 · 12/6/6 (Dec 6 2006)
2751
2752 · today (midnight)
2753
2754 · yesterday (midnight)
2755
2756 · now - right now
2757
2758 Lastly, there is Mercurial's internal format:
2759
2760 · 1165432709 0 (Wed Dec 6 13:18:29 2006 UTC)
2761
2762 This is the internal representation format for dates. The first number
2763 is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
2764 second is the offset of the local timezone, in seconds west of UTC
2765 (negative if the timezone is east of UTC).
2766
2767 The log command also accepts date ranges:
2768
2769 · <DATE - at or before a given date/time
2770
2771 · >DATE - on or after a given date/time
2772
2773 · DATE to DATE - a date range, inclusive
2774
2775 · -DAYS - within a given number of days of today
2776
2778 Mercurial's default format for showing changes between two versions of
2779 a file is compatible with the unified format of GNU diff, which can be
2780 used by GNU patch and many other standard tools.
2781
2782 While this standard format is often enough, it does not encode the fol‐
2783 lowing information:
2784
2785 · executable status and other permission bits
2786
2787 · copy or rename information
2788
2789 · changes in binary files
2790
2791 · creation or deletion of empty files
2792
2793 Mercurial also supports the extended diff format from the git VCS which
2794 addresses these limitations. The git diff format is not produced by
2795 default because a few widespread tools still do not understand this
2796 format.
2797
2798 This means that when generating diffs from a Mercurial repository (e.g.
2799 with hg export), you should be careful about things like file copies
2800 and renames or other things mentioned above, because when applying a
2801 standard diff to a different repository, this extra information is
2802 lost. Mercurial's internal operations (like push and pull) are not
2803 affected by this, because they use an internal binary format for commu‐
2804 nicating changes.
2805
2806 To make Mercurial produce the git extended diff format, use the --git
2807 option available for many commands, or set 'git = True' in the [diff]
2808 section of your configuration file. You do not need to set this option
2809 when importing diffs in this format or using them in the mq extension.
2810
2812 HG Path to the 'hg' executable, automatically passed when running
2813 hooks, extensions or external tools. If unset or empty, this is
2814 the hg executable's name if it's frozen, or an executable named
2815 'hg' (with %PATHEXT% [defaulting to COM/EXE/BAT/CMD] extensions
2816 on Windows) is searched.
2817
2818 HGEDITOR
2819 This is the name of the editor to run when committing. See EDI‐
2820 TOR.
2821
2822 (deprecated, use configuration file)
2823
2824 HGENCODING
2825 This overrides the default locale setting detected by Mercurial.
2826 This setting is used to convert data including usernames,
2827 changeset descriptions, tag names, and branches. This setting
2828 can be overridden with the --encoding command-line option.
2829
2830 HGENCODINGMODE
2831 This sets Mercurial's behavior for handling unknown characters
2832 while transcoding user input. The default is "strict", which
2833 causes Mercurial to abort if it can't map a character. Other
2834 settings include "replace", which replaces unknown characters,
2835 and "ignore", which drops them. This setting can be overridden
2836 with the --encodingmode command-line option.
2837
2838 HGENCODINGAMBIGUOUS
2839 This sets Mercurial's behavior for handling characters with
2840 "ambiguous" widths like accented Latin characters with East
2841 Asian fonts. By default, Mercurial assumes ambiguous characters
2842 are narrow, set this variable to "wide" if such characters cause
2843 formatting problems.
2844
2845 HGMERGE
2846 An executable to use for resolving merge conflicts. The program
2847 will be executed with three arguments: local file, remote file,
2848 ancestor file.
2849
2850 (deprecated, use configuration file)
2851
2852 HGRCPATH
2853 A list of files or directories to search for configuration
2854 files. Item separator is ":" on Unix, ";" on Windows. If HGRC‐
2855 PATH is not set, platform default search path is used. If empty,
2856 only the .hg/hgrc from the current repository is read.
2857
2858 For each element in HGRCPATH:
2859
2860 · if it's a directory, all files ending with .rc are added
2861
2862 · otherwise, the file itself will be added
2863
2864 HGPLAIN
2865 When set, this disables any configuration settings that might
2866 change Mercurial's default output. This includes encoding,
2867 defaults, verbose mode, debug mode, quiet mode, tracebacks, and
2868 localization. This can be useful when scripting against Mercu‐
2869 rial in the face of existing user configuration.
2870
2871 Equivalent options set via command line flags or environment
2872 variables are not overridden.
2873
2874 HGPLAINEXCEPT
2875 This is a comma-separated list of features to preserve when
2876 HGPLAIN is enabled. Currently the only value supported is
2877 "i18n", which preserves internationalization in plain mode.
2878
2879 Setting HGPLAINEXCEPT to anything (even an empty string) will
2880 enable plain mode.
2881
2882 HGUSER This is the string used as the author of a commit. If not set,
2883 available values will be considered in this order:
2884
2885 · HGUSER (deprecated)
2886
2887 · configuration files from the HGRCPATH
2888
2889 · EMAIL
2890
2891 · interactive prompt
2892
2893 · LOGNAME (with @hostname appended)
2894
2895 (deprecated, use configuration file)
2896
2897 EMAIL May be used as the author of a commit; see HGUSER.
2898
2899 LOGNAME
2900 May be used as the author of a commit; see HGUSER.
2901
2902 VISUAL This is the name of the editor to use when committing. See EDI‐
2903 TOR.
2904
2905 EDITOR Sometimes Mercurial needs to open a text file in an editor for a
2906 user to modify, for example when writing commit messages. The
2907 editor it uses is determined by looking at the environment vari‐
2908 ables HGEDITOR, VISUAL and EDITOR, in that order. The first
2909 non-empty one is chosen. If all of them are empty, the editor
2910 defaults to 'vi'.
2911
2912 PYTHONPATH
2913 This is used by Python to find imported modules and may need to
2914 be set appropriately if this Mercurial is not installed sys‐
2915 tem-wide.
2916
2918 Mercurial has the ability to add new features through the use of exten‐
2919 sions. Extensions may add new commands, add options to existing com‐
2920 mands, change the default behavior of commands, or implement hooks.
2921
2922 Extensions are not loaded by default for a variety of reasons: they can
2923 increase startup overhead; they may be meant for advanced usage only;
2924 they may provide potentially dangerous abilities (such as letting you
2925 destroy or modify history); they might not be ready for prime time; or
2926 they may alter some usual behaviors of stock Mercurial. It is thus up
2927 to the user to activate extensions as needed.
2928
2929 To enable the "foo" extension, either shipped with Mercurial or in the
2930 Python search path, create an entry for it in your configuration file,
2931 like this:
2932
2933 [extensions]
2934 foo =
2935
2936 You may also specify the full path to an extension:
2937
2938 [extensions]
2939 myfeature = ~/.hgext/myfeature.py
2940
2941 To explicitly disable an extension enabled in a configuration file of
2942 broader scope, prepend its path with !:
2943
2944 [extensions]
2945 # disabling extension bar residing in /path/to/extension/bar.py
2946 bar = !/path/to/extension/bar.py
2947 # ditto, but no path was supplied for extension baz
2948 baz = !
2949
2950 disabled extensions:
2951
2952 acl hooks for controlling repository access
2953
2954 blackbox
2955 log repository events to a blackbox for debugging
2956
2957 bugzilla
2958 hooks for integrating with the Bugzilla bug tracker
2959
2960 children
2961 command to display child changesets (DEPRECATED)
2962
2963 churn command to display statistics about repository history
2964
2965 color colorize output from some commands
2966
2967 convert
2968 import revisions from foreign VCS repositories into Mercurial
2969
2970 eol automatically manage newlines in repository files
2971
2972 extdiff
2973 command to allow external programs to compare revisions
2974
2975 factotum
2976 http authentication with factotum
2977
2978 fetch pull, update and merge in one command (DEPRECATED)
2979
2980 gpg commands to sign and verify changesets
2981
2982 graphlog
2983 command to view revision graphs from a shell
2984
2985 hgcia hooks for integrating with the CIA.vc notification service
2986
2987 hgk browse the repository in a graphical way
2988
2989 highlight
2990 syntax highlighting for hgweb (requires Pygments)
2991
2992 histedit
2993 interactive history editing
2994
2995 inotify
2996 accelerate status report using Linux's inotify service
2997
2998 interhg
2999 expand expressions into changelog and summaries
3000
3001 keyword
3002 expand keywords in tracked files
3003
3004 largefiles
3005 track large binary files
3006
3007 mq manage a stack of patches
3008
3009 notify hooks for sending email push notifications
3010
3011 pager browse command output with an external pager
3012
3013 patchbomb
3014 command to send changesets as (a series of) patch emails
3015
3016 progress
3017 show progress bars for some actions
3018
3019 purge command to delete untracked files from the working directory
3020
3021 rebase command to move sets of revisions to a different ancestor
3022
3023 record commands to interactively select changes for commit/qrefresh
3024
3025 relink recreates hardlinks between repository clones
3026
3027 schemes
3028 extend schemes with shortcuts to repository swarms
3029
3030 share share a common history between several working directories
3031
3032 transplant
3033 command to transplant changesets from another branch
3034
3035 win32mbcs
3036 allow the use of MBCS paths with problematic encodings
3037
3038 win32text
3039 perform automatic newline conversion
3040
3041 zeroconf
3042 discover and advertise repositories on the local network
3043
3045 Mercurial supports a functional language for selecting a set of files.
3046
3047 Like other file patterns, this pattern type is indicated by a prefix,
3048 'set:'. The language supports a number of predicates which are joined
3049 by infix operators. Parenthesis can be used for grouping.
3050
3051 Identifiers such as filenames or patterns must be quoted with single or
3052 double quotes if they contain characters outside of
3053 [.*{}[]?/\_a-zA-Z0-9\x80-\xff] or if they match one of the predefined
3054 predicates. This generally applies to file patterns other than globs
3055 and arguments for predicates.
3056
3057 Special characters can be used in quoted identifiers by escaping them,
3058 e.g., \n is interpreted as a newline. To prevent them from being inter‐
3059 preted, strings can be prefixed with r, e.g. r'...'.
3060
3061 There is a single prefix operator:
3062
3063 not x
3064
3065 Files not in x. Short form is ! x.
3066
3067 These are the supported infix operators:
3068
3069 x and y
3070
3071 The intersection of files in x and y. Short form is x & y.
3072
3073 x or y
3074
3075 The union of files in x and y. There are two alternative short
3076 forms: x | y and x + y.
3077
3078 x - y
3079
3080 Files in x but not in y.
3081
3082 The following predicates are supported:
3083
3084 added()
3085
3086 File that is added according to status.
3087
3088 binary()
3089
3090 File that appears to be binary (contains NUL bytes).
3091
3092 clean()
3093
3094 File that is clean according to status.
3095
3096 copied()
3097
3098 File that is recorded as being copied.
3099
3100 deleted()
3101
3102 File that is deleted according to status.
3103
3104 encoding(name)
3105
3106 File can be successfully decoded with the given character encod‐
3107 ing. May not be useful for encodings other than ASCII and UTF-8.
3108
3109 eol(style)
3110
3111 File contains newlines of the given style (dos, unix, mac).
3112 Binary files are excluded, files with mixed line endings match
3113 multiple styles.
3114
3115 exec()
3116
3117 File that is marked as executable.
3118
3119 grep(regex)
3120
3121 File contains the given regular expression.
3122
3123 hgignore()
3124
3125 File that matches the active .hgignore pattern.
3126
3127 ignored()
3128
3129 File that is ignored according to status. These files will only
3130 be considered if this predicate is used.
3131
3132 modified()
3133
3134 File that is modified according to status.
3135
3136 removed()
3137
3138 File that is removed according to status.
3139
3140 resolved()
3141
3142 File that is marked resolved according to the resolve state.
3143
3144 size(expression)
3145
3146 File size matches the given expression. Examples:
3147
3148 · 1k (files from 1024 to 2047 bytes)
3149
3150 · < 20k (files less than 20480 bytes)
3151
3152 · >= .5MB (files at least 524288 bytes)
3153
3154 · 4k - 1MB (files from 4096 bytes to 1048576 bytes)
3155
3156 subrepo([pattern])
3157
3158 Subrepositories whose paths match the given pattern.
3159
3160 symlink()
3161
3162 File that is marked as a symlink.
3163
3164 unknown()
3165
3166 File that is unknown according to status. These files will only
3167 be considered if this predicate is used.
3168
3169 unresolved()
3170
3171 File that is marked unresolved according to the resolve state.
3172
3173 Some sample queries:
3174
3175 · Show status of files that appear to be binary in the working direc‐
3176 tory:
3177
3178 hg status -A "set:binary()"
3179
3180 · Forget files that are in .hgignore but are already tracked:
3181
3182 hg forget "set:hgignore() and not ignored()"
3183
3184 · Find text files that contain a string:
3185
3186 hg locate "set:grep(magic) and not binary()"
3187
3188 · Find C files in a non-standard encoding:
3189
3190 hg locate "set:**.c and not encoding('UTF-8')"
3191
3192 · Revert copies of large binary files:
3193
3194 hg revert "set:copied() and binary() and size('>1M')"
3195
3196 · Remove files listed in foo.lst that contain the letter a or b:
3197
3198 hg remove "set: 'listfile:foo.lst' and (**a* or **b*)"
3199
3200 See also hg help patterns.
3201
3203 Ancestor
3204 Any changeset that can be reached by an unbroken chain of parent
3205 changesets from a given changeset. More precisely, the ancestors
3206 of a changeset can be defined by two properties: a parent of a
3207 changeset is an ancestor, and a parent of an ancestor is an
3208 ancestor. See also: 'Descendant'.
3209
3210 Bookmark
3211 Bookmarks are pointers to certain commits that move when commit‐
3212 ting. They are similar to tags in that it is possible to use
3213 bookmark names in all places where Mercurial expects a changeset
3214 ID, e.g., with hg update. Unlike tags, bookmarks move along when
3215 you make a commit.
3216
3217 Bookmarks can be renamed, copied and deleted. Bookmarks are
3218 local, unless they are explicitly pushed or pulled between
3219 repositories. Pushing and pulling bookmarks allow you to col‐
3220 laborate with others on a branch without creating a named
3221 branch.
3222
3223 Branch (Noun) A child changeset that has been created from a parent
3224 that is not a head. These are known as topological branches, see
3225 'Branch, topological'. If a topological branch is named, it
3226 becomes a named branch. If a topological branch is not named, it
3227 becomes an anonymous branch. See 'Branch, anonymous' and
3228 'Branch, named'.
3229
3230 Branches may be created when changes are pulled from or pushed
3231 to a remote repository, since new heads may be created by these
3232 operations. Note that the term branch can also be used infor‐
3233 mally to describe a development process in which certain devel‐
3234 opment is done independently of other development. This is some‐
3235 times done explicitly with a named branch, but it can also be
3236 done locally, using bookmarks or clones and anonymous branches.
3237
3238 Example: "The experimental branch".
3239
3240 (Verb) The action of creating a child changeset which results in
3241 its parent having more than one child.
3242
3243 Example: "I'm going to branch at X".
3244
3245 Branch, anonymous
3246 Every time a new child changeset is created from a parent that
3247 is not a head and the name of the branch is not changed, a new
3248 anonymous branch is created.
3249
3250 Branch, closed
3251 A named branch whose branch heads have all been closed.
3252
3253 Branch, default
3254 The branch assigned to a changeset when no name has previously
3255 been assigned.
3256
3257 Branch head
3258 See 'Head, branch'.
3259
3260 Branch, inactive
3261 If a named branch has no topological heads, it is considered to
3262 be inactive. As an example, a feature branch becomes inactive
3263 when it is merged into the default branch. The hg branches com‐
3264 mand shows inactive branches by default, though they can be hid‐
3265 den with hg branches --active.
3266
3267 NOTE: this concept is deprecated because it is too implicit.
3268 Branches should now be explicitly closed using hg commit
3269 --close-branch when they are no longer needed.
3270
3271 Branch, named
3272 A collection of changesets which have the same branch name. By
3273 default, children of a changeset in a named branch belong to the
3274 same named branch. A child can be explicitly assigned to a dif‐
3275 ferent branch. See hg help branch, hg help branches and hg com‐
3276 mit --close-branch for more information on managing branches.
3277
3278 Named branches can be thought of as a kind of namespace, divid‐
3279 ing the collection of changesets that comprise the repository
3280 into a collection of disjoint subsets. A named branch is not
3281 necessarily a topological branch. If a new named branch is cre‐
3282 ated from the head of another named branch, or the default
3283 branch, but no further changesets are added to that previous
3284 branch, then that previous branch will be a branch in name only.
3285
3286 Branch tip
3287 See 'Tip, branch'.
3288
3289 Branch, topological
3290 Every time a new child changeset is created from a parent that
3291 is not a head, a new topological branch is created. If a topo‐
3292 logical branch is named, it becomes a named branch. If a topo‐
3293 logical branch is not named, it becomes an anonymous branch of
3294 the current, possibly default, branch.
3295
3296 Changelog
3297 A record of the changesets in the order in which they were added
3298 to the repository. This includes details such as changeset id,
3299 author, commit message, date, and list of changed files.
3300
3301 Changeset
3302 A snapshot of the state of the repository used to record a
3303 change.
3304
3305 Changeset, child
3306 The converse of parent changeset: if P is a parent of C, then C
3307 is a child of P. There is no limit to the number of children
3308 that a changeset may have.
3309
3310 Changeset id
3311 A SHA-1 hash that uniquely identifies a changeset. It may be
3312 represented as either a "long" 40 hexadecimal digit string, or a
3313 "short" 12 hexadecimal digit string.
3314
3315 Changeset, merge
3316 A changeset with two parents. This occurs when a merge is com‐
3317 mitted.
3318
3319 Changeset, parent
3320 A revision upon which a child changeset is based. Specifically,
3321 a parent changeset of a changeset C is a changeset whose node
3322 immediately precedes C in the DAG. Changesets have at most two
3323 parents.
3324
3325 Checkout
3326 (Noun) The working directory being updated to a specific revi‐
3327 sion. This use should probably be avoided where possible, as
3328 changeset is much more appropriate than checkout in this con‐
3329 text.
3330
3331 Example: "I'm using checkout X."
3332
3333 (Verb) Updating the working directory to a specific changeset.
3334 See hg help update.
3335
3336 Example: "I'm going to check out changeset X."
3337
3338 Child changeset
3339 See 'Changeset, child'.
3340
3341 Close changeset
3342 See 'Head, closed branch'
3343
3344 Closed branch
3345 See 'Branch, closed'.
3346
3347 Clone (Noun) An entire or partial copy of a repository. The partial
3348 clone must be in the form of a revision and its ancestors.
3349
3350 Example: "Is your clone up to date?".
3351
3352 (Verb) The process of creating a clone, using hg clone.
3353
3354 Example: "I'm going to clone the repository".
3355
3356 Closed branch head
3357 See 'Head, closed branch'.
3358
3359 Commit (Noun) A synonym for changeset.
3360
3361 Example: "Is the bug fixed in your recent commit?"
3362
3363 (Verb) The act of recording changes to a repository. When files
3364 are committed in a working directory, Mercurial finds the dif‐
3365 ferences between the committed files and their parent changeset,
3366 creating a new changeset in the repository.
3367
3368 Example: "You should commit those changes now."
3369
3370 Cset A common abbreviation of the term changeset.
3371
3372 DAG The repository of changesets of a distributed version control
3373 system (DVCS) can be described as a directed acyclic graph
3374 (DAG), consisting of nodes and edges, where nodes correspond to
3375 changesets and edges imply a parent -> child relation. This
3376 graph can be visualized by graphical tools such as hg glog
3377 (graphlog). In Mercurial, the DAG is limited by the requirement
3378 for children to have at most two parents.
3379
3380 Default branch
3381 See 'Branch, default'.
3382
3383 Descendant
3384 Any changeset that can be reached by a chain of child changesets
3385 from a given changeset. More precisely, the descendants of a
3386 changeset can be defined by two properties: the child of a
3387 changeset is a descendant, and the child of a descendant is a
3388 descendant. See also: 'Ancestor'.
3389
3390 Diff (Noun) The difference between the contents and attributes of
3391 files in two changesets or a changeset and the current working
3392 directory. The difference is usually represented in a standard
3393 form called a "diff" or "patch". The "git diff" format is used
3394 when the changes include copies, renames, or changes to file
3395 attributes, none of which can be represented/handled by classic
3396 "diff" and "patch".
3397
3398 Example: "Did you see my correction in the diff?"
3399
3400 (Verb) Diffing two changesets is the action of creating a diff
3401 or patch.
3402
3403 Example: "If you diff with changeset X, you will see what I
3404 mean."
3405
3406 Directory, working
3407 The working directory represents the state of the files tracked
3408 by Mercurial, that will be recorded in the next commit. The
3409 working directory initially corresponds to the snapshot at an
3410 existing changeset, known as the parent of the working direc‐
3411 tory. See 'Parent, working directory'. The state may be modified
3412 by changes to the files introduced manually or by a merge. The
3413 repository metadata exists in the .hg directory inside the work‐
3414 ing directory.
3415
3416 Draft Changesets in the draft phase have not been shared with publish‐
3417 ing repositories and may thus be safely changed by history-modi‐
3418 fying extensions. See hg help phases.
3419
3420 Graph See DAG and hg help graphlog.
3421
3422 Head The term 'head' may be used to refer to both a branch head or a
3423 repository head, depending on the context. See 'Head, branch'
3424 and 'Head, repository' for specific definitions.
3425
3426 Heads are where development generally takes place and are the
3427 usual targets for update and merge operations.
3428
3429 Head, branch
3430 A changeset with no descendants on the same named branch.
3431
3432 Head, closed branch
3433 A changeset that marks a head as no longer interesting. The
3434 closed head is no longer listed by hg heads. A branch is consid‐
3435 ered closed when all its heads are closed and consequently is
3436 not listed by hg branches.
3437
3438 Closed heads can be re-opened by committing new changeset as the
3439 child of the changeset that marks a head as closed.
3440
3441 Head, repository
3442 A topological head which has not been closed.
3443
3444 Head, topological
3445 A changeset with no children in the repository.
3446
3447 History, immutable
3448 Once committed, changesets cannot be altered. Extensions which
3449 appear to change history actually create new changesets that
3450 replace existing ones, and then destroy the old changesets.
3451 Doing so in public repositories can result in old changesets
3452 being reintroduced to the repository.
3453
3454 History, rewriting
3455 The changesets in a repository are immutable. However, exten‐
3456 sions to Mercurial can be used to alter the repository, usually
3457 in such a way as to preserve changeset contents.
3458
3459 Immutable history
3460 See 'History, immutable'.
3461
3462 Merge changeset
3463 See 'Changeset, merge'.
3464
3465 Manifest
3466 Each changeset has a manifest, which is the list of files that
3467 are tracked by the changeset.
3468
3469 Merge Used to bring together divergent branches of work. When you
3470 update to a changeset and then merge another changeset, you
3471 bring the history of the latter changeset into your working
3472 directory. Once conflicts are resolved (and marked), this merge
3473 may be committed as a merge changeset, bringing two branches
3474 together in the DAG.
3475
3476 Named branch
3477 See 'Branch, named'.
3478
3479 Null changeset
3480 The empty changeset. It is the parent state of newly-initialized
3481 repositories and repositories with no checked out revision. It
3482 is thus the parent of root changesets and the effective ancestor
3483 when merging unrelated changesets. Can be specified by the alias
3484 'null' or by the changeset ID '000000000000'.
3485
3486 Parent See 'Changeset, parent'.
3487
3488 Parent changeset
3489 See 'Changeset, parent'.
3490
3491 Parent, working directory
3492 The working directory parent reflects a virtual revision which
3493 is the child of the changeset (or two changesets with an uncom‐
3494 mitted merge) shown by hg parents. This is changed with hg
3495 update. Other commands to see the working directory parent are
3496 hg summary and hg id. Can be specified by the alias ".".
3497
3498 Patch (Noun) The product of a diff operation.
3499
3500 Example: "I've sent you my patch."
3501
3502 (Verb) The process of using a patch file to transform one
3503 changeset into another.
3504
3505 Example: "You will need to patch that revision."
3506
3507 Phase A per-changeset state tracking how the changeset has been or
3508 should be shared. See hg help phases.
3509
3510 Public Changesets in the public phase have been shared with publishing
3511 repositories and are therefore considered immutable. See hg help
3512 phases.
3513
3514 Pull An operation in which changesets in a remote repository which
3515 are not in the local repository are brought into the local
3516 repository. Note that this operation without special arguments
3517 only updates the repository, it does not update the files in the
3518 working directory. See hg help pull.
3519
3520 Push An operation in which changesets in a local repository which are
3521 not in a remote repository are sent to the remote repository.
3522 Note that this operation only adds changesets which have been
3523 committed locally to the remote repository. Uncommitted changes
3524 are not sent. See hg help push.
3525
3526 Repository
3527 The metadata describing all recorded states of a collection of
3528 files. Each recorded state is represented by a changeset. A
3529 repository is usually (but not always) found in the .hg subdi‐
3530 rectory of a working directory. Any recorded state can be recre‐
3531 ated by "updating" a working directory to a specific changeset.
3532
3533 Repository head
3534 See 'Head, repository'.
3535
3536 Revision
3537 A state of the repository at some point in time. Earlier revi‐
3538 sions can be updated to by using hg update. See also 'Revision
3539 number'; See also 'Changeset'.
3540
3541 Revision number
3542 This integer uniquely identifies a changeset in a specific
3543 repository. It represents the order in which changesets were
3544 added to a repository, starting with revision number 0. Note
3545 that the revision number may be different in each clone of a
3546 repository. To identify changesets uniquely between different
3547 clones, see 'Changeset id'.
3548
3549 Revlog History storage mechanism used by Mercurial. It is a form of
3550 delta encoding, with occasional full revision of data followed
3551 by delta of each successive revision. It includes data and an
3552 index pointing to the data.
3553
3554 Rewriting history
3555 See 'History, rewriting'.
3556
3557 Root A changeset that has only the null changeset as its parent. Most
3558 repositories have only a single root changeset.
3559
3560 Secret Changesets in the secret phase may not be shared via push, pull,
3561 or clone. See hg help phases.
3562
3563 Tag An alternative name given to a changeset. Tags can be used in
3564 all places where Mercurial expects a changeset ID, e.g., with hg
3565 update. The creation of a tag is stored in the history and will
3566 thus automatically be shared with other using push and pull.
3567
3568 Tip The changeset with the highest revision number. It is the
3569 changeset most recently added in a repository.
3570
3571 Tip, branch
3572 The head of a given branch with the highest revision number.
3573 When a branch name is used as a revision identifier, it refers
3574 to the branch tip. See also 'Branch, head'. Note that because
3575 revision numbers may be different in different repository
3576 clones, the branch tip may be different in different cloned
3577 repositories.
3578
3579 Update (Noun) Another synonym of changeset.
3580
3581 Example: "I've pushed an update".
3582
3583 (Verb) This term is usually used to describe updating the state
3584 of the working directory to that of a specific changeset. See hg
3585 help update.
3586
3587 Example: "You should update".
3588
3589 Working directory
3590 See 'Directory, working'.
3591
3592 Working directory parent
3593 See 'Parent, working directory'.
3594
3596 Synopsis
3597 The Mercurial system uses a file called .hgignore in the root directory
3598 of a repository to control its behavior when it searches for files that
3599 it is not currently tracking.
3600
3601 Description
3602 The working directory of a Mercurial repository will often contain
3603 files that should not be tracked by Mercurial. These include backup
3604 files created by editors and build products created by compilers.
3605 These files can be ignored by listing them in a .hgignore file in the
3606 root of the working directory. The .hgignore file must be created manu‐
3607 ally. It is typically put under version control, so that the settings
3608 will propagate to other repositories with push and pull.
3609
3610 An untracked file is ignored if its path relative to the repository
3611 root directory, or any prefix path of that path, is matched against any
3612 pattern in .hgignore.
3613
3614 For example, say we have an untracked file, file.c, at a/b/file.c
3615 inside our repository. Mercurial will ignore file.c if any pattern in
3616 .hgignore matches a/b/file.c, a/b or a.
3617
3618 In addition, a Mercurial configuration file can reference a set of
3619 per-user or global ignore files. See the ignore configuration key on
3620 the [ui] section of hg help config for details of how to configure
3621 these files.
3622
3623 To control Mercurial's handling of files that it manages, many commands
3624 support the -I and -X options; see hg help <command> and hg help pat‐
3625 terns for details.
3626
3627 Files that are already tracked are not affected by .hgignore, even if
3628 they appear in .hgignore. An untracked file X can be explicitly added
3629 with hg add X, even if X would be excluded by a pattern in .hgignore.
3630
3631 Syntax
3632 An ignore file is a plain text file consisting of a list of patterns,
3633 with one pattern per line. Empty lines are skipped. The # character is
3634 treated as a comment character, and the \ character is treated as an
3635 escape character.
3636
3637 Mercurial supports several pattern syntaxes. The default syntax used is
3638 Python/Perl-style regular expressions.
3639
3640 To change the syntax used, use a line of the following form:
3641
3642 syntax: NAME
3643
3644 where NAME is one of the following:
3645
3646 regexp
3647
3648 Regular expression, Python/Perl syntax.
3649
3650 glob
3651
3652 Shell-style glob.
3653
3654 The chosen syntax stays in effect when parsing all patterns that fol‐
3655 low, until another syntax is selected.
3656
3657 Neither glob nor regexp patterns are rooted. A glob-syntax pattern of
3658 the form *.c will match a file ending in .c in any directory, and a
3659 regexp pattern of the form \.c$ will do the same. To root a regexp pat‐
3660 tern, start it with ^.
3661
3662 Note Patterns specified in other than .hgignore are always rooted.
3663 Please see hg help patterns for details.
3664
3665 Example
3666 Here is an example ignore file.
3667
3668 # use glob syntax.
3669 syntax: glob
3670
3671 *.elc
3672 *.pyc
3673 *~
3674
3675 # switch to regexp syntax.
3676 syntax: regexp
3677 ^\.pc/
3678
3680 Mercurial's internal web server, hgweb, can serve either a single
3681 repository, or a tree of repositories. In the second case, repository
3682 paths and global options can be defined using a dedicated configuration
3683 file common to hg serve, hgweb.wsgi, hgweb.cgi and hgweb.fcgi.
3684
3685 This file uses the same syntax as other Mercurial configuration files
3686 but recognizes only the following sections:
3687
3688 · web
3689
3690 · paths
3691
3692 · collections
3693
3694 The web options are thoroughly described in hg help config.
3695
3696 The paths section maps URL paths to paths of repositories in the
3697 filesystem. hgweb will not expose the filesystem directly - only Mercu‐
3698 rial repositories can be published and only according to the configura‐
3699 tion.
3700
3701 The left hand side is the path in the URL. Note that hgweb reserves
3702 subpaths like rev or file, try using different names for nested reposi‐
3703 tories to avoid confusing effects.
3704
3705 The right hand side is the path in the filesystem. If the specified
3706 path ends with * or ** the filesystem will be searched recursively for
3707 repositories below that point. With * it will not recurse into the
3708 repositories it finds (except for .hg/patches). With ** it will also
3709 search inside repository working directories and possibly find sub‐
3710 repositories.
3711
3712 In this example:
3713
3714 [paths]
3715 /projects/a = /srv/tmprepos/a
3716 /projects/b = c:/repos/b
3717 / = /srv/repos/*
3718 /user/bob = /home/bob/repos/**
3719
3720 · The first two entries make two repositories in different directories
3721 appear under the same directory in the web interface
3722
3723 · The third entry will publish every Mercurial repository found in
3724 /srv/repos/, for instance the repository /srv/repos/quux/ will appear
3725 as http://server/quux/
3726
3727 · The fourth entry will publish both http://server/user/bob/quux/ and
3728 http://server/user/bob/quux/testsubrepo/
3729
3730 The collections section is deprecated and has been superseded by paths.
3731
3733 To merge files Mercurial uses merge tools.
3734
3735 A merge tool combines two different versions of a file into a merged
3736 file. Merge tools are given the two files and the greatest common
3737 ancestor of the two file versions, so they can determine the changes
3738 made on both branches.
3739
3740 Merge tools are used both for hg resolve, hg merge, hg update, hg back‐
3741 out and in several extensions.
3742
3743 Usually, the merge tool tries to automatically reconcile the files by
3744 combining all non-overlapping changes that occurred separately in the
3745 two different evolutions of the same initial base file. Furthermore,
3746 some interactive merge programs make it easier to manually resolve con‐
3747 flicting merges, either in a graphical way, or by inserting some con‐
3748 flict markers. Mercurial does not include any interactive merge pro‐
3749 grams but relies on external tools for that.
3750
3751 Available merge tools
3752 External merge tools and their properties are configured in the
3753 merge-tools configuration section - see hgrc(5) - but they can often
3754 just be named by their executable.
3755
3756 A merge tool is generally usable if its executable can be found on the
3757 system and if it can handle the merge. The executable is found if it is
3758 an absolute or relative executable path or the name of an application
3759 in the executable search path. The tool is assumed to be able to handle
3760 the merge if it can handle symlinks if the file is a symlink, if it can
3761 handle binary files if the file is binary, and if a GUI is available if
3762 the tool requires a GUI.
3763
3764 There are some internal merge tools which can be used. The internal
3765 merge tools are:
3766
3767 internal:dump
3768
3769 Creates three versions of the files to merge, containing the
3770 contents of local, other and base. These files can then be used
3771 to perform a merge manually. If the file to be merged is named
3772 a.txt, these files will accordingly be named a.txt.local,
3773 a.txt.other and a.txt.base and they will be placed in the same
3774 directory as a.txt.
3775
3776 internal:fail
3777
3778 Rather than attempting to merge files that were modified on both
3779 branches, it marks them as unresolved. The resolve command must
3780 be used to resolve these conflicts.
3781
3782 internal:local
3783
3784 Uses the local version of files as the merged version.
3785
3786 internal:merge
3787
3788 Uses the internal non-interactive simple merge algorithm for
3789 merging files. It will fail if there are any conflicts and leave
3790 markers in the partially merged file.
3791
3792 internal:other
3793
3794 Uses the other version of files as the merged version.
3795
3796 internal:prompt
3797
3798 Asks the user which of the local or the other version to keep as
3799 the merged version.
3800
3801 Internal tools are always available and do not require a GUI but will
3802 by default not handle symlinks or binary files.
3803
3804 Choosing a merge tool
3805 Mercurial uses these rules when deciding which merge tool to use:
3806
3807 1. If a tool has been specified with the --tool option to merge or
3808 resolve, it is used. If it is the name of a tool in the merge-tools
3809 configuration, its configuration is used. Otherwise the specified
3810 tool must be executable by the shell.
3811
3812 2. If the HGMERGE environment variable is present, its value is used
3813 and must be executable by the shell.
3814
3815 3. If the filename of the file to be merged matches any of the patterns
3816 in the merge-patterns configuration section, the first usable merge
3817 tool corresponding to a matching pattern is used. Here, binary capa‐
3818 bilities of the merge tool are not considered.
3819
3820 4. If ui.merge is set it will be considered next. If the value is not
3821 the name of a configured tool, the specified value is used and must
3822 be executable by the shell. Otherwise the named tool is used if it
3823 is usable.
3824
3825 5. If any usable merge tools are present in the merge-tools configura‐
3826 tion section, the one with the highest priority is used.
3827
3828 6. If a program named hgmerge can be found on the system, it is used -
3829 but it will by default not be used for symlinks and binary files.
3830
3831 7. If the file to be merged is not binary and is not a symlink, then
3832 internal:merge is used.
3833
3834 8. The merge of the file fails and must be resolved before commit.
3835
3836 Note After selecting a merge program, Mercurial will by default
3837 attempt to merge the files using a simple merge algorithm first.
3838 Only if it doesn't succeed because of conflicting changes Mercu‐
3839 rial will actually execute the merge program. Whether to use the
3840 simple merge algorithm first can be controlled by the premerge
3841 setting of the merge tool. Premerge is enabled by default unless
3842 the file is binary or a symlink.
3843
3844 See the merge-tools and ui sections of hgrc(5) for details on the con‐
3845 figuration of merge tools.
3846
3848 When Mercurial accepts more than one revision, they may be specified
3849 individually, or provided as a topologically continuous range, sepa‐
3850 rated by the ":" character.
3851
3852 The syntax of range notation is [BEGIN]:[END], where BEGIN and END are
3853 revision identifiers. Both BEGIN and END are optional. If BEGIN is not
3854 specified, it defaults to revision number 0. If END is not specified,
3855 it defaults to the tip. The range ":" thus means "all revisions".
3856
3857 If BEGIN is greater than END, revisions are treated in reverse order.
3858
3859 A range acts as a closed interval. This means that a range of 3:5 gives
3860 3, 4 and 5. Similarly, a range of 9:6 gives 9, 8, 7, and 6.
3861
3863 Mercurial accepts several notations for identifying one or more files
3864 at a time.
3865
3866 By default, Mercurial treats filenames as shell-style extended glob
3867 patterns.
3868
3869 Alternate pattern notations must be specified explicitly.
3870
3871 Note Patterns specified in .hgignore are not rooted. Please see hg
3872 help hgignore for details.
3873
3874 To use a plain path name without any pattern matching, start it with
3875 path:. These path names must completely match starting at the current
3876 repository root.
3877
3878 To use an extended glob, start a name with glob:. Globs are rooted at
3879 the current directory; a glob such as *.c will only match files in the
3880 current directory ending with .c.
3881
3882 The supported glob syntax extensions are ** to match any string across
3883 path separators and {a,b} to mean "a or b".
3884
3885 To use a Perl/Python regular expression, start a name with re:. Regexp
3886 pattern matching is anchored at the root of the repository.
3887
3888 To read name patterns from a file, use listfile: or listfile0:. The
3889 latter expects null delimited patterns while the former expects line
3890 feeds. Each string read from the file is itself treated as a file pat‐
3891 tern.
3892
3893 Plain examples:
3894
3895 path:foo/bar a name bar in a directory named foo in the root
3896 of the repository
3897 path:path:name a file or directory named "path:name"
3898
3899 Glob examples:
3900
3901 glob:*.c any name ending in ".c" in the current directory
3902 *.c any name ending in ".c" in the current directory
3903 **.c any name ending in ".c" in any subdirectory of the
3904 current directory including itself.
3905 foo/*.c any name ending in ".c" in the directory foo
3906 foo/**.c any name ending in ".c" in any subdirectory of foo
3907 including itself.
3908
3909 Regexp examples:
3910
3911 re:.*\.c$ any name ending in ".c", anywhere in the repository
3912
3913 File examples:
3914
3915 listfile:list.txt read list from list.txt with one file pattern per line
3916 listfile0:list.txt read list from list.txt with null byte delimiters
3917
3918 See also hg help filesets.
3919
3921 What are phases?
3922 Phases are a system for tracking which changesets have been or should
3923 be shared. This helps prevent common mistakes when modifying history
3924 (for instance, with the mq or rebase extensions).
3925
3926 Each changeset in a repository is in one of the following phases:
3927
3928 · public : changeset is visible on a public server
3929
3930 · draft : changeset is not yet published
3931
3932 · secret : changeset should not be pushed, pulled, or cloned
3933
3934 These phases are ordered (public < draft < secret) and no changeset can
3935 be in a lower phase than its ancestors. For instance, if a changeset is
3936 public, all its ancestors are also public. Lastly, changeset phases
3937 should only be changed towards the public phase.
3938
3939 How are phases managed?
3940 For the most part, phases should work transparently. By default, a
3941 changeset is created in the draft phase and is moved into the public
3942 phase when it is pushed to another repository.
3943
3944 Once changesets become public, extensions like mq and rebase will
3945 refuse to operate on them to prevent creating duplicate changesets.
3946 Phases can also be manually manipulated with the hg phase command if
3947 needed. See hg help -v phase for examples.
3948
3949 Phases and servers
3950 Normally, all servers are publishing by default. This means:
3951
3952 - all draft changesets that are pulled or cloned appear in phase
3953 public on the client
3954
3955 - all draft changesets that are pushed appear as public on both
3956 client and server
3957
3958 - secret changesets are neither pushed, pulled, or cloned
3959
3960 Note Pulling a draft changeset from a publishing server does not mark
3961 it as public on the server side due to the read-only nature of
3962 pull.
3963
3964 Sometimes it may be desirable to push and pull changesets in the draft
3965 phase to share unfinished work. This can be done by setting a reposi‐
3966 tory to disable publishing in its configuration file:
3967
3968 [phases]
3969 publish = False
3970
3971 See hg help config for more information on config files.
3972
3973 Note Servers running older versions of Mercurial are treated as pub‐
3974 lishing.
3975
3976 Examples
3977 · list changesets in draft or secret phase:
3978
3979 hg log -r "not public()"
3980
3981 · change all secret changesets to draft:
3982
3983 hg phase --draft "secret()"
3984
3985 · forcibly move the current changeset and descendants from public to
3986 draft:
3987
3988 hg phase --force --draft .
3989
3990 · show a list of changeset revision and phase:
3991
3992 hg log --template "{rev} {phase}\n"
3993
3994 · resynchronize draft changesets relative to a remote repository:
3995
3996 hg phase -fd 'outgoing(URL)'
3997
3998 See hg help phase for more information on manually manipulating phases.
3999
4001 Mercurial supports several ways to specify individual revisions.
4002
4003 A plain integer is treated as a revision number. Negative integers are
4004 treated as sequential offsets from the tip, with -1 denoting the tip,
4005 -2 denoting the revision prior to the tip, and so forth.
4006
4007 A 40-digit hexadecimal string is treated as a unique revision identi‐
4008 fier.
4009
4010 A hexadecimal string less than 40 characters long is treated as a
4011 unique revision identifier and is referred to as a short-form identi‐
4012 fier. A short-form identifier is only valid if it is the prefix of
4013 exactly one full-length identifier.
4014
4015 Any other string is treated as a bookmark, tag, or branch name. A book‐
4016 mark is a movable pointer to a revision. A tag is a permanent name
4017 associated with a revision. A branch name denotes the tipmost revision
4018 of that branch. Bookmark, tag, and branch names must not contain the
4019 ":" character.
4020
4021 The reserved name "tip" always identifies the most recent revision.
4022
4023 The reserved name "null" indicates the null revision. This is the revi‐
4024 sion of an empty repository, and the parent of revision 0.
4025
4026 The reserved name "." indicates the working directory parent. If no
4027 working directory is checked out, it is equivalent to null. If an
4028 uncommitted merge is in progress, "." is the revision of the first par‐
4029 ent.
4030
4032 Mercurial supports a functional language for selecting a set of revi‐
4033 sions.
4034
4035 The language supports a number of predicates which are joined by infix
4036 operators. Parenthesis can be used for grouping.
4037
4038 Identifiers such as branch names may need quoting with single or double
4039 quotes if they contain characters like - or if they match one of the
4040 predefined predicates.
4041
4042 Special characters can be used in quoted identifiers by escaping them,
4043 e.g., \n is interpreted as a newline. To prevent them from being inter‐
4044 preted, strings can be prefixed with r, e.g. r'...'.
4045
4046 There is a single prefix operator:
4047
4048 not x
4049
4050 Changesets not in x. Short form is ! x.
4051
4052 These are the supported infix operators:
4053
4054 x::y
4055
4056 A DAG range, meaning all changesets that are descendants of x
4057 and ancestors of y, including x and y themselves. If the first
4058 endpoint is left out, this is equivalent to ancestors(y), if the
4059 second is left out it is equivalent to descendants(x).
4060
4061 An alternative syntax is x..y.
4062
4063 x:y
4064
4065 All changesets with revision numbers between x and y, both
4066 inclusive. Either endpoint can be left out, they default to 0
4067 and tip.
4068
4069 x and y
4070
4071 The intersection of changesets in x and y. Short form is x & y.
4072
4073 x or y
4074
4075 The union of changesets in x and y. There are two alternative
4076 short forms: x | y and x + y.
4077
4078 x - y
4079
4080 Changesets in x but not in y.
4081
4082 x^n
4083
4084 The nth parent of x, n == 0, 1, or 2. For n == 0, x; for n ==
4085 1, the first parent of each changeset in x; for n == 2, the sec‐
4086 ond parent of changeset in x.
4087
4088 x~n
4089
4090 The nth first ancestor of x; x~0 is x; x~3 is x^^^.
4091
4092 There is a single postfix operator:
4093
4094 x^
4095
4096 Equivalent to x^1, the first parent of each changeset in x.
4097
4098 The following predicates are supported:
4099
4100 adds(pattern)
4101
4102 Changesets that add a file matching pattern.
4103
4104 all()
4105
4106 All changesets, the same as 0:tip.
4107
4108 ancestor(*changeset)
4109
4110 Greatest common ancestor of the changesets.
4111
4112 Accepts 0 or more changesets. Will return empty list when
4113 passed no args. Greatest common ancestor of a single changeset
4114 is that changeset.
4115
4116 ancestors(set)
4117
4118 Changesets that are ancestors of a changeset in set.
4119
4120 author(string)
4121
4122 Alias for user(string).
4123
4124 bisect(string)
4125
4126 Changesets marked in the specified bisect status:
4127
4128 · good, bad, skip: csets explicitly marked as good/bad/skip
4129
4130 · goods, bads : csets topologically good/bad
4131
4132 · range : csets taking part in the bisection
4133
4134 · pruned : csets that are goods, bads or skipped
4135
4136 · untested : csets whose fate is yet unknown
4137
4138 · ignored : csets ignored due to DAG topology
4139
4140 · current : the cset currently being bisected
4141
4142 bookmark([name])
4143
4144 The named bookmark or all bookmarks.
4145
4146 If name starts with re:, the remainder of the name is treated as
4147 a regular expression. To match a bookmark that actually starts
4148 with re:, use the prefix literal:.
4149
4150 branch(string or set)
4151
4152 All changesets belonging to the given branch or the branches of
4153 the given changesets.
4154
4155 If string starts with re:, the remainder of the name is treated
4156 as a regular expression. To match a branch that actually starts
4157 with re:, use the prefix literal:.
4158
4159 branchpoint()
4160
4161 Changesets with more than one child.
4162
4163 bumped()
4164
4165 Mutable changesets marked as successors of public changesets.
4166
4167 Only non-public and non-obsolete changesets can be bumped.
4168
4169 bundle()
4170
4171 Changesets in the bundle.
4172
4173 Bundle must be specified by the -R option.
4174
4175 children(set)
4176
4177 Child changesets of changesets in set.
4178
4179 closed()
4180
4181 Changeset is closed.
4182
4183 contains(pattern)
4184
4185 Revision contains a file matching pattern. See hg help patterns
4186 for information about file patterns.
4187
4188 converted([id])
4189
4190 Changesets converted from the given identifier in the old repos‐
4191 itory if present, or all converted changesets if no identifier
4192 is specified.
4193
4194 date(interval)
4195
4196 Changesets within the interval, see hg help dates.
4197
4198 desc(string)
4199
4200 Search commit message for string. The match is case-insensitive.
4201
4202 descendants(set)
4203
4204 Changesets which are descendants of changesets in set.
4205
4206 destination([set])
4207
4208 Changesets that were created by a graft, transplant or rebase
4209 operation, with the given revisions specified as the source.
4210 Omitting the optional set is the same as passing all().
4211
4212 divergent()
4213
4214 Final successors of changesets with an alternative set of final
4215 successors.
4216
4217 draft()
4218
4219 Changeset in draft phase.
4220
4221 extinct()
4222
4223 Obsolete changesets with obsolete descendants only.
4224
4225 extra(label, [value])
4226
4227 Changesets with the given label in the extra metadata, with the
4228 given optional value.
4229
4230 If value starts with re:, the remainder of the value is treated
4231 as a regular expression. To match a value that actually starts
4232 with re:, use the prefix literal:.
4233
4234 file(pattern)
4235
4236 Changesets affecting files matched by pattern.
4237
4238 For a faster but less accurate result, consider using filelog()
4239 instead.
4240
4241 filelog(pattern)
4242
4243 Changesets connected to the specified filelog.
4244
4245 For performance reasons, filelog() does not show every changeset
4246 that affects the requested file(s). See hg help log for details.
4247 For a slower, more accurate result, use file().
4248
4249 first(set, [n])
4250
4251 An alias for limit().
4252
4253 follow([file])
4254
4255 An alias for ::. (ancestors of the working copy's first parent).
4256 If a filename is specified, the history of the given file is
4257 followed, including copies.
4258
4259 grep(regex)
4260
4261 Like keyword(string) but accepts a regex. Use grep(r'...') to
4262 ensure special escape characters are handled correctly. Unlike
4263 keyword(string), the match is case-sensitive.
4264
4265 head()
4266
4267 Changeset is a named branch head.
4268
4269 heads(set)
4270
4271 Members of set with no children in set.
4272
4273 hidden()
4274
4275 Hidden changesets.
4276
4277 id(string)
4278
4279 Revision non-ambiguously specified by the given hex string pre‐
4280 fix.
4281
4282 keyword(string)
4283
4284 Search commit message, user name, and names of changed files for
4285 string. The match is case-insensitive.
4286
4287 last(set, [n])
4288
4289 Last n members of set, defaulting to 1.
4290
4291 limit(set, [n])
4292
4293 First n members of set, defaulting to 1.
4294
4295 matching(revision [, field])
4296
4297 Changesets in which a given set of fields match the set of
4298 fields in the selected revision or set.
4299
4300 To match more than one field pass the list of fields to match
4301 separated by spaces (e.g. author description).
4302
4303 Valid fields are most regular revision fields and some special
4304 fields.
4305
4306 Regular revision fields are description, author, branch, date,
4307 files, phase, parents, substate, user and diff. Note that
4308 author and user are synonyms. diff refers to the contents of the
4309 revision. Two revisions matching their diff will also match
4310 their files.
4311
4312 Special fields are summary and metadata: summary matches the
4313 first line of the description. metadata is equivalent to match‐
4314 ing description user date (i.e. it matches the main metadata
4315 fields).
4316
4317 metadata is the default field which is used when no fields are
4318 specified. You can match more than one field at a time.
4319
4320 max(set)
4321
4322 Changeset with highest revision number in set.
4323
4324 merge()
4325
4326 Changeset is a merge changeset.
4327
4328 min(set)
4329
4330 Changeset with lowest revision number in set.
4331
4332 modifies(pattern)
4333
4334 Changesets modifying files matched by pattern.
4335
4336 obsolete()
4337
4338 Mutable changeset with a newer version.
4339
4340 origin([set])
4341
4342 Changesets that were specified as a source for the grafts,
4343 transplants or rebases that created the given revisions. Omit‐
4344 ting the optional set is the same as passing all(). If a
4345 changeset created by these operations is itself specified as a
4346 source for one of these operations, only the source changeset
4347 for the first operation is selected.
4348
4349 outgoing([path])
4350
4351 Changesets not found in the specified destination repository, or
4352 the default push location.
4353
4354 p1([set])
4355
4356 First parent of changesets in set, or the working directory.
4357
4358 p2([set])
4359
4360 Second parent of changesets in set, or the working directory.
4361
4362 parents([set])
4363
4364 The set of all parents for all changesets in set, or the working
4365 directory.
4366
4367 present(set)
4368
4369 An empty set, if any revision in set isn't found; otherwise, all
4370 revisions in set.
4371
4372 If any of specified revisions is not present in the local repos‐
4373 itory, the query is normally aborted. But this predicate allows
4374 the query to continue even in such cases.
4375
4376 public()
4377
4378 Changeset in public phase.
4379
4380 remote([id [,path]])
4381
4382 Local revision that corresponds to the given identifier in a
4383 remote repository, if present. Here, the '.' identifier is a
4384 synonym for the current local branch.
4385
4386 removes(pattern)
4387
4388 Changesets which remove files matching pattern.
4389
4390 rev(number)
4391
4392 Revision with the given numeric identifier.
4393
4394 reverse(set)
4395
4396 Reverse order of set.
4397
4398 roots(set)
4399
4400 Changesets in set with no parent changeset in set.
4401
4402 secret()
4403
4404 Changeset in secret phase.
4405
4406 sort(set[, [-]key...])
4407
4408 Sort set by keys. The default sort order is ascending, specify a
4409 key as -key to sort in descending order.
4410
4411 The keys can be:
4412
4413 · rev for the revision number,
4414
4415 · branch for the branch name,
4416
4417 · desc for the commit message (description),
4418
4419 · user for user name (author can be used as an alias),
4420
4421 · date for the commit date
4422
4423 tag([name])
4424
4425 The specified tag by name, or all tagged revisions if no name is
4426 given.
4427
4428 unstable()
4429
4430 Non-obsolete changesets with obsolete ancestors.
4431
4432 user(string)
4433
4434 User name contains string. The match is case-insensitive.
4435
4436 If string starts with re:, the remainder of the string is
4437 treated as a regular expression. To match a user that actually
4438 contains re:, use the prefix literal:.
4439
4440 New predicates (known as "aliases") can be defined, using any combina‐
4441 tion of existing predicates or other aliases. An alias definition looks
4442 like:
4443
4444 <alias> = <definition>
4445
4446 in the revsetalias section of a Mercurial configuration file. Arguments
4447 of the form $1, $2, etc. are substituted from the alias into the defi‐
4448 nition.
4449
4450 For example,
4451
4452 [revsetalias]
4453 h = heads()
4454 d($1) = sort($1, date)
4455 rs($1, $2) = reverse(sort($1, $2))
4456
4457 defines three aliases, h, d, and rs. rs(0:tip, author) is exactly
4458 equivalent to reverse(sort(0:tip, author)).
4459
4460 Command line equivalents for hg log:
4461
4462 -f -> ::.
4463 -d x -> date(x)
4464 -k x -> keyword(x)
4465 -m -> merge()
4466 -u x -> user(x)
4467 -b x -> branch(x)
4468 -P x -> !::x
4469 -l x -> limit(expr, x)
4470
4471 Some sample queries:
4472
4473 · Changesets on the default branch:
4474
4475 hg log -r "branch(default)"
4476
4477 · Changesets on the default branch since tag 1.5 (excluding merges):
4478
4479 hg log -r "branch(default) and 1.5:: and not merge()"
4480
4481 · Open branch heads:
4482
4483 hg log -r "head() and not closed()"
4484
4485 · Changesets between tags 1.3 and 1.5 mentioning "bug" that affect
4486 hgext/*:
4487
4488 hg log -r "1.3::1.5 and keyword(bug) and file('hgext/*')"
4489
4490 · Changesets committed in May 2008, sorted by user:
4491
4492 hg log -r "sort(date('May 2008'), user)"
4493
4494 · Changesets mentioning "bug" or "issue" that are not in a tagged
4495 release:
4496
4497 hg log -r "(keyword(bug) or keyword(issue)) and not ancestors(tag())"
4498
4500 Subrepositories let you nest external repositories or projects into a
4501 parent Mercurial repository, and make commands operate on them as a
4502 group.
4503
4504 Mercurial currently supports Mercurial, Git, and Subversion subreposi‐
4505 tories.
4506
4507 Subrepositories are made of three components:
4508
4509 1. Nested repository checkouts. They can appear anywhere in the parent
4510 working directory.
4511
4512 2. Nested repository references. They are defined in .hgsub, which
4513 should be placed in the root of working directory, and tell where
4514 the subrepository checkouts come from. Mercurial subrepositories are
4515 referenced like:
4516
4517 path/to/nested = https://example.com/nested/repo/path
4518
4519 Git and Subversion subrepos are also supported:
4520
4521 path/to/nested = [git]git://example.com/nested/repo/path
4522 path/to/nested = [svn]https://example.com/nested/trunk/path
4523
4524 where path/to/nested is the checkout location relatively to the par‐
4525 ent Mercurial root, and https://example.com/nested/repo/path is the
4526 source repository path. The source can also reference a filesystem
4527 path.
4528
4529 Note that .hgsub does not exist by default in Mercurial reposito‐
4530 ries, you have to create and add it to the parent repository before
4531 using subrepositories.
4532
4533 3. Nested repository states. They are defined in .hgsubstate, which is
4534 placed in the root of working directory, and capture whatever infor‐
4535 mation is required to restore the subrepositories to the state they
4536 were committed in a parent repository changeset. Mercurial automati‐
4537 cally record the nested repositories states when committing in the
4538 parent repository.
4539
4540 Note
4541 The .hgsubstate file should not be edited manually.
4542
4543 Adding a Subrepository
4544 If .hgsub does not exist, create it and add it to the parent reposi‐
4545 tory. Clone or checkout the external projects where you want it to live
4546 in the parent repository. Edit .hgsub and add the subrepository entry
4547 as described above. At this point, the subrepository is tracked and the
4548 next commit will record its state in .hgsubstate and bind it to the
4549 committed changeset.
4550
4551 Synchronizing a Subrepository
4552 Subrepos do not automatically track the latest changeset of their
4553 sources. Instead, they are updated to the changeset that corresponds
4554 with the changeset checked out in the top-level changeset. This is so
4555 developers always get a consistent set of compatible code and libraries
4556 when they update.
4557
4558 Thus, updating subrepos is a manual process. Simply check out target
4559 subrepo at the desired revision, test in the top-level repo, then com‐
4560 mit in the parent repository to record the new combination.
4561
4562 Deleting a Subrepository
4563 To remove a subrepository from the parent repository, delete its refer‐
4564 ence from .hgsub, then remove its files.
4565
4566 Interaction with Mercurial Commands
4567 add add does not recurse in subrepos unless -S/--subrepos is speci‐
4568 fied. However, if you specify the full path of a file in a sub‐
4569 repo, it will be added even without -S/--subrepos specified.
4570 Git and Subversion subrepositories are currently silently
4571 ignored.
4572
4573 archive
4574 archive does not recurse in subrepositories unless -S/--subrepos
4575 is specified.
4576
4577 commit commit creates a consistent snapshot of the state of the entire
4578 project and its subrepositories. If any subrepositories have
4579 been modified, Mercurial will abort. Mercurial can be made to
4580 instead commit all modified subrepositories by specifying
4581 -S/--subrepos, or setting "ui.commitsubrepos=True" in a configu‐
4582 ration file (see hg help config). After there are no longer any
4583 modified subrepositories, it records their state and finally
4584 commits it in the parent repository.
4585
4586 diff diff does not recurse in subrepos unless -S/--subrepos is speci‐
4587 fied. Changes are displayed as usual, on the subrepositories
4588 elements. Git and Subversion subrepositories are currently
4589 silently ignored.
4590
4591 forget forget currently only handles exact file matches in subrepos.
4592 Git and Subversion subrepositories are currently silently
4593 ignored.
4594
4595 incoming
4596 incoming does not recurse in subrepos unless -S/--subrepos is
4597 specified. Git and Subversion subrepositories are currently
4598 silently ignored.
4599
4600 outgoing
4601 outgoing does not recurse in subrepos unless -S/--subrepos is
4602 specified. Git and Subversion subrepositories are currently
4603 silently ignored.
4604
4605 pull pull is not recursive since it is not clear what to pull prior
4606 to running hg update. Listing and retrieving all subrepositories
4607 changes referenced by the parent repository pulled changesets is
4608 expensive at best, impossible in the Subversion case.
4609
4610 push Mercurial will automatically push all subrepositories first when
4611 the parent repository is being pushed. This ensures new sub‐
4612 repository changes are available when referenced by top-level
4613 repositories. Push is a no-op for Subversion subrepositories.
4614
4615 status status does not recurse into subrepositories unless -S/--subre‐
4616 pos is specified. Subrepository changes are displayed as regular
4617 Mercurial changes on the subrepository elements. Subversion sub‐
4618 repositories are currently silently ignored.
4619
4620 update update restores the subrepos in the state they were originally
4621 committed in target changeset. If the recorded changeset is not
4622 available in the current subrepository, Mercurial will pull it
4623 in first before updating. This means that updating can require
4624 network access when using subrepositories.
4625
4626 Remapping Subrepositories Sources
4627 A subrepository source location may change during a project life,
4628 invalidating references stored in the parent repository history. To fix
4629 this, rewriting rules can be defined in parent repository hgrc file or
4630 in Mercurial configuration. See the [subpaths] section in hgrc(5) for
4631 more details.
4632
4634 Mercurial allows you to customize output of commands through templates.
4635 You can either pass in a template from the command line, via the --tem‐
4636 plate option, or select an existing template-style (--style).
4637
4638 You can customize output for any "log-like" command: log, outgoing,
4639 incoming, tip, parents, heads and glog.
4640
4641 Four styles are packaged with Mercurial: default (the style used when
4642 no explicit preference is passed), compact, changelog, and xml. Usage:
4643
4644 $ hg log -r1 --style changelog
4645
4646 A template is a piece of text, with markup to invoke variable expan‐
4647 sion:
4648
4649 $ hg log -r1 --template "{node}\n"
4650 b56ce7b07c52de7d5fd79fb89701ea538af65746
4651
4652 Strings in curly braces are called keywords. The availability of key‐
4653 words depends on the exact context of the templater. These keywords are
4654 usually available for templating a log-like command:
4655
4656 author String. The unmodified author of the changeset.
4657
4658 bisect String. The changeset bisection status.
4659
4660 bookmarks
4661 List of strings. Any bookmarks associated with the changeset.
4662
4663 branch String. The name of the branch on which the changeset was com‐
4664 mitted.
4665
4666 branches
4667 List of strings. The name of the branch on which the changeset
4668 was committed. Will be empty if the branch name was default.
4669
4670 children
4671 List of strings. The children of the changeset.
4672
4673 date Date information. The date when the changeset was committed.
4674
4675 desc String. The text of the changeset description.
4676
4677 diffstat
4678 String. Statistics of changes with the following format: "modi‐
4679 fied files: +added/-removed lines"
4680
4681 file_adds
4682 List of strings. Files added by this changeset.
4683
4684 file_copies
4685 List of strings. Files copied in this changeset with their
4686 sources.
4687
4688 file_copies_switch
4689 List of strings. Like "file_copies" but displayed only if the
4690 --copied switch is set.
4691
4692 file_dels
4693 List of strings. Files removed by this changeset.
4694
4695 file_mods
4696 List of strings. Files modified by this changeset.
4697
4698 files List of strings. All files modified, added, or removed by this
4699 changeset.
4700
4701 latesttag
4702 String. Most recent global tag in the ancestors of this change‐
4703 set.
4704
4705 latesttagdistance
4706 Integer. Longest path to the latest tag.
4707
4708 node String. The changeset identification hash, as a 40 hexadecimal
4709 digit string.
4710
4711 p1node String. The identification hash of the changeset's first parent,
4712 as a 40 digit hexadecimal string. If the changeset has no par‐
4713 ents, all digits are 0.
4714
4715 p1rev Integer. The repository-local revision number of the changeset's
4716 first parent, or -1 if the changeset has no parents.
4717
4718 p2node String. The identification hash of the changeset's second par‐
4719 ent, as a 40 digit hexadecimal string. If the changeset has no
4720 second parent, all digits are 0.
4721
4722 p2rev Integer. The repository-local revision number of the changeset's
4723 second parent, or -1 if the changeset has no second parent.
4724
4725 parents
4726 List of strings. The parents of the changeset in "rev:node" for‐
4727 mat. If the changeset has only one "natural" parent (the prede‐
4728 cessor revision) nothing is shown.
4729
4730 phase String. The changeset phase name.
4731
4732 phaseidx
4733 Integer. The changeset phase index.
4734
4735 rev Integer. The repository-local changeset revision number.
4736
4737 tags List of strings. Any tags associated with the changeset.
4738
4739 The "date" keyword does not produce human-readable output. If you want
4740 to use a date in your output, you can use a filter to process it. Fil‐
4741 ters are functions which return a string based on the input variable.
4742 Be sure to use the stringify filter first when you're applying a
4743 string-input filter to a list-like input variable. You can also use a
4744 chain of filters to get the desired output:
4745
4746 $ hg tip --template "{date|isodate}\n"
4747 2008-08-21 18:22 +0000
4748
4749 List of filters:
4750
4751 addbreaks
4752 Any text. Add an XHTML "<br />" tag before the end of every line
4753 except the last.
4754
4755 age Date. Returns a human-readable date/time difference between the
4756 given date/time and the current date/time.
4757
4758 basename
4759 Any text. Treats the text as a path, and returns the last compo‐
4760 nent of the path after splitting by the path separator (ignoring
4761 trailing separators). For example, "foo/bar/baz" becomes "baz"
4762 and "foo/bar//" becomes "bar".
4763
4764 date Date. Returns a date in a Unix date format, including the time‐
4765 zone: "Mon Sep 04 15:13:13 2006 0700".
4766
4767 domain Any text. Finds the first string that looks like an email
4768 address, and extracts just the domain component. Example: User
4769 <user@example.com> becomes example.com.
4770
4771 email Any text. Extracts the first string that looks like an email
4772 address. Example: User <user@example.com> becomes user@exam‐
4773 ple.com.
4774
4775 emailuser
4776 Any text. Returns the user portion of an email address.
4777
4778 escape Any text. Replaces the special XML/XHTML characters "&", "<" and
4779 ">" with XML entities, and filters out NUL characters.
4780
4781 fill68 Any text. Wraps the text to fit in 68 columns.
4782
4783 fill76 Any text. Wraps the text to fit in 76 columns.
4784
4785 firstline
4786 Any text. Returns the first line of text.
4787
4788 hex Any text. Convert a binary Mercurial node identifier into its
4789 long hexadecimal representation.
4790
4791 hgdate Date. Returns the date as a pair of numbers: "1157407993 25200"
4792 (Unix timestamp, timezone offset).
4793
4794 isodate
4795 Date. Returns the date in ISO 8601 format: "2009-08-18 13:00
4796 +0200".
4797
4798 isodatesec
4799 Date. Returns the date in ISO 8601 format, including seconds:
4800 "2009-08-18 13:00:13 +0200". See also the rfc3339date filter.
4801
4802 localdate
4803 Date. Converts a date to local date.
4804
4805 nonempty
4806 Any text. Returns '(none)' if the string is empty.
4807
4808 obfuscate
4809 Any text. Returns the input text rendered as a sequence of XML
4810 entities.
4811
4812 person Any text. Returns the name before an email address, interpreting
4813 it as per RFC 5322.
4814
4815 rfc3339date
4816 Date. Returns a date using the Internet date format specified in
4817 RFC 3339: "2009-08-18T13:00:13+02:00".
4818
4819 rfc822date
4820 Date. Returns a date using the same format used in email head‐
4821 ers: "Tue, 18 Aug 2009 13:00:13 +0200".
4822
4823 short Changeset hash. Returns the short form of a changeset hash, i.e.
4824 a 12 hexadecimal digit string.
4825
4826 shortbisect
4827 Any text. Treats text as a bisection status, and returns a sin‐
4828 gle-character representing the status (G: good, B: bad, S:
4829 skipped, U: untested, I: ignored). Returns single space if text
4830 is not a valid bisection status.
4831
4832 shortdate
4833 Date. Returns a date like "2006-09-18".
4834
4835 stringify
4836 Any type. Turns the value into text by converting values into
4837 text and concatenating them.
4838
4839 strip Any text. Strips all leading and trailing whitespace.
4840
4841 stripdir
4842 Treat the text as path and strip a directory level, if possible.
4843 For example, "foo" and "foo/bar" becomes "foo".
4844
4845 tabindent
4846 Any text. Returns the text, with every line except the first
4847 starting with a tab character.
4848
4849 urlescape
4850 Any text. Escapes all "special" characters. For example, "foo
4851 bar" becomes "foo%20bar".
4852
4853 user Any text. Returns a short representation of a user name or email
4854 address.
4855
4856 Note that a filter is nothing more than a function call, i.e.
4857 expr|filter is equivalent to filter(expr).
4858
4859 In addition to filters, there are some basic built-in functions:
4860
4861 · date(date[, fmt])
4862
4863 · fill(text[, width])
4864
4865 · get(dict, key)
4866
4867 · if(expr, then[, else])
4868
4869 · ifeq(expr, expr, then[, else])
4870
4871 · join(list, sep)
4872
4873 · label(label, expr)
4874
4875 · sub(pat, repl, expr)
4876
4877 · rstdoc(text, style)
4878
4879 Also, for any expression that returns a list, there is a list operator:
4880
4881 · expr % "{template}"
4882
4883 Some sample command line templates:
4884
4885 · Format lists, e.g. files:
4886
4887 $ hg log -r 0 --template "files:\n{files % ' {file}\n'}"
4888
4889 · Join the list of files with a ", ":
4890
4891 $ hg log -r 0 --template "files: {join(files, ', ')}\n"
4892
4893 · Format date:
4894
4895 $ hg log -r 0 --template "{date(date, '%Y')}\n"
4896
4897 · Output the description set to a fill-width of 30:
4898
4899 $ hg log -r 0 --template "{fill(desc, '30')}"
4900
4901 · Use a conditional to test for the default branch:
4902
4903 $ hg log -r 0 --template "{ifeq(branch, 'default', 'on the main branch',
4904 'on branch {branch}')}\n"
4905
4906 · Append a newline if not empty:
4907
4908 $ hg tip --template "{if(author, '{author}\n')}"
4909
4910 · Label the output for use with the color extension:
4911
4912 $ hg log -r 0 --template "{label('changeset.{phase}', node|short)}\n"
4913
4914 · Invert the firstline filter, i.e. everything but the first line:
4915
4916 $ hg log -r 0 --template "{sub(r'^.*\n?\n?', '', desc)}\n"
4917
4919 Valid URLs are of the form:
4920
4921 local/filesystem/path[#revision]
4922 file://local/filesystem/path[#revision]
4923 http://[user[:pass]@]host[:port]/[path][#revision]
4924 https://[user[:pass]@]host[:port]/[path][#revision]
4925 ssh://[user@]host[:port]/[path][#revision]
4926
4927 Paths in the local filesystem can either point to Mercurial reposito‐
4928 ries or to bundle files (as created by hg bundle or hg incoming --bun‐
4929 dle). See also hg help paths.
4930
4931 An optional identifier after # indicates a particular branch, tag, or
4932 changeset to use from the remote repository. See also hg help revisions
4933 .
4934
4935 Some features, such as pushing to http:// and https:// URLs are only
4936 possible if the feature is explicitly enabled on the remote Mercurial
4937 server.
4938
4939 Note that the security of HTTPS URLs depends on proper configuration of
4940 web.cacerts.
4941
4942 Some notes about using SSH with Mercurial:
4943
4944 · SSH requires an accessible shell account on the destination machine
4945 and a copy of hg in the remote path or specified with as remotecmd.
4946
4947 · path is relative to the remote user's home directory by default. Use
4948 an extra slash at the start of a path to specify an absolute path:
4949
4950 ssh://example.com//tmp/repository
4951
4952 · Mercurial doesn't use its own compression via SSH; the right thing to
4953 do is to configure it in your ~/.ssh/config, e.g.:
4954
4955 Host *.mylocalnetwork.example.com
4956 Compression no
4957 Host *
4958 Compression yes
4959
4960 Alternatively specify "ssh -C" as your ssh command in your configura‐
4961 tion file or with the --ssh command line option.
4962
4963 These URLs can all be stored in your configuration file with path
4964 aliases under the [paths] section like so:
4965
4966 [paths]
4967 alias1 = URL1
4968 alias2 = URL2
4969 ...
4970
4971 You can then use the alias for any command that uses a URL (for example
4972 hg pull alias1 will be treated as hg pull URL1).
4973
4974 Two path aliases are special because they are used as defaults when you
4975 do not provide the URL to a command:
4976
4977 default:
4978 When you create a repository with hg clone, the clone command
4979 saves the location of the source repository as the new reposi‐
4980 tory's 'default' path. This is then used when you omit path from
4981 push- and pull-like commands (including incoming and outgoing).
4982
4983 default-push:
4984 The push command will look for a path named 'default-push', and
4985 prefer it over 'default' if both are defined.
4986
4988 This section contains help for extensions that are distributed together
4989 with Mercurial. Help for other extensions is available in the help sys‐
4990 tem.
4991
4992 acl
4993 hooks for controlling repository access
4994
4995 This hook makes it possible to allow or deny write access to given
4996 branches and paths of a repository when receiving incoming changesets
4997 via pretxnchangegroup and pretxncommit.
4998
4999 The authorization is matched based on the local user name on the system
5000 where the hook runs, and not the committer of the original changeset
5001 (since the latter is merely informative).
5002
5003 The acl hook is best used along with a restricted shell like hgsh, pre‐
5004 venting authenticating users from doing anything other than pushing or
5005 pulling. The hook is not safe to use if users have interactive shell
5006 access, as they can then disable the hook. Nor is it safe if remote
5007 users share an account, because then there is no way to distinguish
5008 them.
5009
5010 The order in which access checks are performed is:
5011
5012 1. Deny list for branches (section acl.deny.branches)
5013
5014 2. Allow list for branches (section acl.allow.branches)
5015
5016 3. Deny list for paths (section acl.deny)
5017
5018 4. Allow list for paths (section acl.allow)
5019
5020 The allow and deny sections take key-value pairs.
5021
5022 Branch-based Access Control
5023 Use the acl.deny.branches and acl.allow.branches sections to have
5024 branch-based access control. Keys in these sections can be either:
5025
5026 · a branch name, or
5027
5028 · an asterisk, to match any branch;
5029
5030 The corresponding values can be either:
5031
5032 · a comma-separated list containing users and groups, or
5033
5034 · an asterisk, to match anyone;
5035
5036 You can add the "!" prefix to a user or group name to invert the sense
5037 of the match.
5038
5039 Path-based Access Control
5040 Use the acl.deny and acl.allow sections to have path-based access con‐
5041 trol. Keys in these sections accept a subtree pattern (with a glob syn‐
5042 tax by default). The corresponding values follow the same syntax as the
5043 other sections above.
5044
5045 Groups
5046 Group names must be prefixed with an @ symbol. Specifying a group name
5047 has the same effect as specifying all the users in that group.
5048
5049 You can define group members in the acl.groups section. If a group
5050 name is not defined there, and Mercurial is running under a Unix-like
5051 system, the list of users will be taken from the OS. Otherwise, an
5052 exception will be raised.
5053
5054 Example Configuration
5055 [hooks]
5056
5057 # Use this if you want to check access restrictions at commit time
5058 pretxncommit.acl = python:hgext.acl.hook
5059
5060 # Use this if you want to check access restrictions for pull, push,
5061 # bundle and serve.
5062 pretxnchangegroup.acl = python:hgext.acl.hook
5063
5064 [acl]
5065 # Allow or deny access for incoming changes only if their source is
5066 # listed here, let them pass otherwise. Source is "serve" for all
5067 # remote access (http or ssh), "push", "pull" or "bundle" when the
5068 # related commands are run locally.
5069 # Default: serve
5070 sources = serve
5071
5072 [acl.deny.branches]
5073
5074 # Everyone is denied to the frozen branch:
5075 frozen-branch = *
5076
5077 # A bad user is denied on all branches:
5078 * = bad-user
5079
5080 [acl.allow.branches]
5081
5082 # A few users are allowed on branch-a:
5083 branch-a = user-1, user-2, user-3
5084
5085 # Only one user is allowed on branch-b:
5086 branch-b = user-1
5087
5088 # The super user is allowed on any branch:
5089 * = super-user
5090
5091 # Everyone is allowed on branch-for-tests:
5092 branch-for-tests = *
5093
5094 [acl.deny]
5095 # This list is checked first. If a match is found, acl.allow is not
5096 # checked. All users are granted access if acl.deny is not present.
5097 # Format for both lists: glob pattern = user, ..., @group, ...
5098
5099 # To match everyone, use an asterisk for the user:
5100 # my/glob/pattern = *
5101
5102 # user6 will not have write access to any file:
5103 ** = user6
5104
5105 # Group "hg-denied" will not have write access to any file:
5106 ** = @hg-denied
5107
5108 # Nobody will be able to change "DONT-TOUCH-THIS.txt", despite
5109 # everyone being able to change all other files. See below.
5110 src/main/resources/DONT-TOUCH-THIS.txt = *
5111
5112 [acl.allow]
5113 # if acl.allow is not present, all users are allowed by default
5114 # empty acl.allow = no users allowed
5115
5116 # User "doc_writer" has write access to any file under the "docs"
5117 # folder:
5118 docs/** = doc_writer
5119
5120 # User "jack" and group "designers" have write access to any file
5121 # under the "images" folder:
5122 images/** = jack, @designers
5123
5124 # Everyone (except for "user6" and "@hg-denied" - see acl.deny above)
5125 # will have write access to any file under the "resources" folder
5126 # (except for 1 file. See acl.deny):
5127 src/main/resources/** = *
5128
5129 .hgtags = release_engineer
5130
5131 Examples using the ! prefix
5132 Suppose there's a branch that only a given user (or group) should be
5133 able to push to, and you don't want to restrict access to any other
5134 branch that may be created.
5135
5136 The "!" prefix allows you to prevent anyone except a given user or
5137 group to push changesets in a given branch or path.
5138
5139 In the examples below, we will: 1) Deny access to branch "ring" to any‐
5140 one but user "gollum" 2) Deny access to branch "lake" to anyone but
5141 members of the group "hobbit" 3) Deny access to a file to anyone but
5142 user "gollum"
5143
5144 [acl.allow.branches]
5145 # Empty
5146
5147 [acl.deny.branches]
5148
5149 # 1) only 'gollum' can commit to branch 'ring';
5150 # 'gollum' and anyone else can still commit to any other branch.
5151 ring = !gollum
5152
5153 # 2) only members of the group 'hobbit' can commit to branch 'lake';
5154 # 'hobbit' members and anyone else can still commit to any other branch.
5155 lake = !@hobbit
5156
5157 # You can also deny access based on file paths:
5158
5159 [acl.allow]
5160 # Empty
5161
5162 [acl.deny]
5163 # 3) only 'gollum' can change the file below;
5164 # 'gollum' and anyone else can still change any other file.
5165 /misty/mountains/cave/ring = !gollum
5166
5167 blackbox
5168 log repository events to a blackbox for debugging
5169
5170 Logs event information to .hg/blackbox.log to help debug and diagnose
5171 problems. The events that get logged can be configured via the black‐
5172 box.track config key. Examples:
5173
5174 [blackbox]
5175 track = *
5176
5177 [blackbox]
5178 track = command, commandfinish, commandexception, exthook, pythonhook
5179
5180 [blackbox]
5181 track = incoming
5182
5183 [blackbox]
5184 # limit the size of a log file
5185 maxsize = 1.5 MB
5186 # rotate up to N log files when the current one gets too big
5187 maxfiles = 3
5188
5189 Commands
5190 blackbox
5191 hg blackbox [OPTION]...
5192
5193 view the recent repository events
5194
5195 Options:
5196
5197 -l, --limit
5198 the number of events to show (default: 10)
5199
5200 bugzilla
5201 hooks for integrating with the Bugzilla bug tracker
5202
5203 This hook extension adds comments on bugs in Bugzilla when changesets
5204 that refer to bugs by Bugzilla ID are seen. The comment is formatted
5205 using the Mercurial template mechanism.
5206
5207 The bug references can optionally include an update for Bugzilla of the
5208 hours spent working on the bug. Bugs can also be marked fixed.
5209
5210 Three basic modes of access to Bugzilla are provided:
5211
5212 1. Access via the Bugzilla XMLRPC interface. Requires Bugzilla 3.4 or
5213 later.
5214
5215 2. Check data via the Bugzilla XMLRPC interface and submit bug change
5216 via email to Bugzilla email interface. Requires Bugzilla 3.4 or
5217 later.
5218
5219 3. Writing directly to the Bugzilla database. Only Bugzilla installa‐
5220 tions using MySQL are supported. Requires Python MySQLdb.
5221
5222 Writing directly to the database is susceptible to schema changes, and
5223 relies on a Bugzilla contrib script to send out bug change notification
5224 emails. This script runs as the user running Mercurial, must be run on
5225 the host with the Bugzilla install, and requires permission to read
5226 Bugzilla configuration details and the necessary MySQL user and pass‐
5227 word to have full access rights to the Bugzilla database. For these
5228 reasons this access mode is now considered deprecated, and will not be
5229 updated for new Bugzilla versions going forward. Only adding comments
5230 is supported in this access mode.
5231
5232 Access via XMLRPC needs a Bugzilla username and password to be speci‐
5233 fied in the configuration. Comments are added under that username.
5234 Since the configuration must be readable by all Mercurial users, it is
5235 recommended that the rights of that user are restricted in Bugzilla to
5236 the minimum necessary to add comments. Marking bugs fixed requires
5237 Bugzilla 4.0 and later.
5238
5239 Access via XMLRPC/email uses XMLRPC to query Bugzilla, but sends email
5240 to the Bugzilla email interface to submit comments to bugs. The From:
5241 address in the email is set to the email address of the Mercurial user,
5242 so the comment appears to come from the Mercurial user. In the event
5243 that the Mercurial user email is not recognized by Bugzilla as a
5244 Bugzilla user, the email associated with the Bugzilla username used to
5245 log into Bugzilla is used instead as the source of the comment. Marking
5246 bugs fixed works on all supported Bugzilla versions.
5247
5248 Configuration items common to all access modes:
5249
5250 bugzilla.version
5251 The access type to use. Values recognized are:
5252
5253 xmlrpc
5254
5255 Bugzilla XMLRPC interface.
5256
5257 xmlrpc+email
5258
5259 Bugzilla XMLRPC and email interfaces.
5260
5261 3.0
5262
5263 MySQL access, Bugzilla 3.0 and later.
5264
5265 2.18
5266
5267 MySQL access, Bugzilla 2.18 and up to but not including
5268 3.0.
5269
5270 2.16
5271
5272 MySQL access, Bugzilla 2.16 and up to but not including
5273 2.18.
5274
5275 bugzilla.regexp
5276 Regular expression to match bug IDs for update in changeset com‐
5277 mit message. It must contain one "()" named group <ids> con‐
5278 taining the bug IDs separated by non-digit characters. It may
5279 also contain a named group <hours> with a floating-point number
5280 giving the hours worked on the bug. If no named groups are
5281 present, the first "()" group is assumed to contain the bug IDs,
5282 and work time is not updated. The default expression matches Bug
5283 1234, Bug no. 1234, Bug number 1234, Bugs 1234,5678, Bug 1234
5284 and 5678 and variations thereof, followed by an hours number
5285 prefixed by h or hours, e.g. hours 1.5. Matching is case insen‐
5286 sitive.
5287
5288 bugzilla.fixregexp
5289 Regular expression to match bug IDs for marking fixed in change‐
5290 set commit message. This must contain a "()" named group <ids>`
5291 containing the bug IDs separated by non-digit characters. It may
5292 also contain a named group ``<hours> with a floating-point num‐
5293 ber giving the hours worked on the bug. If no named groups are
5294 present, the first "()" group is assumed to contain the bug IDs,
5295 and work time is not updated. The default expression matches
5296 Fixes 1234, Fixes bug 1234, Fixes bugs 1234,5678, Fixes 1234 and
5297 5678 and variations thereof, followed by an hours number pre‐
5298 fixed by h or hours, e.g. hours 1.5. Matching is case insensi‐
5299 tive.
5300
5301 bugzilla.fixstatus
5302 The status to set a bug to when marking fixed. Default RESOLVED.
5303
5304 bugzilla.fixresolution
5305 The resolution to set a bug to when marking fixed. Default
5306 FIXED.
5307
5308 bugzilla.style
5309 The style file to use when formatting comments.
5310
5311 bugzilla.template
5312 Template to use when formatting comments. Overrides style if
5313 specified. In addition to the usual Mercurial keywords, the
5314 extension specifies:
5315
5316 {bug}
5317
5318 The Bugzilla bug ID.
5319
5320 {root}
5321
5322 The full pathname of the Mercurial repository.
5323
5324 {webroot}
5325
5326 Stripped pathname of the Mercurial repository.
5327
5328 {hgweb}
5329
5330 Base URL for browsing Mercurial repositories.
5331
5332 Default changeset {node|short} in repo {root} refers to bug
5333 {bug}.\ndetails:\n\t{desc|tabindent}
5334
5335 bugzilla.strip
5336 The number of path separator characters to strip from the front
5337 of the Mercurial repository path ({root} in templates) to pro‐
5338 duce {webroot}. For example, a repository with {root}
5339 /var/local/my-project with a strip of 2 gives a value for {web‐
5340 root} of my-project. Default 0.
5341
5342 web.baseurl
5343 Base URL for browsing Mercurial repositories. Referenced from
5344 templates as {hgweb}.
5345
5346 Configuration items common to XMLRPC+email and MySQL access modes:
5347
5348 bugzilla.usermap
5349 Path of file containing Mercurial committer email to Bugzilla
5350 user email mappings. If specified, the file should contain one
5351 mapping per line:
5352
5353 committer = Bugzilla user
5354
5355 See also the [usermap] section.
5356
5357 The [usermap] section is used to specify mappings of Mercurial commit‐
5358 ter email to Bugzilla user email. See also bugzilla.usermap. Contains
5359 entries of the form committer = Bugzilla user.
5360
5361 XMLRPC access mode configuration:
5362
5363 bugzilla.bzurl
5364 The base URL for the Bugzilla installation. Default
5365 http://localhost/bugzilla.
5366
5367 bugzilla.user
5368 The username to use to log into Bugzilla via XMLRPC. Default
5369 bugs.
5370
5371 bugzilla.password
5372 The password for Bugzilla login.
5373
5374 XMLRPC+email access mode uses the XMLRPC access mode configuration
5375 items, and also:
5376
5377 bugzilla.bzemail
5378 The Bugzilla email address.
5379
5380 In addition, the Mercurial email settings must be configured. See the
5381 documentation in hgrc(5), sections [email] and [smtp].
5382
5383 MySQL access mode configuration:
5384
5385 bugzilla.host
5386 Hostname of the MySQL server holding the Bugzilla database.
5387 Default localhost.
5388
5389 bugzilla.db
5390 Name of the Bugzilla database in MySQL. Default bugs.
5391
5392 bugzilla.user
5393 Username to use to access MySQL server. Default bugs.
5394
5395 bugzilla.password
5396 Password to use to access MySQL server.
5397
5398 bugzilla.timeout
5399 Database connection timeout (seconds). Default 5.
5400
5401 bugzilla.bzuser
5402 Fallback Bugzilla user name to record comments with, if change‐
5403 set committer cannot be found as a Bugzilla user.
5404
5405 bugzilla.bzdir
5406 Bugzilla install directory. Used by default notify. Default
5407 /var/www/html/bugzilla.
5408
5409 bugzilla.notify
5410 The command to run to get Bugzilla to send bug change notifica‐
5411 tion emails. Substitutes from a map with 3 keys, bzdir, id (bug
5412 id) and user (committer bugzilla email). Default depends on ver‐
5413 sion; from 2.18 it is "cd %(bzdir)s && perl -T contrib/sendbug‐
5414 mail.pl %(id)s %(user)s".
5415
5416 Activating the extension:
5417
5418 [extensions]
5419 bugzilla =
5420
5421 [hooks]
5422 # run bugzilla hook on every change pulled or pushed in here
5423 incoming.bugzilla = python:hgext.bugzilla.hook
5424
5425 Example configurations:
5426
5427 XMLRPC example configuration. This uses the Bugzilla at
5428 http://my-project.org/bugzilla, logging in as user bug‐
5429 mail@my-project.org with password plugh. It is used with a collection
5430 of Mercurial repositories in /var/local/hg/repos/, with a web interface
5431 at http://my-project.org/hg.
5432
5433 [bugzilla]
5434 bzurl=http://my-project.org/bugzilla
5435 user=bugmail@my-project.org
5436 password=plugh
5437 version=xmlrpc
5438 template=Changeset {node|short} in {root|basename}.
5439 {hgweb}/{webroot}/rev/{node|short}\n
5440 {desc}\n
5441 strip=5
5442
5443 [web]
5444 baseurl=http://my-project.org/hg
5445
5446 XMLRPC+email example configuration. This uses the Bugzilla at
5447 http://my-project.org/bugzilla, logging in as user bug‐
5448 mail@my-project.org with password plugh. It is used with a collection
5449 of Mercurial repositories in /var/local/hg/repos/, with a web interface
5450 at http://my-project.org/hg. Bug comments are sent to the Bugzilla
5451 email address bugzilla@my-project.org.
5452
5453 [bugzilla]
5454 bzurl=http://my-project.org/bugzilla
5455 user=bugmail@my-project.org
5456 password=plugh
5457 version=xmlrpc
5458 bzemail=bugzilla@my-project.org
5459 template=Changeset {node|short} in {root|basename}.
5460 {hgweb}/{webroot}/rev/{node|short}\n
5461 {desc}\n
5462 strip=5
5463
5464 [web]
5465 baseurl=http://my-project.org/hg
5466
5467 [usermap]
5468 user@emaildomain.com=user.name@bugzilladomain.com
5469
5470 MySQL example configuration. This has a local Bugzilla 3.2 installation
5471 in /opt/bugzilla-3.2. The MySQL database is on localhost, the Bugzilla
5472 database name is bugs and MySQL is accessed with MySQL username bugs
5473 password XYZZY. It is used with a collection of Mercurial repositories
5474 in /var/local/hg/repos/, with a web interface at
5475 http://my-project.org/hg.
5476
5477 [bugzilla]
5478 host=localhost
5479 password=XYZZY
5480 version=3.0
5481 bzuser=unknown@domain.com
5482 bzdir=/opt/bugzilla-3.2
5483 template=Changeset {node|short} in {root|basename}.
5484 {hgweb}/{webroot}/rev/{node|short}\n
5485 {desc}\n
5486 strip=5
5487
5488 [web]
5489 baseurl=http://my-project.org/hg
5490
5491 [usermap]
5492 user@emaildomain.com=user.name@bugzilladomain.com
5493
5494 All the above add a comment to the Bugzilla bug record of the form:
5495
5496 Changeset 3b16791d6642 in repository-name.
5497 http://my-project.org/hg/repository-name/rev/3b16791d6642
5498
5499 Changeset commit comment. Bug 1234.
5500
5501 children
5502 command to display child changesets (DEPRECATED)
5503
5504 This extension is deprecated. You should use hg log -r "children(REV)"
5505 instead.
5506
5507 Commands
5508 children
5509 hg children [-r REV] [FILE]
5510
5511 Print the children of the working directory's revisions. If a revision
5512 is given via -r/--rev, the children of that revision will be printed.
5513 If a file argument is given, revision in which the file was last
5514 changed (after the working directory revision or the argument to --rev
5515 if given) is printed.
5516
5517 Options:
5518
5519 -r, --rev
5520 show children of the specified revision
5521
5522 --style
5523 display using template map file
5524
5525 --template
5526 display with template
5527
5528 churn
5529 command to display statistics about repository history
5530
5531 Commands
5532 churn
5533 hg churn [-d DATE] [-r REV] [--aliases FILE] [FILE]
5534
5535 This command will display a histogram representing the number of
5536 changed lines or revisions, grouped according to the given template.
5537 The default template will group changes by author. The --dateformat
5538 option may be used to group the results by date instead.
5539
5540 Statistics are based on the number of changed lines, or alternatively
5541 the number of matching revisions if the --changesets option is speci‐
5542 fied.
5543
5544 Examples:
5545
5546 # display count of changed lines for every committer
5547 hg churn -t '{author|email}'
5548
5549 # display daily activity graph
5550 hg churn -f '%H' -s -c
5551
5552 # display activity of developers by month
5553 hg churn -f '%Y-%m' -s -c
5554
5555 # display count of lines changed in every year
5556 hg churn -f '%Y' -s
5557
5558 It is possible to map alternate email addresses to a main address by
5559 providing a file using the following format:
5560
5561 <alias email> = <actual email>
5562
5563 Such a file may be specified with the --aliases option, otherwise a
5564 .hgchurn file will be looked for in the working directory root.
5565
5566 Options:
5567
5568 -r, --rev
5569 count rate for the specified revision or range
5570
5571 -d, --date
5572 count rate for revisions matching date spec
5573
5574 -t, --template
5575 template to group changesets (default: {author|email})
5576
5577 -f, --dateformat
5578 strftime-compatible format for grouping by date
5579
5580 -c, --changesets
5581 count rate by number of changesets
5582
5583 -s, --sort
5584 sort by key (default: sort by count)
5585
5586 --diffstat
5587 display added/removed lines separately
5588
5589 --aliases
5590 file with email aliases
5591
5592 -I, --include
5593 include names matching the given patterns
5594
5595 -X, --exclude
5596 exclude names matching the given patterns
5597
5598 color
5599 colorize output from some commands
5600
5601 This extension modifies the status and resolve commands to add color to
5602 their output to reflect file status, the qseries command to add color
5603 to reflect patch status (applied, unapplied, missing), and to
5604 diff-related commands to highlight additions, removals, diff headers,
5605 and trailing whitespace.
5606
5607 Other effects in addition to color, like bold and underlined text, are
5608 also available. By default, the terminfo database is used to find the
5609 terminal codes used to change color and effect. If terminfo is not
5610 available, then effects are rendered with the ECMA-48 SGR control func‐
5611 tion (aka ANSI escape codes).
5612
5613 Default effects may be overridden from your configuration file:
5614
5615 [color]
5616 status.modified = blue bold underline red_background
5617 status.added = green bold
5618 status.removed = red bold blue_background
5619 status.deleted = cyan bold underline
5620 status.unknown = magenta bold underline
5621 status.ignored = black bold
5622
5623 # 'none' turns off all effects
5624 status.clean = none
5625 status.copied = none
5626
5627 qseries.applied = blue bold underline
5628 qseries.unapplied = black bold
5629 qseries.missing = red bold
5630
5631 diff.diffline = bold
5632 diff.extended = cyan bold
5633 diff.file_a = red bold
5634 diff.file_b = green bold
5635 diff.hunk = magenta
5636 diff.deleted = red
5637 diff.inserted = green
5638 diff.changed = white
5639 diff.trailingwhitespace = bold red_background
5640
5641 resolve.unresolved = red bold
5642 resolve.resolved = green bold
5643
5644 bookmarks.current = green
5645
5646 branches.active = none
5647 branches.closed = black bold
5648 branches.current = green
5649 branches.inactive = none
5650
5651 tags.normal = green
5652 tags.local = black bold
5653
5654 The available effects in terminfo mode are 'blink', 'bold', 'dim',
5655 'inverse', 'invisible', 'italic', 'standout', and 'underline'; in
5656 ECMA-48 mode, the options are 'bold', 'inverse', 'italic', and 'under‐
5657 line'. How each is rendered depends on the terminal emulator. Some
5658 may not be available for a given terminal type, and will be silently
5659 ignored.
5660
5661 Note that on some systems, terminfo mode may cause problems when using
5662 color with the pager extension and less -R. less with the -R option
5663 will only display ECMA-48 color codes, and terminfo mode may sometimes
5664 emit codes that less doesn't understand. You can work around this by
5665 either using ansi mode (or auto mode), or by using less -r (which will
5666 pass through all terminal control codes, not just color control codes).
5667
5668 Because there are only eight standard colors, this module allows you to
5669 define color names for other color slots which might be available for
5670 your terminal type, assuming terminfo mode. For instance:
5671
5672 color.brightblue = 12
5673 color.pink = 207
5674 color.orange = 202
5675
5676 to set 'brightblue' to color slot 12 (useful for 16 color terminals
5677 that have brighter colors defined in the upper eight) and, 'pink' and
5678 'orange' to colors in 256-color xterm's default color cube. These
5679 defined colors may then be used as any of the pre-defined eight,
5680 including appending '_background' to set the background to that color.
5681
5682 By default, the color extension will use ANSI mode (or win32 mode on
5683 Windows) if it detects a terminal. To override auto mode (to enable
5684 terminfo mode, for example), set the following configuration option:
5685
5686 [color]
5687 mode = terminfo
5688
5689 Any value other than 'ansi', 'win32', 'terminfo', or 'auto' will dis‐
5690 able color.
5691
5692 convert
5693 import revisions from foreign VCS repositories into Mercurial
5694
5695 Commands
5696 convert
5697 hg convert [OPTION]... SOURCE [DEST [REVMAP]]
5698
5699 Accepted source formats [identifiers]:
5700
5701 · Mercurial [hg]
5702
5703 · CVS [cvs]
5704
5705 · Darcs [darcs]
5706
5707 · git [git]
5708
5709 · Subversion [svn]
5710
5711 · Monotone [mtn]
5712
5713 · GNU Arch [gnuarch]
5714
5715 · Bazaar [bzr]
5716
5717 · Perforce [p4]
5718
5719 Accepted destination formats [identifiers]:
5720
5721 · Mercurial [hg]
5722
5723 · Subversion [svn] (history on branches is not preserved)
5724
5725 If no revision is given, all revisions will be converted. Otherwise,
5726 convert will only import up to the named revision (given in a format
5727 understood by the source).
5728
5729 If no destination directory name is specified, it defaults to the base‐
5730 name of the source with -hg appended. If the destination repository
5731 doesn't exist, it will be created.
5732
5733 By default, all sources except Mercurial will use --branchsort. Mercu‐
5734 rial uses --sourcesort to preserve original revision numbers order.
5735 Sort modes have the following effects:
5736
5737 --branchsort
5738 convert from parent to child revision when possible, which means
5739 branches are usually converted one after the other. It generates
5740 more compact repositories.
5741
5742 --datesort
5743 sort revisions by date. Converted repositories have good-looking
5744 changelogs but are often an order of magnitude larger than the
5745 same ones generated by --branchsort.
5746
5747 --sourcesort
5748 try to preserve source revisions order, only supported by Mercu‐
5749 rial sources.
5750
5751 --closesort
5752 try to move closed revisions as close as possible to parent
5753 branches, only supported by Mercurial sources.
5754
5755 If REVMAP isn't given, it will be put in a default location
5756 (<dest>/.hg/shamap by default). The REVMAP is a simple text file that
5757 maps each source commit ID to the destination ID for that revision,
5758 like so:
5759
5760 <source ID> <destination ID>
5761
5762 If the file doesn't exist, it's automatically created. It's updated on
5763 each commit copied, so hg convert can be interrupted and can be run
5764 repeatedly to copy new commits.
5765
5766 The authormap is a simple text file that maps each source commit author
5767 to a destination commit author. It is handy for source SCMs that use
5768 unix logins to identify authors (e.g.: CVS). One line per author map‐
5769 ping and the line format is:
5770
5771 source author = destination author
5772
5773 Empty lines and lines starting with a # are ignored.
5774
5775 The filemap is a file that allows filtering and remapping of files and
5776 directories. Each line can contain one of the following directives:
5777
5778 include path/to/file-or-dir
5779
5780 exclude path/to/file-or-dir
5781
5782 rename path/to/source path/to/destination
5783
5784 Comment lines start with #. A specified path matches if it equals the
5785 full relative name of a file or one of its parent directories. The
5786 include or exclude directive with the longest matching path applies, so
5787 line order does not matter.
5788
5789 The include directive causes a file, or all files under a directory, to
5790 be included in the destination repository, and the exclusion of all
5791 other files and directories not explicitly included. The exclude direc‐
5792 tive causes files or directories to be omitted. The rename directive
5793 renames a file or directory if it is converted. To rename from a subdi‐
5794 rectory into the root of the repository, use . as the path to rename
5795 to.
5796
5797 The splicemap is a file that allows insertion of synthetic history,
5798 letting you specify the parents of a revision. This is useful if you
5799 want to e.g. give a Subversion merge two parents, or graft two discon‐
5800 nected series of history together. Each entry contains a key, followed
5801 by a space, followed by one or two comma-separated values:
5802
5803 key parent1, parent2
5804
5805 The key is the revision ID in the source revision control system whose
5806 parents should be modified (same format as a key in .hg/shamap). The
5807 values are the revision IDs (in either the source or destination revi‐
5808 sion control system) that should be used as the new parents for that
5809 node. For example, if you have merged "release-1.0" into "trunk", then
5810 you should specify the revision on "trunk" as the first parent and the
5811 one on the "release-1.0" branch as the second.
5812
5813 The branchmap is a file that allows you to rename a branch when it is
5814 being brought in from whatever external repository. When used in con‐
5815 junction with a splicemap, it allows for a powerful combination to help
5816 fix even the most badly mismanaged repositories and turn them into
5817 nicely structured Mercurial repositories. The branchmap contains lines
5818 of the form:
5819
5820 original_branch_name new_branch_name
5821
5822 where "original_branch_name" is the name of the branch in the source
5823 repository, and "new_branch_name" is the name of the branch is the des‐
5824 tination repository. No whitespace is allowed in the branch names. This
5825 can be used to (for instance) move code in one repository from
5826 "default" to a named branch.
5827
5828 Mercurial Source
5829 The Mercurial source recognizes the following configuration options,
5830 which you can set on the command line with --config:
5831
5832 convert.hg.ignoreerrors
5833 ignore integrity errors when reading. Use it to fix Mercurial
5834 repositories with missing revlogs, by converting from and to
5835 Mercurial. Default is False.
5836
5837 convert.hg.saverev
5838 store original revision ID in changeset (forces target IDs to
5839 change). It takes a boolean argument and defaults to False.
5840
5841 convert.hg.startrev
5842 convert start revision and its descendants. It takes a hg revi‐
5843 sion identifier and defaults to 0.
5844
5845 CVS Source
5846 CVS source will use a sandbox (i.e. a checked-out copy) from CVS to
5847 indicate the starting point of what will be converted. Direct access to
5848 the repository files is not needed, unless of course the repository is
5849 :local:. The conversion uses the top level directory in the sandbox to
5850 find the CVS repository, and then uses CVS rlog commands to find files
5851 to convert. This means that unless a filemap is given, all files under
5852 the starting directory will be converted, and that any directory reor‐
5853 ganization in the CVS sandbox is ignored.
5854
5855 The following options can be used with --config:
5856
5857 convert.cvsps.cache
5858 Set to False to disable remote log caching, for testing and
5859 debugging purposes. Default is True.
5860
5861 convert.cvsps.fuzz
5862 Specify the maximum time (in seconds) that is allowed between
5863 commits with identical user and log message in a single change‐
5864 set. When very large files were checked in as part of a change‐
5865 set then the default may not be long enough. The default is 60.
5866
5867 convert.cvsps.mergeto
5868 Specify a regular expression to which commit log messages are
5869 matched. If a match occurs, then the conversion process will
5870 insert a dummy revision merging the branch on which this log
5871 message occurs to the branch indicated in the regex. Default is
5872 {{mergetobranch ([-\w]+)}}
5873
5874 convert.cvsps.mergefrom
5875 Specify a regular expression to which commit log messages are
5876 matched. If a match occurs, then the conversion process will add
5877 the most recent revision on the branch indicated in the regex as
5878 the second parent of the changeset. Default is {{mergefrombranch
5879 ([-\w]+)}}
5880
5881 convert.localtimezone
5882 use local time (as determined by the TZ environment variable)
5883 for changeset date/times. The default is False (use UTC).
5884
5885 hooks.cvslog
5886 Specify a Python function to be called at the end of gathering
5887 the CVS log. The function is passed a list with the log entries,
5888 and can modify the entries in-place, or add or delete them.
5889
5890 hooks.cvschangesets
5891 Specify a Python function to be called after the changesets are
5892 calculated from the CVS log. The function is passed a list with
5893 the changeset entries, and can modify the changesets in-place,
5894 or add or delete them.
5895
5896 An additional "debugcvsps" Mercurial command allows the builtin change‐
5897 set merging code to be run without doing a conversion. Its parameters
5898 and output are similar to that of cvsps 2.1. Please see the command
5899 help for more details.
5900
5901 Subversion Source
5902 Subversion source detects classical trunk/branches/tags layouts. By
5903 default, the supplied svn://repo/path/ source URL is converted as a
5904 single branch. If svn://repo/path/trunk exists it replaces the default
5905 branch. If svn://repo/path/branches exists, its subdirectories are
5906 listed as possible branches. If svn://repo/path/tags exists, it is
5907 looked for tags referencing converted branches. Default trunk, branches
5908 and tags values can be overridden with following options. Set them to
5909 paths relative to the source URL, or leave them blank to disable auto
5910 detection.
5911
5912 The following options can be set with --config:
5913
5914 convert.svn.branches
5915 specify the directory containing branches. The default is
5916 branches.
5917
5918 convert.svn.tags
5919 specify the directory containing tags. The default is tags.
5920
5921 convert.svn.trunk
5922 specify the name of the trunk branch. The default is trunk.
5923
5924 convert.localtimezone
5925 use local time (as determined by the TZ environment variable)
5926 for changeset date/times. The default is False (use UTC).
5927
5928 Source history can be retrieved starting at a specific revision,
5929 instead of being integrally converted. Only single branch conversions
5930 are supported.
5931
5932 convert.svn.startrev
5933 specify start Subversion revision number. The default is 0.
5934
5935 Perforce Source
5936 The Perforce (P4) importer can be given a p4 depot path or a client
5937 specification as source. It will convert all files in the source to a
5938 flat Mercurial repository, ignoring labels, branches and integrations.
5939 Note that when a depot path is given you then usually should specify a
5940 target directory, because otherwise the target may be named ...-hg.
5941
5942 It is possible to limit the amount of source history to be converted by
5943 specifying an initial Perforce revision:
5944
5945 convert.p4.startrev
5946 specify initial Perforce revision (a Perforce changelist num‐
5947 ber).
5948
5949 Mercurial Destination
5950 The following options are supported:
5951
5952 convert.hg.clonebranches
5953 dispatch source branches in separate clones. The default is
5954 False.
5955
5956 convert.hg.tagsbranch
5957 branch name for tag revisions, defaults to default.
5958
5959 convert.hg.usebranchnames
5960 preserve branch names. The default is True.
5961
5962 Options:
5963
5964 --authors
5965 username mapping filename (DEPRECATED, use --authormap instead)
5966
5967 -s, --source-type
5968 source repository type
5969
5970 -d, --dest-type
5971 destination repository type
5972
5973 -r, --rev
5974 import up to target revision REV
5975
5976 -A, --authormap
5977 remap usernames using this file
5978
5979 --filemap
5980 remap file names using contents of file
5981
5982 --splicemap
5983 splice synthesized history into place
5984
5985 --branchmap
5986 change branch names while converting
5987
5988 --branchsort
5989 try to sort changesets by branches
5990
5991 --datesort
5992 try to sort changesets by date
5993
5994 --sourcesort
5995 preserve source changesets order
5996
5997 --closesort
5998 try to reorder closed revisions
5999
6000 eol
6001 automatically manage newlines in repository files
6002
6003 This extension allows you to manage the type of line endings (CRLF or
6004 LF) that are used in the repository and in the local working directory.
6005 That way you can get CRLF line endings on Windows and LF on Unix/Mac,
6006 thereby letting everybody use their OS native line endings.
6007
6008 The extension reads its configuration from a versioned .hgeol configu‐
6009 ration file found in the root of the working copy. The .hgeol file use
6010 the same syntax as all other Mercurial configuration files. It uses two
6011 sections, [patterns] and [repository].
6012
6013 The [patterns] section specifies how line endings should be converted
6014 between the working copy and the repository. The format is specified by
6015 a file pattern. The first match is used, so put more specific patterns
6016 first. The available line endings are LF, CRLF, and BIN.
6017
6018 Files with the declared format of CRLF or LF are always checked out and
6019 stored in the repository in that format and files declared to be binary
6020 (BIN) are left unchanged. Additionally, native is an alias for checking
6021 out in the platform's default line ending: LF on Unix (including Mac OS
6022 X) and CRLF on Windows. Note that BIN (do nothing to line endings) is
6023 Mercurial's default behaviour; it is only needed if you need to over‐
6024 ride a later, more general pattern.
6025
6026 The optional [repository] section specifies the line endings to use for
6027 files stored in the repository. It has a single setting, native, which
6028 determines the storage line endings for files declared as native in the
6029 [patterns] section. It can be set to LF or CRLF. The default is LF. For
6030 example, this means that on Windows, files configured as native (CRLF
6031 by default) will be converted to LF when stored in the repository.
6032 Files declared as LF, CRLF, or BIN in the [patterns] section are always
6033 stored as-is in the repository.
6034
6035 Example versioned .hgeol file:
6036
6037 [patterns]
6038 **.py = native
6039 **.vcproj = CRLF
6040 **.txt = native
6041 Makefile = LF
6042 **.jpg = BIN
6043
6044 [repository]
6045 native = LF
6046
6047 Note The rules will first apply when files are touched in the working
6048 copy, e.g. by updating to null and back to tip to touch all
6049 files.
6050
6051 The extension uses an optional [eol] section read from both the normal
6052 Mercurial configuration files and the .hgeol file, with the latter
6053 overriding the former. You can use that section to control the overall
6054 behavior. There are three settings:
6055
6056 · eol.native (default os.linesep) can be set to LF or CRLF to override
6057 the default interpretation of native for checkout. This can be used
6058 with hg archive on Unix, say, to generate an archive where files have
6059 line endings for Windows.
6060
6061 · eol.only-consistent (default True) can be set to False to make the
6062 extension convert files with inconsistent EOLs. Inconsistent means
6063 that there is both CRLF and LF present in the file. Such files are
6064 normally not touched under the assumption that they have mixed EOLs
6065 on purpose.
6066
6067 · eol.fix-trailing-newline (default False) can be set to True to ensure
6068 that converted files end with a EOL character (either \n or \r\n as
6069 per the configured patterns).
6070
6071 The extension provides cleverencode: and cleverdecode: filters like the
6072 deprecated win32text extension does. This means that you can disable
6073 win32text and enable eol and your filters will still work. You only
6074 need to these filters until you have prepared a .hgeol file.
6075
6076 The win32text.forbid* hooks provided by the win32text extension have
6077 been unified into a single hook named eol.checkheadshook. The hook will
6078 lookup the expected line endings from the .hgeol file, which means you
6079 must migrate to a .hgeol file first before using the hook. eol.check‐
6080 headshook only checks heads, intermediate invalid revisions will be
6081 pushed. To forbid them completely, use the eol.checkallhook hook. These
6082 hooks are best used as pretxnchangegroup hooks.
6083
6084 See hg help patterns for more information about the glob patterns used.
6085
6086 extdiff
6087 command to allow external programs to compare revisions
6088
6089 The extdiff Mercurial extension allows you to use external programs to
6090 compare revisions, or revision with working directory. The external
6091 diff programs are called with a configurable set of options and two
6092 non-option arguments: paths to directories containing snapshots of
6093 files to compare.
6094
6095 The extdiff extension also allows you to configure new diff commands,
6096 so you do not need to type hg extdiff -p kdiff3 always.
6097
6098 [extdiff]
6099 # add new command that runs GNU diff(1) in 'context diff' mode
6100 cdiff = gdiff -Nprc5
6101 ## or the old way:
6102 #cmd.cdiff = gdiff
6103 #opts.cdiff = -Nprc5
6104
6105 # add new command called vdiff, runs kdiff3
6106 vdiff = kdiff3
6107
6108 # add new command called meld, runs meld (no need to name twice)
6109 meld =
6110
6111 # add new command called vimdiff, runs gvimdiff with DirDiff plugin
6112 # (see http://www.vim.org/scripts/script.php?script_id=102) Non
6113 # English user, be sure to put "let g:DirDiffDynamicDiffText = 1" in
6114 # your .vimrc
6115 vimdiff = gvim -f "+next" \
6116 "+execute 'DirDiff' fnameescape(argv(0)) fnameescape(argv(1))"
6117
6118 Tool arguments can include variables that are expanded at runtime:
6119
6120 $parent1, $plabel1 - filename, descriptive label of first parent
6121 $child, $clabel - filename, descriptive label of child revision
6122 $parent2, $plabel2 - filename, descriptive label of second parent
6123 $root - repository root
6124 $parent is an alias for $parent1.
6125
6126 The extdiff extension will look in your [diff-tools] and [merge-tools]
6127 sections for diff tool arguments, when none are specified in [extdiff].
6128
6129 [extdiff]
6130 kdiff3 =
6131
6132 [diff-tools]
6133 kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child
6134
6135 You can use -I/-X and list of file or directory names like normal hg
6136 diff command. The extdiff extension makes snapshots of only needed
6137 files, so running the external diff program will actually be pretty
6138 fast (at least faster than having to compare the entire tree).
6139
6140 Commands
6141 extdiff
6142 hg extdiff [OPT]... [FILE]...
6143
6144 Show differences between revisions for the specified files, using an
6145 external program. The default program used is diff, with default
6146 options "-Npru".
6147
6148 To select a different program, use the -p/--program option. The program
6149 will be passed the names of two directories to compare. To pass addi‐
6150 tional options to the program, use -o/--option. These will be passed
6151 before the names of the directories to compare.
6152
6153 When two revision arguments are given, then changes are shown between
6154 those revisions. If only one revision is specified then that revision
6155 is compared to the working directory, and, when no revisions are speci‐
6156 fied, the working directory files are compared to its parent.
6157
6158 Options:
6159
6160 -p, --program
6161 comparison program to run
6162
6163 -o, --option
6164 pass option to comparison program
6165
6166 -r, --rev
6167 revision
6168
6169 -c, --change
6170 change made by revision
6171
6172 -I, --include
6173 include names matching the given patterns
6174
6175 -X, --exclude
6176 exclude names matching the given patterns
6177
6178 factotum
6179 http authentication with factotum
6180
6181 This extension allows the factotum(4) facility on Plan 9 from Bell Labs
6182 platforms to provide authentication information for HTTP access. Con‐
6183 figuration entries specified in the auth section as well as authentica‐
6184 tion information provided in the repository URL are fully supported. If
6185 no prefix is specified, a value of "*" will be assumed.
6186
6187 By default, keys are specified as:
6188
6189 proto=pass service=hg prefix=<prefix> user=<username> !password=<password>
6190
6191 If the factotum extension is unable to read the required key, one will
6192 be requested interactively.
6193
6194 A configuration section is available to customize runtime behavior. By
6195 default, these entries are:
6196
6197 [factotum]
6198 executable = /bin/auth/factotum
6199 mountpoint = /mnt/factotum
6200 service = hg
6201
6202 The executable entry defines the full path to the factotum binary. The
6203 mountpoint entry defines the path to the factotum file service. Lastly,
6204 the service entry controls the service name used when reading keys.
6205
6206 fetch
6207 pull, update and merge in one command (DEPRECATED)
6208
6209 Commands
6210 fetch
6211 hg fetch [SOURCE]
6212
6213 This finds all changes from the repository at the specified path or URL
6214 and adds them to the local repository.
6215
6216 If the pulled changes add a new branch head, the head is automatically
6217 merged, and the result of the merge is committed. Otherwise, the work‐
6218 ing directory is updated to include the new changes.
6219
6220 When a merge is needed, the working directory is first updated to the
6221 newly pulled changes. Local changes are then merged into the pulled
6222 changes. To switch the merge order, use --switch-parent.
6223
6224 See hg help dates for a list of formats valid for -d/--date.
6225
6226 Returns 0 on success.
6227
6228 Options:
6229
6230 -r, --rev
6231 a specific revision you would like to pull
6232
6233 -e, --edit
6234 edit commit message
6235
6236 --force-editor
6237 edit commit message (DEPRECATED)
6238
6239 --switch-parent
6240 switch parents when merging
6241
6242 -m, --message
6243 use text as commit message
6244
6245 -l, --logfile
6246 read commit message from file
6247
6248 -d, --date
6249 record the specified date as commit date
6250
6251 -u, --user
6252 record the specified user as committer
6253
6254 -e, --ssh
6255 specify ssh command to use
6256
6257 --remotecmd
6258 specify hg command to run on the remote side
6259
6260 --insecure
6261 do not verify server certificate (ignoring web.cacerts config)
6262
6263 gpg
6264 commands to sign and verify changesets
6265
6266 Commands
6267 sigcheck
6268 hg sigcheck REV
6269
6270 verify all the signatures there may be for a particular revision
6271
6272 sign
6273 hg sign [OPTION]... [REV]...
6274
6275 If no revision is given, the parent of the working directory is used,
6276 or tip if no revision is checked out.
6277
6278 See hg help dates for a list of formats valid for -d/--date.
6279
6280 Options:
6281
6282 -l, --local
6283 make the signature local
6284
6285 -f, --force
6286 sign even if the sigfile is modified
6287
6288 --no-commit
6289 do not commit the sigfile after signing
6290
6291 -k, --key
6292 the key id to sign with
6293
6294 -m, --message
6295 commit message
6296
6297 -d, --date
6298 record the specified date as commit date
6299
6300 -u, --user
6301 record the specified user as committer
6302
6303 sigs
6304 hg sigs
6305
6306 list signed changesets
6307
6308 graphlog
6309 command to view revision graphs from a shell
6310
6311 This extension adds a --graph option to the incoming, outgoing and log
6312 commands. When this options is given, an ASCII representation of the
6313 revision graph is also shown.
6314
6315 Commands
6316 glog
6317 hg glog [OPTION]... [FILE]
6318
6319 Print a revision history alongside a revision graph drawn with ASCII
6320 characters.
6321
6322 Nodes printed as an @ character are parents of the working directory.
6323
6324 Options:
6325
6326 -f, --follow
6327 follow changeset history, or file history across copies and
6328 renames
6329
6330 --follow-first
6331 only follow the first parent of merge changesets (DEPRECATED)
6332
6333 -d, --date
6334 show revisions matching date spec
6335
6336 -C, --copies
6337 show copied files
6338
6339 -k, --keyword
6340 do case-insensitive search for a given text
6341
6342 -r, --rev
6343 show the specified revision or range
6344
6345 --removed
6346 include revisions where files were removed
6347
6348 -m, --only-merges
6349 show only merges (DEPRECATED)
6350
6351 -u, --user
6352 revisions committed by user
6353
6354 --only-branch
6355 show only changesets within the given named branch (DEPRECATED)
6356
6357 -b, --branch
6358 show changesets within the given named branch
6359
6360 -P, --prune
6361 do not display revision or any of its ancestors
6362
6363 -p, --patch
6364 show patch
6365
6366 -g, --git
6367 use git extended diff format
6368
6369 -l, --limit
6370 limit number of changes displayed
6371
6372 -M, --no-merges
6373 do not show merges
6374
6375 --stat output diffstat-style summary of changes
6376
6377 -G, --graph
6378 show the revision DAG
6379
6380 --style
6381 display using template map file
6382
6383 --template
6384 display with template
6385
6386 -I, --include
6387 include names matching the given patterns
6388
6389 -X, --exclude
6390 exclude names matching the given patterns
6391
6392 hgcia
6393 hooks for integrating with the CIA.vc notification service
6394
6395 This is meant to be run as a changegroup or incoming hook. To configure
6396 it, set the following options in your hgrc:
6397
6398 [cia]
6399 # your registered CIA user name
6400 user = foo
6401 # the name of the project in CIA
6402 project = foo
6403 # the module (subproject) (optional)
6404 #module = foo
6405 # Append a diffstat to the log message (optional)
6406 #diffstat = False
6407 # Template to use for log messages (optional)
6408 #template = {desc}\n{baseurl}{webroot}/rev/{node}-- {diffstat}
6409 # Style to use (optional)
6410 #style = foo
6411 # The URL of the CIA notification service (optional)
6412 # You can use mailto: URLs to send by email, e.g.
6413 # mailto:cia@cia.vc
6414 # Make sure to set email.from if you do this.
6415 #url = http://cia.vc/
6416 # print message instead of sending it (optional)
6417 #test = False
6418 # number of slashes to strip for url paths
6419 #strip = 0
6420
6421 [hooks]
6422 # one of these:
6423 changegroup.cia = python:hgcia.hook
6424 #incoming.cia = python:hgcia.hook
6425
6426 [web]
6427 # If you want hyperlinks (optional)
6428 baseurl = http://server/path/to/repo
6429
6430 hgk
6431 browse the repository in a graphical way
6432
6433 The hgk extension allows browsing the history of a repository in a
6434 graphical way. It requires Tcl/Tk version 8.4 or later. (Tcl/Tk is not
6435 distributed with Mercurial.)
6436
6437 hgk consists of two parts: a Tcl script that does the displaying and
6438 querying of information, and an extension to Mercurial named hgk.py,
6439 which provides hooks for hgk to get information. hgk can be found in
6440 the contrib directory, and the extension is shipped in the hgext repos‐
6441 itory, and needs to be enabled.
6442
6443 The hg view command will launch the hgk Tcl script. For this command to
6444 work, hgk must be in your search path. Alternately, you can specify the
6445 path to hgk in your configuration file:
6446
6447 [hgk]
6448 path=/location/of/hgk
6449
6450 hgk can make use of the extdiff extension to visualize revisions.
6451 Assuming you had already configured extdiff vdiff command, just add:
6452
6453 [hgk]
6454 vdiff=vdiff
6455
6456 Revisions context menu will now display additional entries to fire
6457 vdiff on hovered and selected revisions.
6458
6459 Commands
6460 view
6461 hg view [-l LIMIT] [REVRANGE]
6462
6463 start interactive history viewer
6464
6465 Options:
6466
6467 -l, --limit
6468 limit number of changes displayed
6469
6470 highlight
6471 syntax highlighting for hgweb (requires Pygments)
6472
6473 It depends on the Pygments syntax highlighting library:
6474 http://pygments.org/
6475
6476 There is a single configuration option:
6477
6478 [web]
6479 pygments_style = <style>
6480
6481 The default is 'colorful'.
6482
6483 histedit
6484 interactive history editing
6485
6486 With this extension installed, Mercurial gains one new command: histe‐
6487 dit. Usage is as follows, assuming the following history:
6488
6489 @ 3[tip] 7c2fd3b9020c 2009-04-27 18:04 -0500 durin42
6490 | Add delta
6491 |
6492 o 2 030b686bedc4 2009-04-27 18:04 -0500 durin42
6493 | Add gamma
6494 |
6495 o 1 c561b4e977df 2009-04-27 18:04 -0500 durin42
6496 | Add beta
6497 |
6498 o 0 d8d2fcd0e319 2009-04-27 18:04 -0500 durin42
6499 Add alpha
6500
6501 If you were to run hg histedit c561b4e977df, you would see the follow‐
6502 ing file open in your editor:
6503
6504 pick c561b4e977df Add beta
6505 pick 030b686bedc4 Add gamma
6506 pick 7c2fd3b9020c Add delta
6507
6508 # Edit history between c561b4e977df and 7c2fd3b9020c
6509 #
6510 # Commands:
6511 # p, pick = use commit
6512 # e, edit = use commit, but stop for amending
6513 # f, fold = use commit, but fold into previous commit (combines N and N-1)
6514 # d, drop = remove commit from history
6515 # m, mess = edit message without changing commit content
6516 #
6517
6518 In this file, lines beginning with # are ignored. You must specify a
6519 rule for each revision in your history. For example, if you had meant
6520 to add gamma before beta, and then wanted to add delta in the same
6521 revision as beta, you would reorganize the file to look like this:
6522
6523 pick 030b686bedc4 Add gamma
6524 pick c561b4e977df Add beta
6525 fold 7c2fd3b9020c Add delta
6526
6527 # Edit history between c561b4e977df and 7c2fd3b9020c
6528 #
6529 # Commands:
6530 # p, pick = use commit
6531 # e, edit = use commit, but stop for amending
6532 # f, fold = use commit, but fold into previous commit (combines N and N-1)
6533 # d, drop = remove commit from history
6534 # m, mess = edit message without changing commit content
6535 #
6536
6537 At which point you close the editor and histedit starts working. When
6538 you specify a fold operation, histedit will open an editor when it
6539 folds those revisions together, offering you a chance to clean up the
6540 commit message:
6541
6542 Add beta
6543 ***
6544 Add delta
6545
6546 Edit the commit message to your liking, then close the editor. For this
6547 example, let's assume that the commit message was changed to Add beta
6548 and delta. After histedit has run and had a chance to remove any old or
6549 temporary revisions it needed, the history looks like this:
6550
6551 @ 2[tip] 989b4d060121 2009-04-27 18:04 -0500 durin42
6552 | Add beta and delta.
6553 |
6554 o 1 081603921c3f 2009-04-27 18:04 -0500 durin42
6555 | Add gamma
6556 |
6557 o 0 d8d2fcd0e319 2009-04-27 18:04 -0500 durin42
6558 Add alpha
6559
6560 Note that histedit does not remove any revisions (even its own tempo‐
6561 rary ones) until after it has completed all the editing operations, so
6562 it will probably perform several strip operations when it's done. For
6563 the above example, it had to run strip twice. Strip can be slow depend‐
6564 ing on a variety of factors, so you might need to be a little patient.
6565 You can choose to keep the original revisions by passing the --keep
6566 flag.
6567
6568 The edit operation will drop you back to a command prompt, allowing you
6569 to edit files freely, or even use hg record to commit some changes as a
6570 separate commit. When you're done, any remaining uncommitted changes
6571 will be committed as well. When done, run hg histedit --continue to
6572 finish this step. You'll be prompted for a new commit message, but the
6573 default commit message will be the original message for the edit ed
6574 revision.
6575
6576 The message operation will give you a chance to revise a commit message
6577 without changing the contents. It's a shortcut for doing edit immedi‐
6578 ately followed by hg histedit --continue`.
6579
6580 If histedit encounters a conflict when moving a revision (while han‐
6581 dling pick or fold), it'll stop in a similar manner to edit with the
6582 difference that it won't prompt you for a commit message when done. If
6583 you decide at this point that you don't like how much work it will be
6584 to rearrange history, or that you made a mistake, you can use hg histe‐
6585 dit --abort to abandon the new changes you have made and return to the
6586 state before you attempted to edit your history.
6587
6588 If we clone the histedit-ed example repository above and add four more
6589 changes, such that we have the following history:
6590
6591 @ 6[tip] 038383181893 2009-04-27 18:04 -0500 stefan
6592 | Add theta
6593 |
6594 o 5 140988835471 2009-04-27 18:04 -0500 stefan
6595 | Add eta
6596 |
6597 o 4 122930637314 2009-04-27 18:04 -0500 stefan
6598 | Add zeta
6599 |
6600 o 3 836302820282 2009-04-27 18:04 -0500 stefan
6601 | Add epsilon
6602 |
6603 o 2 989b4d060121 2009-04-27 18:04 -0500 durin42
6604 | Add beta and delta.
6605 |
6606 o 1 081603921c3f 2009-04-27 18:04 -0500 durin42
6607 | Add gamma
6608 |
6609 o 0 d8d2fcd0e319 2009-04-27 18:04 -0500 durin42
6610 Add alpha
6611
6612 If you run hg histedit --outgoing on the clone then it is the same as
6613 running hg histedit 836302820282. If you need plan to push to a reposi‐
6614 tory that Mercurial does not detect to be related to the source repo,
6615 you can add a --force option.
6616
6617 Commands
6618 histedit
6619 hg histedit [PARENT]
6620
6621 interactively edit changeset history
6622
6623 Options:
6624
6625 --commands
6626 Read history edits from the specified file.
6627
6628 -c, --continue
6629 continue an edit already in progress
6630
6631 -k, --keep
6632 don't strip old nodes after edit is complete
6633
6634 --abort
6635 abort an edit in progress
6636
6637 -o, --outgoing
6638 changesets not found in destination
6639
6640 -f, --force
6641 force outgoing even for unrelated repositories
6642
6643 -r, --rev
6644 first revision to be edited
6645
6646 inotify
6647 accelerate status report using Linux's inotify service
6648
6649 Commands
6650 inserve
6651 hg inserve [OPTION]...
6652
6653 start an inotify server for this repository
6654
6655 Options:
6656
6657 -d, --daemon
6658 run server in background
6659
6660 --daemon-pipefds
6661 used internally by daemon mode
6662
6663 -t, --idle-timeout
6664 minutes to sit idle before exiting
6665
6666 --pid-file
6667 name of file to write process ID to
6668
6669 interhg
6670 None
6671
6672 keyword
6673 expand keywords in tracked files
6674
6675 This extension expands RCS/CVS-like or self-customized $Keywords$ in
6676 tracked text files selected by your configuration.
6677
6678 Keywords are only expanded in local repositories and not stored in the
6679 change history. The mechanism can be regarded as a convenience for the
6680 current user or for archive distribution.
6681
6682 Keywords expand to the changeset data pertaining to the latest change
6683 relative to the working directory parent of each file.
6684
6685 Configuration is done in the [keyword], [keywordset] and [keywordmaps]
6686 sections of hgrc files.
6687
6688 Example:
6689
6690 [keyword]
6691 # expand keywords in every python file except those matching "x*"
6692 **.py =
6693 x* = ignore
6694
6695 [keywordset]
6696 # prefer svn- over cvs-like default keywordmaps
6697 svn = True
6698
6699 Note The more specific you are in your filename patterns the less you
6700 lose speed in huge repositories.
6701
6702 For [keywordmaps] template mapping and expansion demonstration and con‐
6703 trol run hg kwdemo. See hg help templates for a list of available tem‐
6704 plates and filters.
6705
6706 Three additional date template filters are provided:
6707
6708 utcdate
6709
6710 "2006/09/18 15:13:13"
6711
6712 svnutcdate
6713
6714 "2006-09-18 15:13:13Z"
6715
6716 svnisodate
6717
6718 "2006-09-18 08:13:13 -700 (Mon, 18 Sep 2006)"
6719
6720 The default template mappings (view with hg kwdemo -d) can be replaced
6721 with customized keywords and templates. Again, run hg kwdemo to control
6722 the results of your configuration changes.
6723
6724 Before changing/disabling active keywords, you must run hg kwshrink to
6725 avoid storing expanded keywords in the change history.
6726
6727 To force expansion after enabling it, or a configuration change, run hg
6728 kwexpand.
6729
6730 Expansions spanning more than one line and incremental expansions, like
6731 CVS' $Log$, are not supported. A keyword template map "Log = {desc}"
6732 expands to the first line of the changeset description.
6733
6734 Commands
6735 kwdemo
6736 hg kwdemo [-d] [-f RCFILE] [TEMPLATEMAP]...
6737
6738 Show current, custom, or default keyword template maps and their expan‐
6739 sions.
6740
6741 Extend the current configuration by specifying maps as arguments and
6742 using -f/--rcfile to source an external hgrc file.
6743
6744 Use -d/--default to disable current configuration.
6745
6746 See hg help templates for information on templates and filters.
6747
6748 Options:
6749
6750 -d, --default
6751 show default keyword template maps
6752
6753 -f, --rcfile
6754 read maps from rcfile
6755
6756 kwexpand
6757 hg kwexpand [OPTION]... [FILE]...
6758
6759 Run after (re)enabling keyword expansion.
6760
6761 kwexpand refuses to run if given files contain local changes.
6762
6763 Options:
6764
6765 -I, --include
6766 include names matching the given patterns
6767
6768 -X, --exclude
6769 exclude names matching the given patterns
6770
6771 kwfiles
6772 hg kwfiles [OPTION]... [FILE]...
6773
6774 List which files in the working directory are matched by the [keyword]
6775 configuration patterns.
6776
6777 Useful to prevent inadvertent keyword expansion and to speed up execu‐
6778 tion by including only files that are actual candidates for expansion.
6779
6780 See hg help keyword on how to construct patterns both for inclusion and
6781 exclusion of files.
6782
6783 With -A/--all and -v/--verbose the codes used to show the status of
6784 files are:
6785
6786 K = keyword expansion candidate
6787 k = keyword expansion candidate (not tracked)
6788 I = ignored
6789 i = ignored (not tracked)
6790
6791 Options:
6792
6793 -A, --all
6794 show keyword status flags of all files
6795
6796 -i, --ignore
6797 show files excluded from expansion
6798
6799 -u, --unknown
6800 only show unknown (not tracked) files
6801
6802 -I, --include
6803 include names matching the given patterns
6804
6805 -X, --exclude
6806 exclude names matching the given patterns
6807
6808 kwshrink
6809 hg kwshrink [OPTION]... [FILE]...
6810
6811 Must be run before changing/disabling active keywords.
6812
6813 kwshrink refuses to run if given files contain local changes.
6814
6815 Options:
6816
6817 -I, --include
6818 include names matching the given patterns
6819
6820 -X, --exclude
6821 exclude names matching the given patterns
6822
6823 largefiles
6824 track large binary files
6825
6826 Large binary files tend to be not very compressible, not very diffable,
6827 and not at all mergeable. Such files are not handled efficiently by
6828 Mercurial's storage format (revlog), which is based on compressed
6829 binary deltas; storing large binary files as regular Mercurial files
6830 wastes bandwidth and disk space and increases Mercurial's memory usage.
6831 The largefiles extension addresses these problems by adding a central‐
6832 ized client-server layer on top of Mercurial: largefiles live in a cen‐
6833 tral store out on the network somewhere, and you only fetch the revi‐
6834 sions that you need when you need them.
6835
6836 largefiles works by maintaining a "standin file" in .hglf/ for each
6837 largefile. The standins are small (41 bytes: an SHA-1 hash plus new‐
6838 line) and are tracked by Mercurial. Largefile revisions are identified
6839 by the SHA-1 hash of their contents, which is written to the standin.
6840 largefiles uses that revision ID to get/put largefile revisions from/to
6841 the central store. This saves both disk space and bandwidth, since you
6842 don't need to retrieve all historical revisions of large files when you
6843 clone or pull.
6844
6845 To start a new repository or add new large binary files, just add
6846 --large to your hg add command. For example:
6847
6848 $ dd if=/dev/urandom of=randomdata count=2000
6849 $ hg add --large randomdata
6850 $ hg commit -m 'add randomdata as a largefile'
6851
6852 When you push a changeset that adds/modifies largefiles to a remote
6853 repository, its largefile revisions will be uploaded along with it.
6854 Note that the remote Mercurial must also have the largefiles extension
6855 enabled for this to work.
6856
6857 When you pull a changeset that affects largefiles from a remote reposi‐
6858 tory, the largefiles for the changeset will by default not be pulled
6859 down. However, when you update to such a revision, any largefiles
6860 needed by that revision are downloaded and cached (if they have never
6861 been downloaded before). One way to pull largefiles when pulling is
6862 thus to use --update, which will update your working copy to the latest
6863 pulled revision (and thereby downloading any new largefiles).
6864
6865 If you want to pull largefiles you don't need for update yet, then you
6866 can use pull with the --lfrev option or the hg lfpull command.
6867
6868 If you know you are pulling from a non-default location and want to
6869 download all the largefiles that correspond to the new changesets at
6870 the same time, then you can pull with --lfrev "pulled()".
6871
6872 If you just want to ensure that you will have the largefiles needed to
6873 merge or rebase with new heads that you are pulling, then you can pull
6874 with --lfrev "head(pulled())" flag to pre-emptively download any large‐
6875 files that are new in the heads you are pulling.
6876
6877 Keep in mind that network access may now be required to update to
6878 changesets that you have not previously updated to. The nature of the
6879 largefiles extension means that updating is no longer guaranteed to be
6880 a local-only operation.
6881
6882 If you already have large files tracked by Mercurial without the large‐
6883 files extension, you will need to convert your repository in order to
6884 benefit from largefiles. This is done with the hg lfconvert command:
6885
6886 $ hg lfconvert --size 10 oldrepo newrepo
6887
6888 In repositories that already have largefiles in them, any new file over
6889 10MB will automatically be added as a largefile. To change this thresh‐
6890 old, set largefiles.minsize in your Mercurial config file to the mini‐
6891 mum size in megabytes to track as a largefile, or use the --lfsize
6892 option to the add command (also in megabytes):
6893
6894 [largefiles]
6895 minsize = 2
6896
6897 $ hg add --lfsize 2
6898
6899 The largefiles.patterns config option allows you to specify a list of
6900 filename patterns (see hg help patterns) that should always be tracked
6901 as largefiles:
6902
6903 [largefiles]
6904 patterns =
6905 *.jpg
6906 re:.*\.(png|bmp)$
6907 library.zip
6908 content/audio/*
6909
6910 Files that match one of these patterns will be added as largefiles
6911 regardless of their size.
6912
6913 The largefiles.minsize and largefiles.patterns config options will be
6914 ignored for any repositories not already containing a largefile. To add
6915 the first largefile to a repository, you must explicitly do so with the
6916 --large flag passed to the hg add command.
6917
6918 Commands
6919 lfconvert
6920 hg lfconvert SOURCE DEST [FILE ...]
6921
6922 Convert repository SOURCE to a new repository DEST, identical to SOURCE
6923 except that certain files will be converted as largefiles: specifi‐
6924 cally, any file that matches any PATTERN or whose size is above the
6925 minimum size threshold is converted as a largefile. The size used to
6926 determine whether or not to track a file as a largefile is the size of
6927 the first version of the file. The minimum size can be specified either
6928 with --size or in configuration as largefiles.size.
6929
6930 After running this command you will need to make sure that largefiles
6931 is enabled anywhere you intend to push the new repository.
6932
6933 Use --to-normal to convert largefiles back to normal files; after this,
6934 the DEST repository can be used without largefiles at all.
6935
6936 Options:
6937
6938 -s, --size
6939 minimum size (MB) for files to be converted as largefiles
6940
6941 --to-normal
6942 convert from a largefiles repo to a normal repo
6943
6944 lfpull
6945 hg lfpull -r REV... [-e CMD] [--remotecmd CMD] [SOURCE]
6946
6947 Pull largefiles that are referenced from local changesets but missing
6948 locally, pulling from a remote repository to the local cache.
6949
6950 If SOURCE is omitted, the 'default' path will be used. See hg help
6951 urls for more information.
6952
6953 Some examples:
6954
6955 · pull largefiles for all branch heads:
6956
6957 hg lfpull -r "head() and not closed()"
6958
6959 · pull largefiles on the default branch:
6960
6961 hg lfpull -r "branch(default)"
6962
6963 Options:
6964
6965 -r, --rev
6966 pull largefiles for these revisions
6967
6968 -e, --ssh
6969 specify ssh command to use
6970
6971 --remotecmd
6972 specify hg command to run on the remote side
6973
6974 --insecure
6975 do not verify server certificate (ignoring web.cacerts config)
6976
6977 mq
6978 manage a stack of patches
6979
6980 This extension lets you work with a stack of patches in a Mercurial
6981 repository. It manages two stacks of patches - all known patches, and
6982 applied patches (subset of known patches).
6983
6984 Known patches are represented as patch files in the .hg/patches direc‐
6985 tory. Applied patches are both patch files and changesets.
6986
6987 Common tasks (use hg help command for more details):
6988
6989 create new patch qnew
6990 import existing patch qimport
6991
6992 print patch series qseries
6993 print applied patches qapplied
6994
6995 add known patch to applied stack qpush
6996 remove patch from applied stack qpop
6997 refresh contents of top applied patch qrefresh
6998
6999 By default, mq will automatically use git patches when required to
7000 avoid losing file mode changes, copy records, binary files or empty
7001 files creations or deletions. This behaviour can be configured with:
7002
7003 [mq]
7004 git = auto/keep/yes/no
7005
7006 If set to 'keep', mq will obey the [diff] section configuration while
7007 preserving existing git patches upon qrefresh. If set to 'yes' or 'no',
7008 mq will override the [diff] section and always generate git or regular
7009 patches, possibly losing data in the second case.
7010
7011 It may be desirable for mq changesets to be kept in the secret phase
7012 (see hg help phases), which can be enabled with the following setting:
7013
7014 [mq]
7015 secret = True
7016
7017 You will by default be managing a patch queue named "patches". You can
7018 create other, independent patch queues with the hg qqueue command.
7019
7020 If the working directory contains uncommitted files, qpush, qpop and
7021 qgoto abort immediately. If -f/--force is used, the changes are dis‐
7022 carded. Setting:
7023
7024 [mq]
7025 keepchanges = True
7026
7027 make them behave as if --keep-changes were passed, and non-conflicting
7028 local changes will be tolerated and preserved. If incompatible options
7029 such as -f/--force or --exact are passed, this setting is ignored.
7030
7031 Commands
7032 qapplied
7033 hg qapplied [-1] [-s] [PATCH]
7034
7035 Returns 0 on success.
7036
7037 Options:
7038
7039 -1, --last
7040 show only the preceding applied patch
7041
7042 -s, --summary
7043 print first line of patch header
7044
7045 qclone
7046 hg qclone [OPTION]... SOURCE [DEST]
7047
7048 If source is local, destination will have no patches applied. If source
7049 is remote, this command can not check if patches are applied in source,
7050 so cannot guarantee that patches are not applied in destination. If you
7051 clone remote repository, be sure before that it has no patches applied.
7052
7053 Source patch repository is looked for in <src>/.hg/patches by default.
7054 Use -p <url> to change.
7055
7056 The patch directory must be a nested Mercurial repository, as would be
7057 created by hg init --mq.
7058
7059 Return 0 on success.
7060
7061 Options:
7062
7063 --pull use pull protocol to copy metadata
7064
7065 -U, --noupdate
7066 do not update the new working directories
7067
7068 --uncompressed
7069 use uncompressed transfer (fast over LAN)
7070
7071 -p, --patches
7072 location of source patch repository
7073
7074 -e, --ssh
7075 specify ssh command to use
7076
7077 --remotecmd
7078 specify hg command to run on the remote side
7079
7080 --insecure
7081 do not verify server certificate (ignoring web.cacerts config)
7082
7083 qcommit
7084 hg qcommit [OPTION]... [FILE]...
7085
7086 This command is deprecated; use hg commit --mq instead.
7087
7088 Options:
7089
7090 -A, --addremove
7091 mark new/missing files as added/removed before committing
7092
7093 --close-branch
7094 mark a branch as closed, hiding it from the branch list
7095
7096 --amend
7097 amend the parent of the working dir
7098
7099 -I, --include
7100 include names matching the given patterns
7101
7102 -X, --exclude
7103 exclude names matching the given patterns
7104
7105 -m, --message
7106 use text as commit message
7107
7108 -l, --logfile
7109 read commit message from file
7110
7111 -d, --date
7112 record the specified date as commit date
7113
7114 -u, --user
7115 record the specified user as committer
7116
7117 -S, --subrepos
7118 recurse into subrepositories
7119
7120 aliases: qci
7121
7122 qdelete
7123 hg qdelete [-k] [PATCH]...
7124
7125 The patches must not be applied, and at least one patch is required.
7126 Exact patch identifiers must be given. With -k/--keep, the patch files
7127 are preserved in the patch directory.
7128
7129 To stop managing a patch and move it into permanent history, use the hg
7130 qfinish command.
7131
7132 Options:
7133
7134 -k, --keep
7135 keep patch file
7136
7137 -r, --rev
7138 stop managing a revision (DEPRECATED)
7139
7140 aliases: qremove qrm
7141
7142 qdiff
7143 hg qdiff [OPTION]... [FILE]...
7144
7145 Shows a diff which includes the current patch as well as any changes
7146 which have been made in the working directory since the last refresh
7147 (thus showing what the current patch would become after a qrefresh).
7148
7149 Use hg diff if you only want to see the changes made since the last
7150 qrefresh, or hg export qtip if you want to see changes made by the cur‐
7151 rent patch without including changes made since the qrefresh.
7152
7153 Returns 0 on success.
7154
7155 Options:
7156
7157 -a, --text
7158 treat all files as text
7159
7160 -g, --git
7161 use git extended diff format
7162
7163 --nodates
7164 omit dates from diff headers
7165
7166 -p, --show-function
7167 show which function each change is in
7168
7169 --reverse
7170 produce a diff that undoes the changes
7171
7172 -w, --ignore-all-space
7173 ignore white space when comparing lines
7174
7175 -b, --ignore-space-change
7176 ignore changes in the amount of white space
7177
7178 -B, --ignore-blank-lines
7179 ignore changes whose lines are all blank
7180
7181 -U, --unified
7182 number of lines of context to show
7183
7184 --stat output diffstat-style summary of changes
7185
7186 -I, --include
7187 include names matching the given patterns
7188
7189 -X, --exclude
7190 exclude names matching the given patterns
7191
7192 qfinish
7193 hg qfinish [-a] [REV]...
7194
7195 Finishes the specified revisions (corresponding to applied patches) by
7196 moving them out of mq control into regular repository history.
7197
7198 Accepts a revision range or the -a/--applied option. If --applied is
7199 specified, all applied mq revisions are removed from mq control. Other‐
7200 wise, the given revisions must be at the base of the stack of applied
7201 patches.
7202
7203 This can be especially useful if your changes have been applied to an
7204 upstream repository, or if you are about to push your changes to
7205 upstream.
7206
7207 Returns 0 on success.
7208
7209 Options:
7210
7211 -a, --applied
7212 finish all applied changesets
7213
7214 qfold
7215 hg qfold [-e] [-k] [-m TEXT] [-l FILE] PATCH...
7216
7217 Patches must not yet be applied. Each patch will be successively
7218 applied to the current patch in the order given. If all the patches
7219 apply successfully, the current patch will be refreshed with the new
7220 cumulative patch, and the folded patches will be deleted. With
7221 -k/--keep, the folded patch files will not be removed afterwards.
7222
7223 The header for each folded patch will be concatenated with the current
7224 patch header, separated by a line of * * *.
7225
7226 Returns 0 on success.
7227
7228 Options:
7229
7230 -e, --edit
7231 edit patch header
7232
7233 -k, --keep
7234 keep folded patch files
7235
7236 -m, --message
7237 use text as commit message
7238
7239 -l, --logfile
7240 read commit message from file
7241
7242 qgoto
7243 hg qgoto [OPTION]... PATCH
7244
7245 Returns 0 on success.
7246
7247 Options:
7248
7249 --keep-changes
7250 tolerate non-conflicting local changes
7251
7252 -f, --force
7253 overwrite any local changes
7254
7255 --no-backup
7256 do not save backup copies of files
7257
7258 qguard
7259 hg qguard [-l] [-n] [PATCH] [-- [+GUARD]... [-GUARD]...]
7260
7261 Guards control whether a patch can be pushed. A patch with no guards is
7262 always pushed. A patch with a positive guard ("+foo") is pushed only if
7263 the hg qselect command has activated it. A patch with a negative guard
7264 ("-foo") is never pushed if the hg qselect command has activated it.
7265
7266 With no arguments, print the currently active guards. With arguments,
7267 set guards for the named patch.
7268
7269 Note Specifying negative guards now requires '--'.
7270
7271 To set guards on another patch:
7272
7273 hg qguard other.patch -- +2.6.17 -stable
7274
7275 Returns 0 on success.
7276
7277 Options:
7278
7279 -l, --list
7280 list all patches and guards
7281
7282 -n, --none
7283 drop all guards
7284
7285 qheader
7286 hg qheader [PATCH]
7287
7288 Returns 0 on success.
7289
7290 qimport
7291 hg qimport [-e] [-n NAME] [-f] [-g] [-P] [-r REV]... [FILE]...
7292
7293 The patch is inserted into the series after the last applied patch. If
7294 no patches have been applied, qimport prepends the patch to the series.
7295
7296 The patch will have the same name as its source file unless you give it
7297 a new one with -n/--name.
7298
7299 You can register an existing patch inside the patch directory with the
7300 -e/--existing flag.
7301
7302 With -f/--force, an existing patch of the same name will be overwrit‐
7303 ten.
7304
7305 An existing changeset may be placed under mq control with -r/--rev
7306 (e.g. qimport --rev tip -n patch will place tip under mq control).
7307 With -g/--git, patches imported with --rev will use the git diff for‐
7308 mat. See the diffs help topic for information on why this is important
7309 for preserving rename/copy information and permission changes. Use hg
7310 qfinish to remove changesets from mq control.
7311
7312 To import a patch from standard input, pass - as the patch file. When
7313 importing from standard input, a patch name must be specified using the
7314 --name flag.
7315
7316 To import an existing patch while renaming it:
7317
7318 hg qimport -e existing-patch -n new-name
7319
7320 Returns 0 if import succeeded.
7321
7322 Options:
7323
7324 -e, --existing
7325 import file in patch directory
7326
7327 -n, --name
7328 name of patch file
7329
7330 -f, --force
7331 overwrite existing files
7332
7333 -r, --rev
7334 place existing revisions under mq control
7335
7336 -g, --git
7337 use git extended diff format
7338
7339 -P, --push
7340 qpush after importing
7341
7342 qinit
7343 hg qinit [-c]
7344
7345 The queue repository is unversioned by default. If -c/--create-repo is
7346 specified, qinit will create a separate nested repository for patches
7347 (qinit -c may also be run later to convert an unversioned patch reposi‐
7348 tory into a versioned one). You can use qcommit to commit changes to
7349 this queue repository.
7350
7351 This command is deprecated. Without -c, it's implied by other relevant
7352 commands. With -c, use hg init --mq instead.
7353
7354 Options:
7355
7356 -c, --create-repo
7357 create queue repository
7358
7359 qnew
7360 hg qnew [-e] [-m TEXT] [-l FILE] PATCH [FILE]...
7361
7362 qnew creates a new patch on top of the currently-applied patch (if
7363 any). The patch will be initialized with any outstanding changes in the
7364 working directory. You may also use -I/--include, -X/--exclude, and/or
7365 a list of files after the patch name to add only changes to matching
7366 files to the new patch, leaving the rest as uncommitted modifications.
7367
7368 -u/--user and -d/--date can be used to set the (given) user and date,
7369 respectively. -U/--currentuser and -D/--currentdate set user to current
7370 user and date to current date.
7371
7372 -e/--edit, -m/--message or -l/--logfile set the patch header as well as
7373 the commit message. If none is specified, the header is empty and the
7374 commit message is '[mq]: PATCH'.
7375
7376 Use the -g/--git option to keep the patch in the git extended diff for‐
7377 mat. Read the diffs help topic for more information on why this is
7378 important for preserving permission changes and copy/rename informa‐
7379 tion.
7380
7381 Returns 0 on successful creation of a new patch.
7382
7383 Options:
7384
7385 -e, --edit
7386 edit commit message
7387
7388 -f, --force
7389 import uncommitted changes (DEPRECATED)
7390
7391 -g, --git
7392 use git extended diff format
7393
7394 -U, --currentuser
7395 add "From: <current user>" to patch
7396
7397 -u, --user
7398 add "From: <USER>" to patch
7399
7400 -D, --currentdate
7401 add "Date: <current date>" to patch
7402
7403 -d, --date
7404 add "Date: <DATE>" to patch
7405
7406 -I, --include
7407 include names matching the given patterns
7408
7409 -X, --exclude
7410 exclude names matching the given patterns
7411
7412 -m, --message
7413 use text as commit message
7414
7415 -l, --logfile
7416 read commit message from file
7417
7418 qnext
7419 hg qnext [-s]
7420
7421 Returns 0 on success.
7422
7423 Options:
7424
7425 -s, --summary
7426 print first line of patch header
7427
7428 qpop
7429 hg qpop [-a] [-f] [PATCH | INDEX]
7430
7431 Without argument, pops off the top of the patch stack. If given a patch
7432 name, keeps popping off patches until the named patch is at the top of
7433 the stack.
7434
7435 By default, abort if the working directory contains uncommitted
7436 changes. With --keep-changes, abort only if the uncommitted files over‐
7437 lap with patched files. With -f/--force, backup and discard changes
7438 made to such files.
7439
7440 Return 0 on success.
7441
7442 Options:
7443
7444 -a, --all
7445 pop all patches
7446
7447 -n, --name
7448 queue name to pop (DEPRECATED)
7449
7450 --keep-changes
7451 tolerate non-conflicting local changes
7452
7453 -f, --force
7454 forget any local changes to patched files
7455
7456 --no-backup
7457 do not save backup copies of files
7458
7459 qprev
7460 hg qprev [-s]
7461
7462 Returns 0 on success.
7463
7464 Options:
7465
7466 -s, --summary
7467 print first line of patch header
7468
7469 qpush
7470 hg qpush [-f] [-l] [-a] [--move] [PATCH | INDEX]
7471
7472 By default, abort if the working directory contains uncommitted
7473 changes. With --keep-changes, abort only if the uncommitted files over‐
7474 lap with patched files. With -f/--force, backup and patch over uncom‐
7475 mitted changes.
7476
7477 Return 0 on success.
7478
7479 Options:
7480
7481 --keep-changes
7482 tolerate non-conflicting local changes
7483
7484 -f, --force
7485 apply on top of local changes
7486
7487 -e, --exact
7488 apply the target patch to its recorded parent
7489
7490 -l, --list
7491 list patch name in commit text
7492
7493 -a, --all
7494 apply all patches
7495
7496 -m, --merge
7497 merge from another queue (DEPRECATED)
7498
7499 -n, --name
7500 merge queue name (DEPRECATED)
7501
7502 --move reorder patch series and apply only the patch
7503
7504 --no-backup
7505 do not save backup copies of files
7506
7507 qqueue
7508 hg qqueue [OPTION] [QUEUE]
7509
7510 Supports switching between different patch queues, as well as creating
7511 new patch queues and deleting existing ones.
7512
7513 Omitting a queue name or specifying -l/--list will show you the regis‐
7514 tered queues - by default the "normal" patches queue is registered. The
7515 currently active queue will be marked with "(active)". Specifying
7516 --active will print only the name of the active queue.
7517
7518 To create a new queue, use -c/--create. The queue is automatically made
7519 active, except in the case where there are applied patches from the
7520 currently active queue in the repository. Then the queue will only be
7521 created and switching will fail.
7522
7523 To delete an existing queue, use --delete. You cannot delete the cur‐
7524 rently active queue.
7525
7526 Returns 0 on success.
7527
7528 Options:
7529
7530 -l, --list
7531 list all available queues
7532
7533 --active
7534 print name of active queue
7535
7536 -c, --create
7537 create new queue
7538
7539 --rename
7540 rename active queue
7541
7542 --delete
7543 delete reference to queue
7544
7545 --purge
7546 delete queue, and remove patch dir
7547
7548 qrefresh
7549 hg qrefresh [-I] [-X] [-e] [-m TEXT] [-l FILE] [-s] [FILE]...
7550
7551 If any file patterns are provided, the refreshed patch will contain
7552 only the modifications that match those patterns; the remaining modifi‐
7553 cations will remain in the working directory.
7554
7555 If -s/--short is specified, files currently included in the patch will
7556 be refreshed just like matched files and remain in the patch.
7557
7558 If -e/--edit is specified, Mercurial will start your configured editor
7559 for you to enter a message. In case qrefresh fails, you will find a
7560 backup of your message in .hg/last-message.txt.
7561
7562 hg add/remove/copy/rename work as usual, though you might want to use
7563 git-style patches (-g/--git or [diff] git=1) to track copies and
7564 renames. See the diffs help topic for more information on the git diff
7565 format.
7566
7567 Returns 0 on success.
7568
7569 Options:
7570
7571 -e, --edit
7572 edit commit message
7573
7574 -g, --git
7575 use git extended diff format
7576
7577 -s, --short
7578 refresh only files already in the patch and specified files
7579
7580 -U, --currentuser
7581 add/update author field in patch with current user
7582
7583 -u, --user
7584 add/update author field in patch with given user
7585
7586 -D, --currentdate
7587 add/update date field in patch with current date
7588
7589 -d, --date
7590 add/update date field in patch with given date
7591
7592 -I, --include
7593 include names matching the given patterns
7594
7595 -X, --exclude
7596 exclude names matching the given patterns
7597
7598 -m, --message
7599 use text as commit message
7600
7601 -l, --logfile
7602 read commit message from file
7603
7604 qrename
7605 hg qrename PATCH1 [PATCH2]
7606
7607 With one argument, renames the current patch to PATCH1. With two argu‐
7608 ments, renames PATCH1 to PATCH2.
7609
7610 Returns 0 on success.
7611
7612 aliases: qmv
7613
7614 qrestore
7615 hg qrestore [-d] [-u] REV
7616
7617 This command is deprecated, use hg rebase instead.
7618
7619 Options:
7620
7621 -d, --delete
7622 delete save entry
7623
7624 -u, --update
7625 update queue working directory
7626
7627 qsave
7628 hg qsave [-m TEXT] [-l FILE] [-c] [-n NAME] [-e] [-f]
7629
7630 This command is deprecated, use hg rebase instead.
7631
7632 Options:
7633
7634 -c, --copy
7635 copy patch directory
7636
7637 -n, --name
7638 copy directory name
7639
7640 -e, --empty
7641 clear queue status file
7642
7643 -f, --force
7644 force copy
7645
7646 -m, --message
7647 use text as commit message
7648
7649 -l, --logfile
7650 read commit message from file
7651
7652 qselect
7653 hg qselect [OPTION]... [GUARD]...
7654
7655 Use the hg qguard command to set or print guards on patch, then use
7656 qselect to tell mq which guards to use. A patch will be pushed if it
7657 has no guards or any positive guards match the currently selected
7658 guard, but will not be pushed if any negative guards match the current
7659 guard. For example:
7660
7661 qguard foo.patch -- -stable (negative guard)
7662 qguard bar.patch +stable (positive guard)
7663 qselect stable
7664
7665 This activates the "stable" guard. mq will skip foo.patch (because it
7666 has a negative match) but push bar.patch (because it has a positive
7667 match).
7668
7669 With no arguments, prints the currently active guards. With one argu‐
7670 ment, sets the active guard.
7671
7672 Use -n/--none to deactivate guards (no other arguments needed). When
7673 no guards are active, patches with positive guards are skipped and
7674 patches with negative guards are pushed.
7675
7676 qselect can change the guards on applied patches. It does not pop
7677 guarded patches by default. Use --pop to pop back to the last applied
7678 patch that is not guarded. Use --reapply (which implies --pop) to push
7679 back to the current patch afterwards, but skip guarded patches.
7680
7681 Use -s/--series to print a list of all guards in the series file (no
7682 other arguments needed). Use -v for more information.
7683
7684 Returns 0 on success.
7685
7686 Options:
7687
7688 -n, --none
7689 disable all guards
7690
7691 -s, --series
7692 list all guards in series file
7693
7694 --pop pop to before first guarded applied patch
7695
7696 --reapply
7697 pop, then reapply patches
7698
7699 qseries
7700 hg qseries [-ms]
7701
7702 Returns 0 on success.
7703
7704 Options:
7705
7706 -m, --missing
7707 print patches not in series
7708
7709 -s, --summary
7710 print first line of patch header
7711
7712 qtop
7713 hg qtop [-s]
7714
7715 Returns 0 on success.
7716
7717 Options:
7718
7719 -s, --summary
7720 print first line of patch header
7721
7722 qunapplied
7723 hg qunapplied [-1] [-s] [PATCH]
7724
7725 Returns 0 on success.
7726
7727 Options:
7728
7729 -1, --first
7730 show only the first patch
7731
7732 -s, --summary
7733 print first line of patch header
7734
7735 strip
7736 hg strip [-k] [-f] [-n] [-B bookmark] [-r] REV...
7737
7738 The strip command removes the specified changesets and all their
7739 descendants. If the working directory has uncommitted changes, the
7740 operation is aborted unless the --force flag is supplied, in which case
7741 changes will be discarded.
7742
7743 If a parent of the working directory is stripped, then the working
7744 directory will automatically be updated to the most recent available
7745 ancestor of the stripped parent after the operation completes.
7746
7747 Any stripped changesets are stored in .hg/strip-backup as a bundle (see
7748 hg help bundle and hg help unbundle). They can be restored by running
7749 hg unbundle .hg/strip-backup/BUNDLE, where BUNDLE is the bundle file
7750 created by the strip. Note that the local revision numbers will in gen‐
7751 eral be different after the restore.
7752
7753 Use the --no-backup option to discard the backup bundle once the opera‐
7754 tion completes.
7755
7756 Strip is not a history-rewriting operation and can be used on change‐
7757 sets in the public phase. But if the stripped changesets have been
7758 pushed to a remote repository you will likely pull them again.
7759
7760 Return 0 on success.
7761
7762 Options:
7763
7764 -r, --rev
7765 strip specified revision (optional, can specify revisions with‐
7766 out this option)
7767
7768 -f, --force
7769 force removal of changesets, discard uncommitted changes (no
7770 backup)
7771
7772 -b, --backup
7773 bundle only changesets with local revision number greater than
7774 REV which are not descendants of REV (DEPRECATED)
7775
7776 --no-backup
7777 no backups
7778
7779 --nobackup
7780 no backups (DEPRECATED)
7781
7782 -n ignored (DEPRECATED)
7783
7784 -k, --keep
7785 do not modify working copy during strip
7786
7787 -B, --bookmark
7788 remove revs only reachable from given bookmark
7789
7790 notify
7791 hooks for sending email push notifications
7792
7793 This extension implements hooks to send email notifications when
7794 changesets are sent from or received by the local repository.
7795
7796 First, enable the extension as explained in hg help extensions, and
7797 register the hook you want to run. incoming and changegroup hooks are
7798 run when changesets are received, while outgoing hooks are for change‐
7799 sets sent to another repository:
7800
7801 [hooks]
7802 # one email for each incoming changeset
7803 incoming.notify = python:hgext.notify.hook
7804 # one email for all incoming changesets
7805 changegroup.notify = python:hgext.notify.hook
7806
7807 # one email for all outgoing changesets
7808 outgoing.notify = python:hgext.notify.hook
7809
7810 This registers the hooks. To enable notification, subscribers must be
7811 assigned to repositories. The [usersubs] section maps multiple reposi‐
7812 tories to a given recipient. The [reposubs] section maps multiple
7813 recipients to a single repository:
7814
7815 [usersubs]
7816 # key is subscriber email, value is a comma-separated list of repo patterns
7817 user@host = pattern
7818
7819 [reposubs]
7820 # key is repo pattern, value is a comma-separated list of subscriber emails
7821 pattern = user@host
7822
7823 A pattern is a glob matching the absolute path to a repository, option‐
7824 ally combined with a revset expression. A revset expression, if
7825 present, is separated from the glob by a hash. Example:
7826
7827 [reposubs]
7828 */widgets#branch(release) = qa-team@example.com
7829
7830 This sends to qa-team@example.com whenever a changeset on the release
7831 branch triggers a notification in any repository ending in widgets.
7832
7833 In order to place them under direct user management, [usersubs] and
7834 [reposubs] sections may be placed in a separate hgrc file and incorpo‐
7835 rated by reference:
7836
7837 [notify]
7838 config = /path/to/subscriptionsfile
7839
7840 Notifications will not be sent until the notify.test value is set to
7841 False; see below.
7842
7843 Notifications content can be tweaked with the following configuration
7844 entries:
7845
7846 notify.test
7847 If True, print messages to stdout instead of sending them.
7848 Default: True.
7849
7850 notify.sources
7851 Space-separated list of change sources. Notifications are acti‐
7852 vated only when a changeset's source is in this list. Sources
7853 may be:
7854
7855 serve
7856
7857 changesets received via http or ssh
7858
7859 pull
7860
7861 changesets received via hg pull
7862
7863 unbundle
7864
7865 changesets received via hg unbundle
7866
7867 push
7868
7869 changesets sent or received via hg push
7870
7871 bundle
7872
7873 changesets sent via hg unbundle
7874
7875 Default: serve.
7876
7877 notify.strip
7878 Number of leading slashes to strip from url paths. By default,
7879 notifications reference repositories with their absolute path.
7880 notify.strip lets you turn them into relative paths. For exam‐
7881 ple, notify.strip=3 will change /long/path/repository into
7882 repository. Default: 0.
7883
7884 notify.domain
7885 Default email domain for sender or recipients with no explicit
7886 domain.
7887
7888 notify.style
7889 Style file to use when formatting emails.
7890
7891 notify.template
7892 Template to use when formatting emails.
7893
7894 notify.incoming
7895 Template to use when run as an incoming hook, overriding
7896 notify.template.
7897
7898 notify.outgoing
7899 Template to use when run as an outgoing hook, overriding
7900 notify.template.
7901
7902 notify.changegroup
7903 Template to use when running as a changegroup hook, overriding
7904 notify.template.
7905
7906 notify.maxdiff
7907 Maximum number of diff lines to include in notification email.
7908 Set to 0 to disable the diff, or -1 to include all of it.
7909 Default: 300.
7910
7911 notify.maxsubject
7912 Maximum number of characters in email's subject line. Default:
7913 67.
7914
7915 notify.diffstat
7916 Set to True to include a diffstat before diff content. Default:
7917 True.
7918
7919 notify.merge
7920 If True, send notifications for merge changesets. Default: True.
7921
7922 notify.mbox
7923 If set, append mails to this mbox file instead of sending.
7924 Default: None.
7925
7926 notify.fromauthor
7927 If set, use the committer of the first changeset in a change‐
7928 group for the "From" field of the notification mail. If not set,
7929 take the user from the pushing repo. Default: False.
7930
7931 If set, the following entries will also be used to customize the noti‐
7932 fications:
7933
7934 email.from
7935 Email From address to use if none can be found in the generated
7936 email content.
7937
7938 web.baseurl
7939 Root repository URL to combine with repository paths when making
7940 references. See also notify.strip.
7941
7942 pager
7943 browse command output with an external pager
7944
7945 To set the pager that should be used, set the application variable:
7946
7947 [pager]
7948 pager = less -FRX
7949
7950 If no pager is set, the pager extensions uses the environment variable
7951 $PAGER. If neither pager.pager, nor $PAGER is set, no pager is used.
7952
7953 You can disable the pager for certain commands by adding them to the
7954 pager.ignore list:
7955
7956 [pager]
7957 ignore = version, help, update
7958
7959 You can also enable the pager only for certain commands using
7960 pager.attend. Below is the default list of commands to be paged:
7961
7962 [pager]
7963 attend = annotate, cat, diff, export, glog, log, qdiff
7964
7965 Setting pager.attend to an empty value will cause all commands to be
7966 paged.
7967
7968 If pager.attend is present, pager.ignore will be ignored.
7969
7970 To ignore global commands like hg version or hg help, you have to spec‐
7971 ify them in your user configuration file.
7972
7973 The --pager=... option can also be used to control when the pager is
7974 used. Use a boolean value like yes, no, on, off, or use auto for normal
7975 behavior.
7976
7977 patchbomb
7978 command to send changesets as (a series of) patch emails
7979
7980 The series is started off with a "[PATCH 0 of N]" introduction, which
7981 describes the series as a whole.
7982
7983 Each patch email has a Subject line of "[PATCH M of N] ...", using the
7984 first line of the changeset description as the subject text. The mes‐
7985 sage contains two or three body parts:
7986
7987 · The changeset description.
7988
7989 · [Optional] The result of running diffstat on the patch.
7990
7991 · The patch itself, as generated by hg export.
7992
7993 Each message refers to the first in the series using the In-Reply-To
7994 and References headers, so they will show up as a sequence in threaded
7995 mail and news readers, and in mail archives.
7996
7997 To configure other defaults, add a section like this to your configura‐
7998 tion file:
7999
8000 [email]
8001 from = My Name <my@email>
8002 to = recipient1, recipient2, ...
8003 cc = cc1, cc2, ...
8004 bcc = bcc1, bcc2, ...
8005 reply-to = address1, address2, ...
8006
8007 Use [patchbomb] as configuration section name if you need to override
8008 global [email] address settings.
8009
8010 Then you can use the hg email command to mail a series of changesets as
8011 a patchbomb.
8012
8013 You can also either configure the method option in the email section to
8014 be a sendmail compatible mailer or fill out the [smtp] section so that
8015 the patchbomb extension can automatically send patchbombs directly from
8016 the commandline. See the [email] and [smtp] sections in hgrc(5) for
8017 details.
8018
8019 Commands
8020 email
8021 hg email [OPTION]... [DEST]...
8022
8023 By default, diffs are sent in the format generated by hg export, one
8024 per message. The series starts with a "[PATCH 0 of N]" introduction,
8025 which describes the series as a whole.
8026
8027 Each patch email has a Subject line of "[PATCH M of N] ...", using the
8028 first line of the changeset description as the subject text. The mes‐
8029 sage contains two or three parts. First, the changeset description.
8030
8031 With the -d/--diffstat option, if the diffstat program is installed,
8032 the result of running diffstat on the patch is inserted.
8033
8034 Finally, the patch itself, as generated by hg export.
8035
8036 With the -d/--diffstat or --confirm options, you will be presented with
8037 a final summary of all messages and asked for confirmation before the
8038 messages are sent.
8039
8040 By default the patch is included as text in the email body for easy
8041 reviewing. Using the -a/--attach option will instead create an attach‐
8042 ment for the patch. With -i/--inline an inline attachment will be cre‐
8043 ated. You can include a patch both as text in the email body and as a
8044 regular or an inline attachment by combining the -a/--attach or
8045 -i/--inline with the --body option.
8046
8047 With -o/--outgoing, emails will be generated for patches not found in
8048 the destination repository (or only those which are ancestors of the
8049 specified revisions if any are provided)
8050
8051 With -b/--bundle, changesets are selected as for --outgoing, but a sin‐
8052 gle email containing a binary Mercurial bundle as an attachment will be
8053 sent.
8054
8055 With -m/--mbox, instead of previewing each patchbomb message in a pager
8056 or sending the messages directly, it will create a UNIX mailbox file
8057 with the patch emails. This mailbox file can be previewed with any mail
8058 user agent which supports UNIX mbox files.
8059
8060 With -n/--test, all steps will run, but mail will not be sent. You
8061 will be prompted for an email recipient address, a subject and an
8062 introductory message describing the patches of your patchbomb. Then
8063 when all is done, patchbomb messages are displayed. If the PAGER envi‐
8064 ronment variable is set, your pager will be fired up once for each
8065 patchbomb message, so you can verify everything is alright.
8066
8067 In case email sending fails, you will find a backup of your series
8068 introductory message in .hg/last-email.txt.
8069
8070 Examples:
8071
8072 hg email -r 3000 # send patch 3000 only
8073 hg email -r 3000 -r 3001 # send patches 3000 and 3001
8074 hg email -r 3000:3005 # send patches 3000 through 3005
8075 hg email 3000 # send patch 3000 (deprecated)
8076
8077 hg email -o # send all patches not in default
8078 hg email -o DEST # send all patches not in DEST
8079 hg email -o -r 3000 # send all ancestors of 3000 not in default
8080 hg email -o -r 3000 DEST # send all ancestors of 3000 not in DEST
8081
8082 hg email -b # send bundle of all patches not in default
8083 hg email -b DEST # send bundle of all patches not in DEST
8084 hg email -b -r 3000 # bundle of all ancestors of 3000 not in default
8085 hg email -b -r 3000 DEST # bundle of all ancestors of 3000 not in DEST
8086
8087 hg email -o -m mbox && # generate an mbox file...
8088 mutt -R -f mbox # ... and view it with mutt
8089 hg email -o -m mbox && # generate an mbox file ...
8090 formail -s sendmail \ # ... and use formail to send from the mbox
8091 -bm -t < mbox # ... using sendmail
8092
8093 Before using this command, you will need to enable email in your hgrc.
8094 See the [email] section in hgrc(5) for details.
8095
8096 Options:
8097
8098 -g, --git
8099 use git extended diff format
8100
8101 --plain
8102 omit hg patch header
8103
8104 -o, --outgoing
8105 send changes not found in the target repository
8106
8107 -b, --bundle
8108 send changes not in target as a binary bundle
8109
8110 --bundlename
8111 name of the bundle attachment file (default: bundle)
8112
8113 -r, --rev
8114 a revision to send
8115
8116 --force
8117 run even when remote repository is unrelated (with -b/--bundle)
8118
8119 --base a base changeset to specify instead of a destination (with
8120 -b/--bundle)
8121
8122 --intro
8123 send an introduction email for a single patch
8124
8125 --body send patches as inline message text (default)
8126
8127 -a, --attach
8128 send patches as attachments
8129
8130 -i, --inline
8131 send patches as inline attachments
8132
8133 --bcc email addresses of blind carbon copy recipients
8134
8135 -c, --cc
8136 email addresses of copy recipients
8137
8138 --confirm
8139 ask for confirmation before sending
8140
8141 -d, --diffstat
8142 add diffstat output to messages
8143
8144 --date use the given date as the sending date
8145
8146 --desc use the given file as the series description
8147
8148 -f, --from
8149 email address of sender
8150
8151 -n, --test
8152 print messages that would be sent
8153
8154 -m, --mbox
8155 write messages to mbox file instead of sending them
8156
8157 --reply-to
8158 email addresses replies should be sent to
8159
8160 -s, --subject
8161 subject of first message (intro or single patch)
8162
8163 --in-reply-to
8164 message identifier to reply to
8165
8166 --flag flags to add in subject prefixes
8167
8168 -t, --to
8169 email addresses of recipients
8170
8171 -e, --ssh
8172 specify ssh command to use
8173
8174 --remotecmd
8175 specify hg command to run on the remote side
8176
8177 --insecure
8178 do not verify server certificate (ignoring web.cacerts config)
8179
8180 progress
8181 show progress bars for some actions
8182
8183 This extension uses the progress information logged by hg commands to
8184 draw progress bars that are as informative as possible. Some progress
8185 bars only offer indeterminate information, while others have a definite
8186 end point.
8187
8188 The following settings are available:
8189
8190 [progress]
8191 delay = 3 # number of seconds (float) before showing the progress bar
8192 changedelay = 1 # changedelay: minimum delay before showing a new topic.
8193 # If set to less than 3 * refresh, that value will
8194 # be used instead.
8195 refresh = 0.1 # time in seconds between refreshes of the progress bar
8196 format = topic bar number estimate # format of the progress bar
8197 width = <none> # if set, the maximum width of the progress information
8198 # (that is, min(width, term width) will be used)
8199 clear-complete = True # clear the progress bar after it's done
8200 disable = False # if true, don't show a progress bar
8201 assume-tty = False # if true, ALWAYS show a progress bar, unless
8202 # disable is given
8203
8204 Valid entries for the format field are topic, bar, number, unit, esti‐
8205 mate, speed, and item. item defaults to the last 20 characters of the
8206 item, but this can be changed by adding either -<num> which would take
8207 the last num characters, or +<num> for the first num characters.
8208
8209 purge
8210 command to delete untracked files from the working directory
8211
8212 Commands
8213 purge
8214 hg purge [OPTION]... [DIR]...
8215
8216 Delete files not known to Mercurial. This is useful to test local and
8217 uncommitted changes in an otherwise-clean source tree.
8218
8219 This means that purge will delete:
8220
8221 · Unknown files: files marked with "?" by hg status
8222
8223 · Empty directories: in fact Mercurial ignores directories unless they
8224 contain files under source control management
8225
8226 But it will leave untouched:
8227
8228 · Modified and unmodified tracked files
8229
8230 · Ignored files (unless --all is specified)
8231
8232 · New files added to the repository (with hg add)
8233
8234 If directories are given on the command line, only files in these
8235 directories are considered.
8236
8237 Be careful with purge, as you could irreversibly delete some files you
8238 forgot to add to the repository. If you only want to print the list of
8239 files that this program would delete, use the --print option.
8240
8241 Options:
8242
8243 -a, --abort-on-err
8244 abort if an error occurs
8245
8246 --all purge ignored files too
8247
8248 -p, --print
8249 print filenames instead of deleting them
8250
8251 -0, --print0
8252 end filenames with NUL, for use with xargs (implies -p/--print)
8253
8254 -I, --include
8255 include names matching the given patterns
8256
8257 -X, --exclude
8258 exclude names matching the given patterns
8259
8260 aliases: clean
8261
8262 rebase
8263 command to move sets of revisions to a different ancestor
8264
8265 This extension lets you rebase changesets in an existing Mercurial
8266 repository.
8267
8268 For more information: http://mercurial.selenic.com/wiki/RebaseExtension
8269
8270 Commands
8271 rebase
8272 hg rebase [-s REV | -b REV] [-d REV] [OPTION]
8273
8274 Rebase uses repeated merging to graft changesets from one part of his‐
8275 tory (the source) onto another (the destination). This can be useful
8276 for linearizing local changes relative to a master development tree.
8277
8278 You should not rebase changesets that have already been shared with
8279 others. Doing so will force everybody else to perform the same rebase
8280 or they will end up with duplicated changesets after pulling in your
8281 rebased changesets.
8282
8283 In its default configuration, Mercurial will prevent you from rebasing
8284 published changes. See hg help phases for details.
8285
8286 If you don't specify a destination changeset (-d/--dest), rebase uses
8287 the tipmost head of the current named branch as the destination. (The
8288 destination changeset is not modified by rebasing, but new changesets
8289 are added as its descendants.)
8290
8291 You can specify which changesets to rebase in two ways: as a "source"
8292 changeset or as a "base" changeset. Both are shorthand for a topologi‐
8293 cally related set of changesets (the "source branch"). If you specify
8294 source (-s/--source), rebase will rebase that changeset and all of its
8295 descendants onto dest. If you specify base (-b/--base), rebase will
8296 select ancestors of base back to but not including the common ancestor
8297 with dest. Thus, -b is less precise but more convenient than -s: you
8298 can specify any changeset in the source branch, and rebase will select
8299 the whole branch. If you specify neither -s nor -b, rebase uses the
8300 parent of the working directory as the base.
8301
8302 For advanced usage, a third way is available through the --rev option.
8303 It allows you to specify an arbitrary set of changesets to rebase.
8304 Descendants of revs you specify with this option are not automatically
8305 included in the rebase.
8306
8307 By default, rebase recreates the changesets in the source branch as
8308 descendants of dest and then destroys the originals. Use --keep to pre‐
8309 serve the original source changesets. Some changesets in the source
8310 branch (e.g. merges from the destination branch) may be dropped if they
8311 no longer contribute any change.
8312
8313 One result of the rules for selecting the destination changeset and
8314 source branch is that, unlike merge, rebase will do nothing if you are
8315 at the latest (tipmost) head of a named branch with two heads. You need
8316 to explicitly specify source and/or destination (or update to the other
8317 head, if it's the head of the intended source branch).
8318
8319 If a rebase is interrupted to manually resolve a merge, it can be con‐
8320 tinued with --continue/-c or aborted with --abort/-a.
8321
8322 Returns 0 on success, 1 if nothing to rebase.
8323
8324 Options:
8325
8326 -s, --source
8327 rebase from the specified changeset
8328
8329 -b, --base
8330 rebase from the base of the specified changeset (up to greatest
8331 common ancestor of base and dest)
8332
8333 -r, --rev
8334 rebase these revisions
8335
8336 -d, --dest
8337 rebase onto the specified changeset
8338
8339 --collapse
8340 collapse the rebased changesets
8341
8342 -m, --message
8343 use text as collapse commit message
8344
8345 -e, --edit
8346 invoke editor on commit messages
8347
8348 -l, --logfile
8349 read collapse commit message from file
8350
8351 --keep keep original changesets
8352
8353 --keepbranches
8354 keep original branch names
8355
8356 -D, --detach
8357 (DEPRECATED)
8358
8359 -t, --tool
8360 specify merge tool
8361
8362 -c, --continue
8363 continue an interrupted rebase
8364
8365 -a, --abort
8366 abort an interrupted rebase
8367
8368 --style
8369 display using template map file
8370
8371 --template
8372 display with template
8373
8374 record
8375 commands to interactively select changes for commit/qrefresh
8376
8377 Commands
8378 qrecord
8379 hg qrecord [OPTION]... PATCH [FILE]...
8380
8381 See hg help qnew & hg help record for more information and usage.
8382
8383 record
8384 hg record [OPTION]... [FILE]...
8385
8386 If a list of files is omitted, all changes reported by hg status will
8387 be candidates for recording.
8388
8389 See hg help dates for a list of formats valid for -d/--date.
8390
8391 You will be prompted for whether to record changes to each modified
8392 file, and for files with multiple changes, for each change to use. For
8393 each query, the following responses are possible:
8394
8395 y - record this change
8396 n - skip this change
8397 e - edit this change manually
8398
8399 s - skip remaining changes to this file
8400 f - record remaining changes to this file
8401
8402 d - done, skip remaining changes and files
8403 a - record all changes to all remaining files
8404 q - quit, recording no changes
8405
8406 ? - display help
8407
8408 This command is not available when committing a merge.
8409
8410 Options:
8411
8412 -A, --addremove
8413 mark new/missing files as added/removed before committing
8414
8415 --close-branch
8416 mark a branch as closed, hiding it from the branch list
8417
8418 --amend
8419 amend the parent of the working dir
8420
8421 -I, --include
8422 include names matching the given patterns
8423
8424 -X, --exclude
8425 exclude names matching the given patterns
8426
8427 -m, --message
8428 use text as commit message
8429
8430 -l, --logfile
8431 read commit message from file
8432
8433 -d, --date
8434 record the specified date as commit date
8435
8436 -u, --user
8437 record the specified user as committer
8438
8439 -S, --subrepos
8440 recurse into subrepositories
8441
8442 -w, --ignore-all-space
8443 ignore white space when comparing lines
8444
8445 -b, --ignore-space-change
8446 ignore changes in the amount of white space
8447
8448 -B, --ignore-blank-lines
8449 ignore changes whose lines are all blank
8450
8451 relink
8452 recreates hardlinks between repository clones
8453
8454 Commands
8455 relink
8456 hg relink [ORIGIN]
8457
8458 When repositories are cloned locally, their data files will be
8459 hardlinked so that they only use the space of a single repository.
8460
8461 Unfortunately, subsequent pulls into either repository will break
8462 hardlinks for any files touched by the new changesets, even if both
8463 repositories end up pulling the same changes.
8464
8465 Similarly, passing --rev to "hg clone" will fail to use any hardlinks,
8466 falling back to a complete copy of the source repository.
8467
8468 This command lets you recreate those hardlinks and reclaim that wasted
8469 space.
8470
8471 This repository will be relinked to share space with ORIGIN, which must
8472 be on the same local disk. If ORIGIN is omitted, looks for
8473 "default-relink", then "default", in [paths].
8474
8475 Do not attempt any read operations on this repository while the command
8476 is running. (Both repositories will be locked against writes.)
8477
8478 schemes
8479 extend schemes with shortcuts to repository swarms
8480
8481 This extension allows you to specify shortcuts for parent URLs with a
8482 lot of repositories to act like a scheme, for example:
8483
8484 [schemes]
8485 py = http://code.python.org/hg/
8486
8487 After that you can use it like:
8488
8489 hg clone py://trunk/
8490
8491 Additionally there is support for some more complex schemas, for exam‐
8492 ple used by Google Code:
8493
8494 [schemes]
8495 gcode = http://{1}.googlecode.com/hg/
8496
8497 The syntax is taken from Mercurial templates, and you have unlimited
8498 number of variables, starting with {1} and continuing with {2}, {3} and
8499 so on. This variables will receive parts of URL supplied, split by /.
8500 Anything not specified as {part} will be just appended to an URL.
8501
8502 For convenience, the extension adds these schemes by default:
8503
8504 [schemes]
8505 py = http://hg.python.org/
8506 bb = https://bitbucket.org/
8507 bb+ssh = ssh://hg@bitbucket.org/
8508 gcode = https://{1}.googlecode.com/hg/
8509 kiln = https://{1}.kilnhg.com/Repo/
8510
8511 You can override a predefined scheme by defining a new scheme with the
8512 same name.
8513
8514 share
8515 share a common history between several working directories
8516
8517 Commands
8518 share
8519 hg share [-U] SOURCE [DEST]
8520
8521 Initialize a new repository and working directory that shares its his‐
8522 tory with another repository.
8523
8524 Note using rollback or extensions that destroy/modify history (mq,
8525 rebase, etc.) can cause considerable confusion with shared
8526 clones. In particular, if two shared clones are both updated to
8527 the same changeset, and one of them destroys that changeset with
8528 rollback, the other clone will suddenly stop working: all opera‐
8529 tions will fail with "abort: working directory has unknown par‐
8530 ent". The only known workaround is to use debugsetparents on the
8531 broken clone to reset it to a changeset that still exists (e.g.
8532 tip).
8533
8534 Options:
8535
8536 -U, --noupdate
8537 do not create a working copy
8538
8539 unshare
8540 hg unshare
8541
8542 Copy the store data to the repo and remove the sharedpath data.
8543
8544 transplant
8545 command to transplant changesets from another branch
8546
8547 This extension allows you to transplant changes to another parent revi‐
8548 sion, possibly in another repository. The transplant is done using
8549 'diff' patches.
8550
8551 Transplanted patches are recorded in .hg/transplant/transplants, as a
8552 map from a changeset hash to its hash in the source repository.
8553
8554 Commands
8555 transplant
8556 hg transplant [-s REPO] [-b BRANCH [-a]] [-p REV] [-m REV] [REV]...
8557
8558 Selected changesets will be applied on top of the current working
8559 directory with the log of the original changeset. The changesets are
8560 copied and will thus appear twice in the history with different identi‐
8561 ties.
8562
8563 Consider using the graft command if everything is inside the same
8564 repository - it will use merges and will usually give a better result.
8565 Use the rebase extension if the changesets are unpublished and you want
8566 to move them instead of copying them.
8567
8568 If --log is specified, log messages will have a comment appended of the
8569 form:
8570
8571 (transplanted from CHANGESETHASH)
8572
8573 You can rewrite the changelog message with the --filter option. Its
8574 argument will be invoked with the current changelog message as $1 and
8575 the patch as $2.
8576
8577 --source/-s specifies another repository to use for selecting change‐
8578 sets, just as if it temporarily had been pulled. If --branch/-b is
8579 specified, these revisions will be used as heads when deciding which
8580 changsets to transplant, just as if only these revisions had been
8581 pulled. If --all/-a is specified, all the revisions up to the heads
8582 specified with --branch will be transplanted.
8583
8584 Example:
8585
8586 · transplant all changes up to REV on top of your current revision:
8587
8588 hg transplant --branch REV --all
8589
8590 You can optionally mark selected transplanted changesets as merge
8591 changesets. You will not be prompted to transplant any ancestors of a
8592 merged transplant, and you can merge descendants of them normally
8593 instead of transplanting them.
8594
8595 Merge changesets may be transplanted directly by specifying the proper
8596 parent changeset by calling hg transplant --parent.
8597
8598 If no merges or revisions are provided, hg transplant will start an
8599 interactive changeset browser.
8600
8601 If a changeset application fails, you can fix the merge by hand and
8602 then resume where you left off by calling hg transplant --continue/-c.
8603
8604 Options:
8605
8606 -s, --source
8607 transplant changesets from REPO
8608
8609 -b, --branch
8610 use this source changeset as head
8611
8612 -a, --all
8613 pull all changesets up to the --branch revisions
8614
8615 -p, --prune
8616 skip over REV
8617
8618 -m, --merge
8619 merge at REV
8620
8621 --parent
8622 parent to choose when transplanting merge
8623
8624 -e, --edit
8625 invoke editor on commit messages
8626
8627 --log append transplant info to log message
8628
8629 -c, --continue
8630 continue last transplant session after fixing conflicts
8631
8632 --filter
8633 filter changesets through command
8634
8635 win32mbcs
8636 allow the use of MBCS paths with problematic encodings
8637
8638 Some MBCS encodings are not good for some path operations (i.e. split‐
8639 ting path, case conversion, etc.) with its encoded bytes. We call such
8640 a encoding (i.e. shift_jis and big5) as "problematic encoding". This
8641 extension can be used to fix the issue with those encodings by wrapping
8642 some functions to convert to Unicode string before path operation.
8643
8644 This extension is useful for:
8645
8646 · Japanese Windows users using shift_jis encoding.
8647
8648 · Chinese Windows users using big5 encoding.
8649
8650 · All users who use a repository with one of problematic encodings on
8651 case-insensitive file system.
8652
8653 This extension is not needed for:
8654
8655 · Any user who use only ASCII chars in path.
8656
8657 · Any user who do not use any of problematic encodings.
8658
8659 Note that there are some limitations on using this extension:
8660
8661 · You should use single encoding in one repository.
8662
8663 · If the repository path ends with 0x5c, .hg/hgrc cannot be read.
8664
8665 · win32mbcs is not compatible with fixutf8 extension.
8666
8667 By default, win32mbcs uses encoding.encoding decided by Mercurial. You
8668 can specify the encoding by config option:
8669
8670 [win32mbcs]
8671 encoding = sjis
8672
8673 It is useful for the users who want to commit with UTF-8 log message.
8674
8675 win32text
8676 perform automatic newline conversion
8677
8678 Deprecation: The win32text extension requires each user to configure
8679 the extension again and again for each clone since the configuration
8680 is not copied when cloning.
8681
8682 We have therefore made the eol as an alternative. The eol uses a
8683 version controlled file for its configuration and each clone will
8684 therefore use the right settings from the start.
8685
8686 To perform automatic newline conversion, use:
8687
8688 [extensions]
8689 win32text =
8690 [encode]
8691 ** = cleverencode:
8692 # or ** = macencode:
8693
8694 [decode]
8695 ** = cleverdecode:
8696 # or ** = macdecode:
8697
8698 If not doing conversion, to make sure you do not commit CRLF/CR by
8699 accident:
8700
8701 [hooks]
8702 pretxncommit.crlf = python:hgext.win32text.forbidcrlf
8703 # or pretxncommit.cr = python:hgext.win32text.forbidcr
8704
8705 To do the same check on a server to prevent CRLF/CR from being pushed
8706 or pulled:
8707
8708 [hooks]
8709 pretxnchangegroup.crlf = python:hgext.win32text.forbidcrlf
8710 # or pretxnchangegroup.cr = python:hgext.win32text.forbidcr
8711
8712 zeroconf
8713 discover and advertise repositories on the local network
8714
8715 Zeroconf-enabled repositories will be announced in a network without
8716 the need to configure a server or a service. They can be discovered
8717 without knowing their actual IP address.
8718
8719 To allow other people to discover your repository using run hg serve in
8720 your repository:
8721
8722 $ cd test
8723 $ hg serve
8724
8725 You can discover Zeroconf-enabled repositories by running hg paths:
8726
8727 $ hg paths
8728 zc-test = http://example.com:8000/test
8729
8731 /etc/mercurial/hgrc, $HOME/.hgrc, .hg/hgrc
8732
8733 This file contains defaults and configuration. Values in
8734 .hg/hgrc override those in $HOME/.hgrc, and these override set‐
8735 tings made in the global /etc/mercurial/hgrc configuration. See
8736 hgrc(5) for details of the contents and format of these files.
8737
8738 .hgignore
8739
8740 This file contains regular expressions (one per line) that
8741 describe file names that should be ignored by hg. For details,
8742 see hgignore(5).
8743
8744 .hgsub
8745
8746 This file defines the locations of all subrepositories, and
8747 tells where the subrepository checkouts came from. For details,
8748 see hg help subrepos.
8749
8750 .hgsubstate
8751
8752 This file is where Mercurial stores all nested repository
8753 states. NB: This file should not be edited manually.
8754
8755 .hgtags
8756
8757 This file contains changeset hash values and text tag names (one
8758 of each separated by spaces) that correspond to tagged versions
8759 of the repository contents. The file content is encoded using
8760 UTF-8.
8761
8762 .hg/last-message.txt
8763
8764 This file is used by hg commit to store a backup of the commit
8765 message in case the commit fails.
8766
8767 .hg/localtags
8768
8769 This file can be used to define local tags which are not shared
8770 among repositories. The file format is the same as for .hgtags,
8771 but it is encoded using the local system encoding.
8772
8773 Some commands (e.g. revert) produce backup files ending in .orig, if
8774 the .orig file already exists and is not tracked by Mercurial, it will
8775 be overwritten.
8776
8778 Probably lots, please post them to the mailing list (see Resources
8779 below) when you find them.
8780
8782 hgignore(5), hgrc(5)
8783
8785 Written by Matt Mackall <mpm@selenic.com>
8786
8788 Main Web Site: http://mercurial.selenic.com/
8789
8790 Source code repository: http://selenic.com/hg
8791
8792 Mailing list: http://selenic.com/mailman/listinfo/mercurial
8793
8795 Copyright (C) 2005-2012 Matt Mackall. Free use of this software is
8796 granted under the terms of the GNU General Public License version 2 or
8797 any later version.
8798
8800 Matt Mackall <mpm@selenic.com>
8801
8802 Organization: Mercurial
8803
8804
8805
8806
8807 HG(1)