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, assume 'yes' for any required answers
39
40 -q, --quiet
41 suppress output
42
43 -v, --verbose
44 enable additional output
45
46 --config
47 set/override config option (use 'section.name=value')
48
49 --debug
50 enable debugging output
51
52 --debugger
53 start debugger
54
55 --encoding
56 set the charset encoding (default: ascii)
57
58 --encodingmode
59 set the charset encoding mode (default: strict)
60
61 --traceback
62 always print a traceback on exception
63
64 --time time how long the command takes
65
66 --profile
67 print command execution profile
68
69 --version
70 output version information and exit
71
72 -h, --help
73 display help and exit
74
76 add
77 hg add [OPTION]... [FILE]...
78
79 Schedule files to be version controlled and added to the repository.
80
81 The files will be added to the repository at the next commit. To undo
82 an add before that, see hg forget.
83
84 If no names are given, add all files to the repository.
85
86 An example showing how new (unknown) files are added automatically by
87 hg add:
88
89 $ ls
90 foo.c
91 $ hg status
92 ? foo.c
93 $ hg add
94 adding foo.c
95 $ hg status
96 A foo.c
97
98 Returns 0 if all files are successfully added.
99
100 Options:
101
102 -I, --include
103 include names matching the given patterns
104
105 -X, --exclude
106 exclude names matching the given patterns
107
108 -S, --subrepos
109 recurse into subrepositories
110
111 -n, --dry-run
112 do not perform actions, just print output
113
114 addremove
115 hg addremove [OPTION]... [FILE]...
116
117 Add all new files and remove all missing files from the repository.
118
119 New files are ignored if they match any of the patterns in .hgignore.
120 As with add, these changes take effect at the next commit.
121
122 Use the -s/--similarity option to detect renamed files. With a parame‐
123 ter greater than 0, this compares every removed file with every added
124 file and records those similar enough as renames. This option takes a
125 percentage between 0 (disabled) and 100 (files must be identical) as
126 its parameter. Detecting renamed files this way can be expensive. After
127 using this option, hg status -C can be used to check which files were
128 identified as moved or renamed.
129
130 Returns 0 if all files are successfully added.
131
132 Options:
133
134 -s, --similarity
135 guess renamed files by similarity (0<=s<=100)
136
137 -I, --include
138 include names matching the given patterns
139
140 -X, --exclude
141 exclude names matching the given patterns
142
143 -n, --dry-run
144 do not perform actions, just print output
145
146 annotate
147 hg annotate [-r REV] [-f] [-a] [-u] [-d] [-n] [-c] [-l] FILE...
148
149 List changes in files, showing the revision id responsible for each
150 line
151
152 This command is useful for discovering when a change was made and by
153 whom.
154
155 Without the -a/--text option, annotate will avoid processing files it
156 detects as binary. With -a, annotate will annotate the file anyway,
157 although the results will probably be neither useful nor desirable.
158
159 Returns 0 on success.
160
161 Options:
162
163 -r, --rev
164 annotate the specified revision
165
166 --follow
167 follow copies/renames and list the filename (DEPRECATED)
168
169 --no-follow
170 don't follow copies and renames
171
172 -a, --text
173 treat all files as text
174
175 -u, --user
176 list the author (long with -v)
177
178 -f, --file
179 list the filename
180
181 -d, --date
182 list the date (short with -q)
183
184 -n, --number
185 list the revision number (default)
186
187 -c, --changeset
188 list the changeset
189
190 -l, --line-number
191 show line number at the first appearance
192
193 -I, --include
194 include names matching the given patterns
195
196 -X, --exclude
197 exclude names matching the given patterns
198
199 aliases: blame
200
201 archive
202 hg archive [OPTION]... DEST
203
204 By default, the revision used is the parent of the working directory;
205 use -r/--rev to specify a different revision.
206
207 The archive type is automatically detected based on file extension (or
208 override using -t/--type).
209
210 Valid types are:
211
212 files
213
214 a directory full of files (default)
215
216 tar
217
218 tar archive, uncompressed
219
220 tbz2
221
222 tar archive, compressed using bzip2
223
224 tgz
225
226 tar archive, compressed using gzip
227
228 uzip
229
230 zip archive, uncompressed
231
232 zip
233
234 zip archive, compressed using deflate
235
236 The exact name of the destination archive or directory is given using a
237 format string; see hg help export for details.
238
239 Each member added to an archive file has a directory prefix prepended.
240 Use -p/--prefix to specify a format string for the prefix. The default
241 is the basename of the archive, with suffixes removed.
242
243 Returns 0 on success.
244
245 Options:
246
247 --no-decode
248 do not pass files through decoders
249
250 -p, --prefix
251 directory prefix for files in archive
252
253 -r, --rev
254 revision to distribute
255
256 -t, --type
257 type of distribution to create
258
259 -S, --subrepos
260 recurse into subrepositories
261
262 -I, --include
263 include names matching the given patterns
264
265 -X, --exclude
266 exclude names matching the given patterns
267
268 backout
269 hg backout [OPTION]... [-r] REV
270
271 Prepare a new changeset with the effect of REV undone in the current
272 working directory.
273
274 If REV is the parent of the working directory, then this new changeset
275 is committed automatically. Otherwise, hg needs to merge the changes
276 and the merged result is left uncommitted.
277
278 By default, the pending changeset will have one parent, maintaining a
279 linear history. With --merge, the pending changeset will instead have
280 two parents: the old parent of the working directory and a new child of
281 REV that simply undoes REV.
282
283 Before version 1.7, the behavior without --merge was equivalent to
284 specifying --merge followed by hg update --clean . to cancel the merge
285 and leave the child of REV as a head to be merged separately.
286
287 See hg help dates for a list of formats valid for -d/--date.
288
289 Returns 0 on success.
290
291 Options:
292
293 --merge
294 merge with old dirstate parent after backout
295
296 --parent
297 parent to choose when backing out merge
298
299 -t, --tool
300 specify merge tool
301
302 -r, --rev
303 revision to backout
304
305 -I, --include
306 include names matching the given patterns
307
308 -X, --exclude
309 exclude names matching the given patterns
310
311 -m, --message
312 use text as commit message
313
314 -l, --logfile
315 read commit message from file
316
317 -d, --date
318 record the specified date as commit date
319
320 -u, --user
321 record the specified user as committer
322
323 bisect
324 hg bisect [-gbsr] [-U] [-c CMD] [REV]
325
326 This command helps to find changesets which introduce problems. To use,
327 mark the earliest changeset you know exhibits the problem as bad, then
328 mark the latest changeset which is free from the problem as good.
329 Bisect will update your working directory to a revision for testing
330 (unless the -U/--noupdate option is specified). Once you have performed
331 tests, mark the working directory as good or bad, and bisect will
332 either update to another candidate changeset or announce that it has
333 found the bad revision.
334
335 As a shortcut, you can also use the revision argument to mark a revi‐
336 sion as good or bad without checking it out first.
337
338 If you supply a command, it will be used for automatic bisection. Its
339 exit status will be used to mark revisions as good or bad: status 0
340 means good, 125 means to skip the revision, 127 (command not found)
341 will abort the bisection, and any other non-zero exit status means the
342 revision is bad.
343
344 Returns 0 on success.
345
346 Options:
347
348 -r, --reset
349 reset bisect state
350
351 -g, --good
352 mark changeset good
353
354 -b, --bad
355 mark changeset bad
356
357 -s, --skip
358 skip testing changeset
359
360 -c, --command
361 use command to check changeset state
362
363 -U, --noupdate
364 do not update to target
365
366 bookmarks
367 hg bookmarks [-f] [-d] [-m NAME] [-r REV] [NAME]
368
369 Bookmarks are pointers to certain commits that move when committing.
370 Bookmarks are local. They can be renamed, copied and deleted. It is
371 possible to use bookmark names in hg merge and hg update to merge and
372 update respectively to a given bookmark.
373
374 You can use hg bookmark NAME to set a bookmark on the working direc‐
375 tory's parent revision with the given name. If you specify a revision
376 using -r REV (where REV may be an existing bookmark), the bookmark is
377 assigned to that revision.
378
379 Bookmarks can be pushed and pulled between repositories (see hg help
380 push and hg help pull). This requires both the local and remote reposi‐
381 tories to support bookmarks. For versions prior to 1.8, this means the
382 bookmarks extension must be enabled.
383
384 Options:
385
386 -f, --force
387 force
388
389 -r, --rev
390 revision
391
392 -d, --delete
393 delete a given bookmark
394
395 -m, --rename
396 rename a given bookmark
397
398 branch
399 hg branch [-fC] [NAME]
400
401 With no argument, show the current branch name. With one argument, set
402 the working directory branch name (the branch will not exist in the
403 repository until the next commit). Standard practice recommends that
404 primary development take place on the 'default' branch.
405
406 Unless -f/--force is specified, branch will not let you set a branch
407 name that already exists, even if it's inactive.
408
409 Use -C/--clean to reset the working directory branch to that of the
410 parent of the working directory, negating a previous branch change.
411
412 Use the command hg update to switch to an existing branch. Use hg com‐
413 mit --close-branch to mark this branch as closed.
414
415 Returns 0 on success.
416
417 Options:
418
419 -f, --force
420 set branch name even if it shadows an existing branch
421
422 -C, --clean
423 reset branch name to parent branch name
424
425 branches
426 hg branches [-ac]
427
428 List the repository's named branches, indicating which ones are inac‐
429 tive. If -c/--closed is specified, also list branches which have been
430 marked closed (see hg commit --close-branch).
431
432 If -a/--active is specified, only show active branches. A branch is
433 considered active if it contains repository heads.
434
435 Use the command hg update to switch to an existing branch.
436
437 Returns 0.
438
439 Options:
440
441 -a, --active
442 show only branches that have unmerged heads
443
444 -c, --closed
445 show normal and closed branches
446
447 bundle
448 hg bundle [-f] [-t TYPE] [-a] [-r REV]... [--base REV]... FILE [DEST]
449
450 Generate a compressed changegroup file collecting changesets not known
451 to be in another repository.
452
453 If you omit the destination repository, then hg assumes the destination
454 will have all the nodes you specify with --base parameters. To create a
455 bundle containing all changesets, use -a/--all (or --base null).
456
457 You can change compression method with the -t/--type option. The
458 available compression methods are: none, bzip2, and gzip (by default,
459 bundles are compressed using bzip2).
460
461 The bundle file can then be transferred using conventional means and
462 applied to another repository with the unbundle or pull command. This
463 is useful when direct push and pull are not available or when exporting
464 an entire repository is undesirable.
465
466 Applying bundles preserves all changeset contents including permis‐
467 sions, copy/rename information, and revision history.
468
469 Returns 0 on success, 1 if no changes found.
470
471 Options:
472
473 -f, --force
474 run even when the destination is unrelated
475
476 -r, --rev
477 a changeset intended to be added to the destination
478
479 -b, --branch
480 a specific branch you would like to bundle
481
482 --base a base changeset assumed to be available at the destination
483
484 -a, --all
485 bundle all changesets in the repository
486
487 -t, --type
488 bundle compression type to use (default: bzip2)
489
490 -e, --ssh
491 specify ssh command to use
492
493 --remotecmd
494 specify hg command to run on the remote side
495
496 --insecure
497 do not verify server certificate (ignoring web.cacerts config)
498
499 cat
500 hg cat [OPTION]... FILE...
501
502 Print the specified files as they were at the given revision. If no
503 revision is given, the parent of the working directory is used, or tip
504 if no revision is checked out.
505
506 Output may be to a file, in which case the name of the file is given
507 using a format string. The formatting rules are the same as for the
508 export command, with the following additions:
509
510 %s
511
512 basename of file being printed
513
514 %d
515
516 dirname of file being printed, or '.' if in repository root
517
518 %p
519
520 root-relative path name of file being printed
521
522 Returns 0 on success.
523
524 Options:
525
526 -o, --output
527 print output to file with formatted name
528
529 -r, --rev
530 print the given revision
531
532 --decode
533 apply any matching decode filter
534
535 -I, --include
536 include names matching the given patterns
537
538 -X, --exclude
539 exclude names matching the given patterns
540
541 clone
542 hg clone [OPTION]... SOURCE [DEST]
543
544 Create a copy of an existing repository in a new directory.
545
546 If no destination directory name is specified, it defaults to the base‐
547 name of the source.
548
549 The location of the source is added to the new repository's .hg/hgrc
550 file, as the default to be used for future pulls.
551
552 See hg help urls for valid source format details.
553
554 It is possible to specify an ssh:// URL as the destination, but no
555 .hg/hgrc and working directory will be created on the remote side.
556 Please see hg help urls for important details about ssh:// URLs.
557
558 A set of changesets (tags, or branch names) to pull may be specified by
559 listing each changeset (tag, or branch name) with -r/--rev. If
560 -r/--rev is used, the cloned repository will contain only a subset of
561 the changesets of the source repository. Only the set of changesets
562 defined by all -r/--rev options (including all their ancestors) will be
563 pulled into the destination repository. No subsequent changesets
564 (including subsequent tags) will be present in the destination.
565
566 Using -r/--rev (or 'clone src#rev dest') implies --pull, even for local
567 source repositories.
568
569 For efficiency, hardlinks are used for cloning whenever the source and
570 destination are on the same filesystem (note this applies only to the
571 repository data, not to the working directory). Some filesystems, such
572 as AFS, implement hardlinking incorrectly, but do not report errors. In
573 these cases, use the --pull option to avoid hardlinking.
574
575 In some cases, you can clone repositories and the working directory
576 using full hardlinks with
577
578 $ cp -al REPO REPOCLONE
579
580 This is the fastest way to clone, but it is not always safe. The opera‐
581 tion is not atomic (making sure REPO is not modified during the opera‐
582 tion is up to you) and you have to make sure your editor breaks
583 hardlinks (Emacs and most Linux Kernel tools do so). Also, this is not
584 compatible with certain extensions that place their metadata under the
585 .hg directory, such as mq.
586
587 Mercurial will update the working directory to the first applicable
588 revision from this list:
589
590 a. null if -U or the source repository has no changesets
591
592 b. if -u . and the source repository is local, the first parent of the
593 source repository's working directory
594
595 c. the changeset specified with -u (if a branch name, this means the
596 latest head of that branch)
597
598 d. the changeset specified with -r
599
600 e. the tipmost head specified with -b
601
602 f. the tipmost head specified with the url#branch source syntax
603
604 g. the tipmost head of the default branch
605
606 h. tip
607
608 Returns 0 on success.
609
610 Options:
611
612 -U, --noupdate
613 the clone will include an empty working copy (only a repository)
614
615 -u, --updaterev
616 revision, tag or branch to check out
617
618 -r, --rev
619 include the specified changeset
620
621 -b, --branch
622 clone only the specified branch
623
624 --pull use pull protocol to copy metadata
625
626 --uncompressed
627 use uncompressed transfer (fast over LAN)
628
629 -e, --ssh
630 specify ssh command to use
631
632 --remotecmd
633 specify hg command to run on the remote side
634
635 --insecure
636 do not verify server certificate (ignoring web.cacerts config)
637
638 commit
639 hg commit [OPTION]... [FILE]...
640
641 Commit changes to the given files into the repository. Unlike a cen‐
642 tralized SCM, this operation is a local operation. See hg push for a
643 way to actively distribute your changes.
644
645 If a list of files is omitted, all changes reported by hg status will
646 be committed.
647
648 If you are committing the result of a merge, do not provide any file‐
649 names or -I/-X filters.
650
651 If no commit message is specified, Mercurial starts your configured
652 editor where you can enter a message. In case your commit fails, you
653 will find a backup of your message in .hg/last-message.txt.
654
655 See hg help dates for a list of formats valid for -d/--date.
656
657 Returns 0 on success, 1 if nothing changed.
658
659 Options:
660
661 -A, --addremove
662 mark new/missing files as added/removed before committing
663
664 --close-branch
665 mark a branch as closed, hiding it from the branch list
666
667 -I, --include
668 include names matching the given patterns
669
670 -X, --exclude
671 exclude names matching the given patterns
672
673 -m, --message
674 use text as commit message
675
676 -l, --logfile
677 read commit message from file
678
679 -d, --date
680 record the specified date as commit date
681
682 -u, --user
683 record the specified user as committer
684
685 aliases: ci
686
687 copy
688 hg copy [OPTION]... [SOURCE]... DEST
689
690 Mark dest as having copies of source files. If dest is a directory,
691 copies are put in that directory. If dest is a file, the source must be
692 a single file.
693
694 By default, this command copies the contents of files as they exist in
695 the working directory. If invoked with -A/--after, the operation is
696 recorded, but no copying is performed.
697
698 This command takes effect with the next commit. To undo a copy before
699 that, see hg revert.
700
701 Returns 0 on success, 1 if errors are encountered.
702
703 Options:
704
705 -A, --after
706 record a copy that has already occurred
707
708 -f, --force
709 forcibly copy over an existing managed file
710
711 -I, --include
712 include names matching the given patterns
713
714 -X, --exclude
715 exclude names matching the given patterns
716
717 -n, --dry-run
718 do not perform actions, just print output
719
720 aliases: cp
721
722 diff
723 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
724
725 Show differences between revisions for the specified files.
726
727 Differences between files are shown using the unified diff format.
728
729 Note diff may generate unexpected results for merges, as it will
730 default to comparing against the working directory's first par‐
731 ent changeset if no revisions are specified.
732
733 When two revision arguments are given, then changes are shown between
734 those revisions. If only one revision is specified then that revision
735 is compared to the working directory, and, when no revisions are speci‐
736 fied, the working directory files are compared to its parent.
737
738 Alternatively you can specify -c/--change with a revision to see the
739 changes in that changeset relative to its first parent.
740
741 Without the -a/--text option, diff will avoid generating diffs of files
742 it detects as binary. With -a, diff will generate a diff anyway, proba‐
743 bly with undesirable results.
744
745 Use the -g/--git option to generate diffs in the git extended diff for‐
746 mat. For more information, read hg help diffs.
747
748 Returns 0 on success.
749
750 Options:
751
752 -r, --rev
753 revision
754
755 -c, --change
756 change made by revision
757
758 -a, --text
759 treat all files as text
760
761 -g, --git
762 use git extended diff format
763
764 --nodates
765 omit dates from diff headers
766
767 -p, --show-function
768 show which function each change is in
769
770 --reverse
771 produce a diff that undoes the changes
772
773 -w, --ignore-all-space
774 ignore white space when comparing lines
775
776 -b, --ignore-space-change
777 ignore changes in the amount of white space
778
779 -B, --ignore-blank-lines
780 ignore changes whose lines are all blank
781
782 -U, --unified
783 number of lines of context to show
784
785 --stat output diffstat-style summary of changes
786
787 -I, --include
788 include names matching the given patterns
789
790 -X, --exclude
791 exclude names matching the given patterns
792
793 -S, --subrepos
794 recurse into subrepositories
795
796 export
797 hg export [OPTION]... [-o OUTFILESPEC] REV...
798
799 Print the changeset header and diffs for one or more revisions.
800
801 The information shown in the changeset header is: author, date, branch
802 name (if non-default), changeset hash, parent(s) and commit comment.
803
804 Note export may generate unexpected diff output for merge changesets,
805 as it will compare the merge changeset against its first parent
806 only.
807
808 Output may be to a file, in which case the name of the file is given
809 using a format string. The formatting rules are as follows:
810
811 %%
812
813 literal "%" character
814
815 %H
816
817 changeset hash (40 hexadecimal digits)
818
819 %N
820
821 number of patches being generated
822
823 %R
824
825 changeset revision number
826
827 %b
828
829 basename of the exporting repository
830
831 %h
832
833 short-form changeset hash (12 hexadecimal digits)
834
835 %n
836
837 zero-padded sequence number, starting at 1
838
839 %r
840
841 zero-padded changeset revision number
842
843 Without the -a/--text option, export will avoid generating diffs of
844 files it detects as binary. With -a, export will generate a diff any‐
845 way, probably with undesirable results.
846
847 Use the -g/--git option to generate diffs in the git extended diff for‐
848 mat. See hg help diffs for more information.
849
850 With the --switch-parent option, the diff will be against the second
851 parent. It can be useful to review a merge.
852
853 Returns 0 on success.
854
855 Options:
856
857 -o, --output
858 print output to file with formatted name
859
860 --switch-parent
861 diff against the second parent
862
863 -r, --rev
864 revisions to export
865
866 -a, --text
867 treat all files as text
868
869 -g, --git
870 use git extended diff format
871
872 --nodates
873 omit dates from diff headers
874
875 forget
876 hg forget [OPTION]... FILE...
877
878 Mark the specified files so they will no longer be tracked after the
879 next commit.
880
881 This only removes files from the current branch, not from the entire
882 project history, and it does not delete them from the working direc‐
883 tory.
884
885 To undo a forget before the next commit, see hg add.
886
887 Returns 0 on success.
888
889 Options:
890
891 -I, --include
892 include names matching the given patterns
893
894 -X, --exclude
895 exclude names matching the given patterns
896
897 grep
898 hg grep [OPTION]... PATTERN [FILE]...
899
900 Search revisions of files for a regular expression.
901
902 This command behaves differently than Unix grep. It only accepts
903 Python/Perl regexps. It searches repository history, not the working
904 directory. It always prints the revision number in which a match
905 appears.
906
907 By default, grep only prints output for the first revision of a file in
908 which it finds a match. To get it to print every revision that contains
909 a change in match status ("-" for a match that becomes a non-match, or
910 "+" for a non-match that becomes a match), use the --all flag.
911
912 Returns 0 if a match is found, 1 otherwise.
913
914 Options:
915
916 -0, --print0
917 end fields with NUL
918
919 --all print all revisions that match
920
921 -f, --follow
922 follow changeset history, or file history across copies and
923 renames
924
925 -i, --ignore-case
926 ignore case when matching
927
928 -l, --files-with-matches
929 print only filenames and revisions that match
930
931 -n, --line-number
932 print matching line numbers
933
934 -r, --rev
935 only search files changed within revision range
936
937 -u, --user
938 list the author (long with -v)
939
940 -d, --date
941 list the date (short with -q)
942
943 -I, --include
944 include names matching the given patterns
945
946 -X, --exclude
947 exclude names matching the given patterns
948
949 heads
950 hg heads [-ac] [-r STARTREV] [REV]...
951
952 With no arguments, show all repository branch heads.
953
954 Repository "heads" are changesets with no child changesets. They are
955 where development generally takes place and are the usual targets for
956 update and merge operations. Branch heads are changesets that have no
957 child changeset on the same branch.
958
959 If one or more REVs are given, only branch heads on the branches asso‐
960 ciated with the specified changesets are shown.
961
962 If -c/--closed is specified, also show branch heads marked closed (see
963 hg commit --close-branch).
964
965 If STARTREV is specified, only those heads that are descendants of
966 STARTREV will be displayed.
967
968 If -t/--topo is specified, named branch mechanics will be ignored and
969 only changesets without children will be shown.
970
971 Returns 0 if matching heads are found, 1 if not.
972
973 Options:
974
975 -r, --rev
976 show only heads which are descendants of STARTREV
977
978 -t, --topo
979 show topological heads only
980
981 -a, --active
982 show active branchheads only (DEPRECATED)
983
984 -c, --closed
985 show normal and closed branch heads
986
987 --style
988 display using template map file
989
990 --template
991 display with template
992
993 help
994 hg help [TOPIC]
995
996 With no arguments, print a list of commands with short help messages.
997
998 Given a topic, extension, or command name, print help for that topic.
999
1000 Returns 0 if successful.
1001
1002 identify
1003 hg identify [-nibtB] [-r REV] [SOURCE]
1004
1005 Print a summary identifying the repository state at REV using one or
1006 two parent hash identifiers, followed by a "+" if the working directory
1007 has uncommitted changes, the branch name (if not default), a list of
1008 tags, and a list of bookmarks.
1009
1010 When REV is not given, print a summary of the current state of the
1011 repository.
1012
1013 Specifying a path to a repository root or Mercurial bundle will cause
1014 lookup to operate on that repository/bundle.
1015
1016 Returns 0 if successful.
1017
1018 Options:
1019
1020 -r, --rev
1021 identify the specified revision
1022
1023 -n, --num
1024 show local revision number
1025
1026 -i, --id
1027 show global revision id
1028
1029 -b, --branch
1030 show branch
1031
1032 -t, --tags
1033 show tags
1034
1035 -B, --bookmarks
1036 show bookmarks
1037
1038 aliases: id
1039
1040 import
1041 hg import [OPTION]... PATCH...
1042
1043 Import a list of patches and commit them individually (unless --no-com‐
1044 mit is specified).
1045
1046 If there are outstanding changes in the working directory, import will
1047 abort unless given the -f/--force flag.
1048
1049 You can import a patch straight from a mail message. Even patches as
1050 attachments work (to use the body part, it must have type text/plain or
1051 text/x-patch). From and Subject headers of email message are used as
1052 default committer and commit message. All text/plain body parts before
1053 first diff are added to commit message.
1054
1055 If the imported patch was generated by hg export, user and description
1056 from patch override values from message headers and body. Values given
1057 on command line with -m/--message and -u/--user override these.
1058
1059 If --exact is specified, import will set the working directory to the
1060 parent of each patch before applying it, and will abort if the result‐
1061 ing changeset has a different ID than the one recorded in the patch.
1062 This may happen due to character set problems or other deficiencies in
1063 the text patch format.
1064
1065 With -s/--similarity, hg will attempt to discover renames and copies in
1066 the patch in the same way as 'addremove'.
1067
1068 To read a patch from standard input, use "-" as the patch name. If a
1069 URL is specified, the patch will be downloaded from it. See hg help
1070 dates for a list of formats valid for -d/--date.
1071
1072 Returns 0 on success.
1073
1074 Options:
1075
1076 -p, --strip
1077 directory strip option for patch. This has the same meaning as
1078 the corresponding patch option (default: 1)
1079
1080 -b, --base
1081 base path
1082
1083 -f, --force
1084 skip check for outstanding uncommitted changes
1085
1086 --no-commit
1087 don't commit, just update the working directory
1088
1089 --exact
1090 apply patch to the nodes from which it was generated
1091
1092 --import-branch
1093 use any branch information in patch (implied by --exact)
1094
1095 -m, --message
1096 use text as commit message
1097
1098 -l, --logfile
1099 read commit message from file
1100
1101 -d, --date
1102 record the specified date as commit date
1103
1104 -u, --user
1105 record the specified user as committer
1106
1107 -s, --similarity
1108 guess renamed files by similarity (0<=s<=100)
1109
1110 aliases: patch
1111
1112 incoming
1113 hg incoming [-p] [-n] [-M] [-f] [-r REV]... [--bundle FILENAME] [SOURCE]
1114
1115 Show new changesets found in the specified path/URL or the default pull
1116 location. These are the changesets that would have been pulled if a
1117 pull at the time you issued this command.
1118
1119 For remote repository, using --bundle avoids downloading the changesets
1120 twice if the incoming is followed by a pull.
1121
1122 See pull for valid source format details.
1123
1124 Returns 0 if there are incoming changes, 1 otherwise.
1125
1126 Options:
1127
1128 -f, --force
1129 run even if remote repository is unrelated
1130
1131 -n, --newest-first
1132 show newest record first
1133
1134 --bundle
1135 file to store the bundles into
1136
1137 -r, --rev
1138 a remote changeset intended to be added
1139
1140 -B, --bookmarks
1141 compare bookmarks
1142
1143 -b, --branch
1144 a specific branch you would like to pull
1145
1146 -p, --patch
1147 show patch
1148
1149 -g, --git
1150 use git extended diff format
1151
1152 -l, --limit
1153 limit number of changes displayed
1154
1155 -M, --no-merges
1156 do not show merges
1157
1158 --stat output diffstat-style summary of changes
1159
1160 --style
1161 display using template map file
1162
1163 --template
1164 display with template
1165
1166 -e, --ssh
1167 specify ssh command to use
1168
1169 --remotecmd
1170 specify hg command to run on the remote side
1171
1172 --insecure
1173 do not verify server certificate (ignoring web.cacerts config)
1174
1175 -S, --subrepos
1176 recurse into subrepositories
1177
1178 aliases: in
1179
1180 init
1181 hg init [-e CMD] [--remotecmd CMD] [DEST]
1182
1183 Initialize a new repository in the given directory. If the given direc‐
1184 tory does not exist, it will be created.
1185
1186 If no directory is given, the current directory is used.
1187
1188 It is possible to specify an ssh:// URL as the destination. See hg
1189 help urls for more information.
1190
1191 Returns 0 on success.
1192
1193 Options:
1194
1195 -e, --ssh
1196 specify ssh command to use
1197
1198 --remotecmd
1199 specify hg command to run on the remote side
1200
1201 --insecure
1202 do not verify server certificate (ignoring web.cacerts config)
1203
1204 locate
1205 hg locate [OPTION]... [PATTERN]...
1206
1207 Print files under Mercurial control in the working directory whose
1208 names match the given patterns.
1209
1210 By default, this command searches all directories in the working direc‐
1211 tory. To search just the current directory and its subdirectories, use
1212 "--include .".
1213
1214 If no patterns are given to match, this command prints the names of all
1215 files under Mercurial control in the working directory.
1216
1217 If you want to feed the output of this command into the "xargs" com‐
1218 mand, use the -0 option to both this command and "xargs". This will
1219 avoid the problem of "xargs" treating single filenames that contain
1220 whitespace as multiple filenames.
1221
1222 Returns 0 if a match is found, 1 otherwise.
1223
1224 Options:
1225
1226 -r, --rev
1227 search the repository as it is in REV
1228
1229 -0, --print0
1230 end filenames with NUL, for use with xargs
1231
1232 -f, --fullpath
1233 print complete paths from the filesystem root
1234
1235 -I, --include
1236 include names matching the given patterns
1237
1238 -X, --exclude
1239 exclude names matching the given patterns
1240
1241 log
1242 hg log [OPTION]... [FILE]
1243
1244 Print the revision history of the specified files or the entire
1245 project.
1246
1247 File history is shown without following rename or copy history of
1248 files. Use -f/--follow with a filename to follow history across renames
1249 and copies. --follow without a filename will only show ancestors or
1250 descendants of the starting revision. --follow-first only follows the
1251 first parent of merge revisions.
1252
1253 If no revision range is specified, the default is tip:0 unless --follow
1254 is set, in which case the working directory parent is used as the
1255 starting revision. You can specify a revision set for log, see hg help
1256 revsets for more information.
1257
1258 See hg help dates for a list of formats valid for -d/--date.
1259
1260 By default this command prints revision number and changeset id, tags,
1261 non-trivial parents, user, date and time, and a summary for each com‐
1262 mit. When the -v/--verbose switch is used, the list of changed files
1263 and full commit message are shown.
1264
1265 Note log -p/--patch may generate unexpected diff output for merge
1266 changesets, as it will only compare the merge changeset against
1267 its first parent. Also, only files different from BOTH parents
1268 will appear in files:.
1269
1270 Returns 0 on success.
1271
1272 Options:
1273
1274 -f, --follow
1275 follow changeset history, or file history across copies and
1276 renames
1277
1278 --follow-first
1279 only follow the first parent of merge changesets
1280
1281 -d, --date
1282 show revisions matching date spec
1283
1284 -C, --copies
1285 show copied files
1286
1287 -k, --keyword
1288 do case-insensitive search for a given text
1289
1290 -r, --rev
1291 show the specified revision or range
1292
1293 --removed
1294 include revisions where files were removed
1295
1296 -m, --only-merges
1297 show only merges
1298
1299 -u, --user
1300 revisions committed by user
1301
1302 --only-branch
1303 show only changesets within the given named branch (DEPRECATED)
1304
1305 -b, --branch
1306 show changesets within the given named branch
1307
1308 -P, --prune
1309 do not display revision or any of its ancestors
1310
1311 -p, --patch
1312 show patch
1313
1314 -g, --git
1315 use git extended diff format
1316
1317 -l, --limit
1318 limit number of changes displayed
1319
1320 -M, --no-merges
1321 do not show merges
1322
1323 --stat output diffstat-style summary of changes
1324
1325 --style
1326 display using template map file
1327
1328 --template
1329 display with template
1330
1331 -I, --include
1332 include names matching the given patterns
1333
1334 -X, --exclude
1335 exclude names matching the given patterns
1336
1337 aliases: history
1338
1339 manifest
1340 hg manifest [-r REV]
1341
1342 Print a list of version controlled files for the given revision. If no
1343 revision is given, the first parent of the working directory is used,
1344 or the null revision if no revision is checked out.
1345
1346 With -v, print file permissions, symlink and executable bits. With
1347 --debug, print file revision hashes.
1348
1349 Returns 0 on success.
1350
1351 Options:
1352
1353 -r, --rev
1354 revision to display
1355
1356 merge
1357 hg merge [-P] [-f] [[-r] REV]
1358
1359 The current working directory is updated with all changes made in the
1360 requested revision since the last common predecessor revision.
1361
1362 Files that changed between either parent are marked as changed for the
1363 next commit and a commit must be performed before any further updates
1364 to the repository are allowed. The next commit will have two parents.
1365
1366 --tool can be used to specify the merge tool used for file merges. It
1367 overrides the HGMERGE environment variable and your configuration
1368 files.
1369
1370 If no revision is specified, the working directory's parent is a head
1371 revision, and the current branch contains exactly one other head, the
1372 other head is merged with by default. Otherwise, an explicit revision
1373 with which to merge with must be provided.
1374
1375 hg resolve must be used to resolve unresolved files.
1376
1377 To undo an uncommitted merge, use hg update --clean . which will check
1378 out a clean copy of the original merge parent, losing all changes.
1379
1380 Returns 0 on success, 1 if there are unresolved files.
1381
1382 Options:
1383
1384 -f, --force
1385 force a merge with outstanding changes
1386
1387 -t, --tool
1388 specify merge tool
1389
1390 -r, --rev
1391 revision to merge
1392
1393 -P, --preview
1394 review revisions to merge (no merge is performed)
1395
1396 outgoing
1397 hg outgoing [-M] [-p] [-n] [-f] [-r REV]... [DEST]
1398
1399 Show changesets not found in the specified destination repository or
1400 the default push location. These are the changesets that would be
1401 pushed if a push was requested.
1402
1403 See pull for details of valid destination formats.
1404
1405 Returns 0 if there are outgoing changes, 1 otherwise.
1406
1407 Options:
1408
1409 -f, --force
1410 run even when the destination is unrelated
1411
1412 -r, --rev
1413 a changeset intended to be included in the destination
1414
1415 -n, --newest-first
1416 show newest record first
1417
1418 -B, --bookmarks
1419 compare bookmarks
1420
1421 -b, --branch
1422 a specific branch you would like to push
1423
1424 -p, --patch
1425 show patch
1426
1427 -g, --git
1428 use git extended diff format
1429
1430 -l, --limit
1431 limit number of changes displayed
1432
1433 -M, --no-merges
1434 do not show merges
1435
1436 --stat output diffstat-style summary of changes
1437
1438 --style
1439 display using template map file
1440
1441 --template
1442 display with template
1443
1444 -e, --ssh
1445 specify ssh command to use
1446
1447 --remotecmd
1448 specify hg command to run on the remote side
1449
1450 --insecure
1451 do not verify server certificate (ignoring web.cacerts config)
1452
1453 -S, --subrepos
1454 recurse into subrepositories
1455
1456 aliases: out
1457
1458 parents
1459 hg parents [-r REV] [FILE]
1460
1461 Print the working directory's parent revisions. If a revision is given
1462 via -r/--rev, the parent of that revision will be printed. If a file
1463 argument is given, the revision in which the file was last changed
1464 (before the working directory revision or the argument to --rev if
1465 given) is printed.
1466
1467 Returns 0 on success.
1468
1469 Options:
1470
1471 -r, --rev
1472 show parents of the specified revision
1473
1474 --style
1475 display using template map file
1476
1477 --template
1478 display with template
1479
1480 paths
1481 hg paths [NAME]
1482
1483 Show definition of symbolic path name NAME. If no name is given, show
1484 definition of all available names.
1485
1486 Path names are defined in the [paths] section of your configuration
1487 file and in /etc/mercurial/hgrc. If run inside a repository, .hg/hgrc
1488 is used, too.
1489
1490 The path names default and default-push have a special meaning. When
1491 performing a push or pull operation, they are used as fallbacks if no
1492 location is specified on the command-line. When default-push is set,
1493 it will be used for push and default will be used for pull; otherwise
1494 default is used as the fallback for both. When cloning a repository,
1495 the clone source is written as default in .hg/hgrc. Note that default
1496 and default-push apply to all inbound (e.g. hg incoming) and outbound
1497 (e.g. hg outgoing, hg email and hg bundle) operations.
1498
1499 See hg help urls for more information.
1500
1501 Returns 0 on success.
1502
1503 pull
1504 hg pull [-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [SOURCE]
1505
1506 Pull changes from a remote repository to a local one.
1507
1508 This finds all changes from the repository at the specified path or URL
1509 and adds them to a local repository (the current one unless -R is spec‐
1510 ified). By default, this does not update the copy of the project in the
1511 working directory.
1512
1513 Use hg incoming if you want to see what would have been added by a pull
1514 at the time you issued this command. If you then decide to add those
1515 changes to the repository, you should use hg pull -r X where X is the
1516 last changeset listed by hg incoming.
1517
1518 If SOURCE is omitted, the 'default' path will be used. See hg help
1519 urls for more information.
1520
1521 Returns 0 on success, 1 if an update had unresolved files.
1522
1523 Options:
1524
1525 -u, --update
1526 update to new branch head if changesets were pulled
1527
1528 -f, --force
1529 run even when remote repository is unrelated
1530
1531 -r, --rev
1532 a remote changeset intended to be added
1533
1534 -B, --bookmark
1535 bookmark to pull
1536
1537 -b, --branch
1538 a specific branch you would like to pull
1539
1540 -e, --ssh
1541 specify ssh command to use
1542
1543 --remotecmd
1544 specify hg command to run on the remote side
1545
1546 --insecure
1547 do not verify server certificate (ignoring web.cacerts config)
1548
1549 push
1550 hg push [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]
1551
1552 Push changesets from the local repository to the specified destination.
1553
1554 This operation is symmetrical to pull: it is identical to a pull in the
1555 destination repository from the current one.
1556
1557 By default, push will not allow creation of new heads at the destina‐
1558 tion, since multiple heads would make it unclear which head to use. In
1559 this situation, it is recommended to pull and merge before pushing.
1560
1561 Use --new-branch if you want to allow push to create a new named branch
1562 that is not present at the destination. This allows you to only create
1563 a new branch without forcing other changes.
1564
1565 Use -f/--force to override the default behavior and push all changesets
1566 on all branches.
1567
1568 If -r/--rev is used, the specified revision and all its ancestors will
1569 be pushed to the remote repository.
1570
1571 Please see hg help urls for important details about ssh:// URLs. If
1572 DESTINATION is omitted, a default path will be used.
1573
1574 Returns 0 if push was successful, 1 if nothing to push.
1575
1576 Options:
1577
1578 -f, --force
1579 force push
1580
1581 -r, --rev
1582 a changeset intended to be included in the destination
1583
1584 -B, --bookmark
1585 bookmark to push
1586
1587 -b, --branch
1588 a specific branch you would like to push
1589
1590 --new-branch
1591 allow pushing a new branch
1592
1593 -e, --ssh
1594 specify ssh command to use
1595
1596 --remotecmd
1597 specify hg command to run on the remote side
1598
1599 --insecure
1600 do not verify server certificate (ignoring web.cacerts config)
1601
1602 recover
1603 hg recover
1604
1605 Recover from an interrupted commit or pull.
1606
1607 This command tries to fix the repository status after an interrupted
1608 operation. It should only be necessary when Mercurial suggests it.
1609
1610 Returns 0 if successful, 1 if nothing to recover or verify fails.
1611
1612 remove
1613 hg remove [OPTION]... FILE...
1614
1615 Schedule the indicated files for removal from the repository.
1616
1617 This only removes files from the current branch, not from the entire
1618 project history. -A/--after can be used to remove only files that have
1619 already been deleted, -f/--force can be used to force deletion, and -Af
1620 can be used to remove files from the next revision without deleting
1621 them from the working directory.
1622
1623 The following table details the behavior of remove for different file
1624 states (columns) and option combinations (rows). The file states are
1625 Added [A], Clean [C], Modified [M] and Missing [!] (as reported by hg
1626 status). The actions are Warn, Remove (from branch) and Delete (from
1627 disk):
1628
1629 A C M !
1630 none W RD W R
1631 -f R RD RD R
1632 -A W W W R
1633 -Af R R R R
1634
1635 This command schedules the files to be removed at the next commit. To
1636 undo a remove before that, see hg revert.
1637
1638 Returns 0 on success, 1 if any warnings encountered.
1639
1640 Options:
1641
1642 -A, --after
1643 record delete for missing files
1644
1645 -f, --force
1646 remove (and delete) file even if added or modified
1647
1648 -I, --include
1649 include names matching the given patterns
1650
1651 -X, --exclude
1652 exclude names matching the given patterns
1653
1654 aliases: rm
1655
1656 rename
1657 hg rename [OPTION]... SOURCE... DEST
1658
1659 Mark dest as copies of sources; mark sources for deletion. If dest is a
1660 directory, copies are put in that directory. If dest is a file, there
1661 can only be one source.
1662
1663 By default, this command copies the contents of files as they exist in
1664 the working directory. If invoked with -A/--after, the operation is
1665 recorded, but no copying is performed.
1666
1667 This command takes effect at the next commit. To undo a rename before
1668 that, see hg revert.
1669
1670 Returns 0 on success, 1 if errors are encountered.
1671
1672 Options:
1673
1674 -A, --after
1675 record a rename that has already occurred
1676
1677 -f, --force
1678 forcibly copy over an existing managed file
1679
1680 -I, --include
1681 include names matching the given patterns
1682
1683 -X, --exclude
1684 exclude names matching the given patterns
1685
1686 -n, --dry-run
1687 do not perform actions, just print output
1688
1689 aliases: move mv
1690
1691 resolve
1692 hg resolve [OPTION]... [FILE]...
1693
1694 Merges with unresolved conflicts are often the result of non-interac‐
1695 tive merging using the internal:merge configuration setting, or a com‐
1696 mand-line merge tool like diff3. The resolve command is used to manage
1697 the files involved in a merge, after hg merge has been run, and before
1698 hg commit is run (i.e. the working directory must have two parents).
1699
1700 The resolve command can be used in the following ways:
1701
1702 · hg resolve [--tool TOOL] FILE...: attempt to re-merge the specified
1703 files, discarding any previous merge attempts. Re-merging is not per‐
1704 formed for files already marked as resolved. Use --all/-a to selects
1705 all unresolved files. --tool can be used to specify the merge tool
1706 used for the given files. It overrides the HGMERGE environment vari‐
1707 able and your configuration files.
1708
1709 · hg resolve -m [FILE]: mark a file as having been resolved (e.g. after
1710 having manually fixed-up the files). The default is to mark all unre‐
1711 solved files.
1712
1713 · hg resolve -u [FILE]...: mark a file as unresolved. The default is to
1714 mark all resolved files.
1715
1716 · hg resolve -l: list files which had or still have conflicts. In the
1717 printed list, U = unresolved and R = resolved.
1718
1719 Note that Mercurial will not let you commit files with unresolved merge
1720 conflicts. You must use hg resolve -m ... before you can commit after a
1721 conflicting merge.
1722
1723 Returns 0 on success, 1 if any files fail a resolve attempt.
1724
1725 Options:
1726
1727 -a, --all
1728 select all unresolved files
1729
1730 -l, --list
1731 list state of files needing merge
1732
1733 -m, --mark
1734 mark files as resolved
1735
1736 -u, --unmark
1737 mark files as unresolved
1738
1739 -t, --tool
1740 specify merge tool
1741
1742 -n, --no-status
1743 hide status prefix
1744
1745 -I, --include
1746 include names matching the given patterns
1747
1748 -X, --exclude
1749 exclude names matching the given patterns
1750
1751 revert
1752 hg revert [OPTION]... [-r REV] [NAME]...
1753
1754 Note This command is most likely not what you are looking for.
1755 Revert will partially overwrite content in the working directory
1756 without changing the working directory parents. Use hg update -r
1757 rev to check out earlier revisions, or hg update --clean . to
1758 undo a merge which has added another parent.
1759
1760 With no revision specified, revert the named files or directories to
1761 the contents they had in the parent of the working directory. This
1762 restores the contents of the affected files to an unmodified state and
1763 unschedules adds, removes, copies, and renames. If the working direc‐
1764 tory has two parents, you must explicitly specify a revision.
1765
1766 Using the -r/--rev option, revert the given files or directories to
1767 their contents as of a specific revision. This can be helpful to "roll
1768 back" some or all of an earlier change. See hg help dates for a list of
1769 formats valid for -d/--date.
1770
1771 Revert modifies the working directory. It does not commit any changes,
1772 or change the parent of the working directory. If you revert to a revi‐
1773 sion other than the parent of the working directory, the reverted files
1774 will thus appear modified afterwards.
1775
1776 If a file has been deleted, it is restored. If the executable mode of a
1777 file was changed, it is reset.
1778
1779 If names are given, all files matching the names are reverted. If no
1780 arguments are given, no files are reverted.
1781
1782 Modified files are saved with a .orig suffix before reverting. To dis‐
1783 able these backups, use --no-backup.
1784
1785 Returns 0 on success.
1786
1787 Options:
1788
1789 -a, --all
1790 revert all changes when no arguments given
1791
1792 -d, --date
1793 tipmost revision matching date
1794
1795 -r, --rev
1796 revert to the specified revision
1797
1798 --no-backup
1799 do not save backup copies of files
1800
1801 -I, --include
1802 include names matching the given patterns
1803
1804 -X, --exclude
1805 exclude names matching the given patterns
1806
1807 -n, --dry-run
1808 do not perform actions, just print output
1809
1810 rollback
1811 hg rollback
1812
1813 This command should be used with care. There is only one level of roll‐
1814 back, and there is no way to undo a rollback. It will also restore the
1815 dirstate at the time of the last transaction, losing any dirstate
1816 changes since that time. This command does not alter the working direc‐
1817 tory.
1818
1819 Transactions are used to encapsulate the effects of all commands that
1820 create new changesets or propagate existing changesets into a reposi‐
1821 tory. For example, the following commands are transactional, and their
1822 effects can be rolled back:
1823
1824 · commit
1825
1826 · import
1827
1828 · pull
1829
1830 · push (with this repository as the destination)
1831
1832 · unbundle
1833
1834 This command is not intended for use on public repositories. Once
1835 changes are visible for pull by other users, rolling a transaction back
1836 locally is ineffective (someone else may already have pulled the
1837 changes). Furthermore, a race is possible with readers of the reposi‐
1838 tory; for example an in-progress pull from the repository may fail if a
1839 rollback is performed.
1840
1841 Returns 0 on success, 1 if no rollback data is available.
1842
1843 Options:
1844
1845 -n, --dry-run
1846 do not perform actions, just print output
1847
1848 root
1849 hg root
1850
1851 Print the root directory of the current repository.
1852
1853 Returns 0 on success.
1854
1855 serve
1856 hg serve [OPTION]...
1857
1858 Start a local HTTP repository browser and pull server. You can use this
1859 for ad-hoc sharing and browsing of repositories. It is recommended to
1860 use a real web server to serve a repository for longer periods of time.
1861
1862 Please note that the server does not implement access control. This
1863 means that, by default, anybody can read from the server and nobody can
1864 write to it by default. Set the web.allow_push option to * to allow
1865 everybody to push to the server. You should use a real web server if
1866 you need to authenticate users.
1867
1868 By default, the server logs accesses to stdout and errors to stderr.
1869 Use the -A/--accesslog and -E/--errorlog options to log to files.
1870
1871 To have the server choose a free port number to listen on, specify a
1872 port number of 0; in this case, the server will print the port number
1873 it uses.
1874
1875 Returns 0 on success.
1876
1877 Options:
1878
1879 -A, --accesslog
1880 name of access log file to write to
1881
1882 -d, --daemon
1883 run server in background
1884
1885 --daemon-pipefds
1886 used internally by daemon mode
1887
1888 -E, --errorlog
1889 name of error log file to write to
1890
1891 -p, --port
1892 port to listen on (default: 8000)
1893
1894 -a, --address
1895 address to listen on (default: all interfaces)
1896
1897 --prefix
1898 prefix path to serve from (default: server root)
1899
1900 -n, --name
1901 name to show in web pages (default: working directory)
1902
1903 --web-conf
1904 name of the hgweb config file (see "hg help hgweb")
1905
1906 --webdir-conf
1907 name of the hgweb config file (DEPRECATED)
1908
1909 --pid-file
1910 name of file to write process ID to
1911
1912 --stdio
1913 for remote clients
1914
1915 -t, --templates
1916 web templates to use
1917
1918 --style
1919 template style to use
1920
1921 -6, --ipv6
1922 use IPv6 in addition to IPv4
1923
1924 --certificate
1925 SSL certificate file
1926
1927 showconfig
1928 hg showconfig [-u] [NAME]...
1929
1930 With no arguments, print names and values of all config items.
1931
1932 With one argument of the form section.name, print just the value of
1933 that config item.
1934
1935 With multiple arguments, print names and values of all config items
1936 with matching section names.
1937
1938 With --debug, the source (filename and line number) is printed for each
1939 config item.
1940
1941 Returns 0 on success.
1942
1943 Options:
1944
1945 -u, --untrusted
1946 show untrusted configuration options
1947
1948 aliases: debugconfig
1949
1950 status
1951 hg status [OPTION]... [FILE]...
1952
1953 Show status of files in the repository. If names are given, only files
1954 that match are shown. Files that are clean or ignored or the source of
1955 a copy/move operation, are not listed unless -c/--clean, -i/--ignored,
1956 -C/--copies or -A/--all are given. Unless options described with "show
1957 only ..." are given, the options -mardu are used.
1958
1959 Option -q/--quiet hides untracked (unknown and ignored) files unless
1960 explicitly requested with -u/--unknown or -i/--ignored.
1961
1962 Note status may appear to disagree with diff if permissions have
1963 changed or a merge has occurred. The standard diff format does
1964 not report permission changes and diff only reports changes rel‐
1965 ative to one merge parent.
1966
1967 If one revision is given, it is used as the base revision. If two
1968 revisions are given, the differences between them are shown. The
1969 --change option can also be used as a shortcut to list the changed
1970 files of a revision from its first parent.
1971
1972 The codes used to show the status of files are:
1973
1974 M = modified
1975 A = added
1976 R = removed
1977 C = clean
1978 ! = missing (deleted by non-hg command, but still tracked)
1979 ? = not tracked
1980 I = ignored
1981 = origin of the previous file listed as A (added)
1982
1983 Returns 0 on success.
1984
1985 Options:
1986
1987 -A, --all
1988 show status of all files
1989
1990 -m, --modified
1991 show only modified files
1992
1993 -a, --added
1994 show only added files
1995
1996 -r, --removed
1997 show only removed files
1998
1999 -d, --deleted
2000 show only deleted (but tracked) files
2001
2002 -c, --clean
2003 show only files without changes
2004
2005 -u, --unknown
2006 show only unknown (not tracked) files
2007
2008 -i, --ignored
2009 show only ignored files
2010
2011 -n, --no-status
2012 hide status prefix
2013
2014 -C, --copies
2015 show source of copied files
2016
2017 -0, --print0
2018 end filenames with NUL, for use with xargs
2019
2020 --rev show difference from revision
2021
2022 --change
2023 list the changed files of a revision
2024
2025 -I, --include
2026 include names matching the given patterns
2027
2028 -X, --exclude
2029 exclude names matching the given patterns
2030
2031 -S, --subrepos
2032 recurse into subrepositories
2033
2034 aliases: st
2035
2036 summary
2037 hg summary [--remote]
2038
2039 This generates a brief summary of the working directory state, includ‐
2040 ing parents, branch, commit status, and available updates.
2041
2042 With the --remote option, this will check the default paths for incom‐
2043 ing and outgoing changes. This can be time-consuming.
2044
2045 Returns 0 on success.
2046
2047 Options:
2048
2049 --remote
2050 check for push and pull
2051
2052 aliases: sum
2053
2054 tag
2055 hg tag [-f] [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME...
2056
2057 Name a particular revision using <name>.
2058
2059 Tags are used to name particular revisions of the repository and are
2060 very useful to compare different revisions, to go back to significant
2061 earlier versions or to mark branch points as releases, etc. Changing an
2062 existing tag is normally disallowed; use -f/--force to override.
2063
2064 If no revision is given, the parent of the working directory is used,
2065 or tip if no revision is checked out.
2066
2067 To facilitate version control, distribution, and merging of tags, they
2068 are stored as a file named ".hgtags" which is managed similarly to
2069 other project files and can be hand-edited if necessary. This also
2070 means that tagging creates a new commit. The file ".hg/localtags" is
2071 used for local tags (not shared among repositories).
2072
2073 Tag commits are usually made at the head of a branch. If the parent of
2074 the working directory is not a branch head, hg tag aborts; use
2075 -f/--force to force the tag commit to be based on a non-head changeset.
2076
2077 See hg help dates for a list of formats valid for -d/--date.
2078
2079 Since tag names have priority over branch names during revision lookup,
2080 using an existing branch name as a tag name is discouraged.
2081
2082 Returns 0 on success.
2083
2084 Options:
2085
2086 -f, --force
2087 force tag
2088
2089 -l, --local
2090 make the tag local
2091
2092 -r, --rev
2093 revision to tag
2094
2095 --remove
2096 remove a tag
2097
2098 -e, --edit
2099 edit commit message
2100
2101 -m, --message
2102 use <text> as commit message
2103
2104 -d, --date
2105 record the specified date as commit date
2106
2107 -u, --user
2108 record the specified user as committer
2109
2110 tags
2111 hg tags
2112
2113 This lists both regular and local tags. When the -v/--verbose switch is
2114 used, a third column "local" is printed for local tags.
2115
2116 Returns 0 on success.
2117
2118 tip
2119 hg tip [-p] [-g]
2120
2121 The tip revision (usually just called the tip) is the changeset most
2122 recently added to the repository (and therefore the most recently
2123 changed head).
2124
2125 If you have just made a commit, that commit will be the tip. If you
2126 have just pulled changes from another repository, the tip of that
2127 repository becomes the current tip. The "tip" tag is special and cannot
2128 be renamed or assigned to a different changeset.
2129
2130 Returns 0 on success.
2131
2132 Options:
2133
2134 -p, --patch
2135 show patch
2136
2137 -g, --git
2138 use git extended diff format
2139
2140 --style
2141 display using template map file
2142
2143 --template
2144 display with template
2145
2146 unbundle
2147 hg unbundle [-u] FILE...
2148
2149 Apply one or more compressed changegroup files generated by the bundle
2150 command.
2151
2152 Returns 0 on success, 1 if an update has unresolved files.
2153
2154 Options:
2155
2156 -u, --update
2157 update to new branch head if changesets were unbundled
2158
2159 update
2160 hg update [-c] [-C] [-d DATE] [[-r] REV]
2161
2162 Update the repository's working directory to the specified changeset.
2163 If no changeset is specified, update to the tip of the current named
2164 branch.
2165
2166 If the changeset is not a descendant of the working directory's parent,
2167 the update is aborted. With the -c/--check option, the working direc‐
2168 tory is checked for uncommitted changes; if none are found, the working
2169 directory is updated to the specified changeset.
2170
2171 The following rules apply when the working directory contains uncommit‐
2172 ted changes:
2173
2174 1. If neither -c/--check nor -C/--clean is specified, and if the
2175 requested changeset is an ancestor or descendant of the working
2176 directory's parent, the uncommitted changes are merged into the
2177 requested changeset and the merged result is left uncommitted. If
2178 the requested changeset is not an ancestor or descendant (that is,
2179 it is on another branch), the update is aborted and the uncommitted
2180 changes are preserved.
2181
2182 2. With the -c/--check option, the update is aborted and the uncommit‐
2183 ted changes are preserved.
2184
2185 3. With the -C/--clean option, uncommitted changes are discarded and
2186 the working directory is updated to the requested changeset.
2187
2188 Use null as the changeset to remove the working directory (like hg
2189 clone -U).
2190
2191 If you want to update just one file to an older changeset, use hg
2192 revert.
2193
2194 See hg help dates for a list of formats valid for -d/--date.
2195
2196 Returns 0 on success, 1 if there are unresolved files.
2197
2198 Options:
2199
2200 -C, --clean
2201 discard uncommitted changes (no backup)
2202
2203 -c, --check
2204 update across branches if no uncommitted changes
2205
2206 -d, --date
2207 tipmost revision matching date
2208
2209 -r, --rev
2210 revision
2211
2212 aliases: up checkout co
2213
2214 verify
2215 hg verify
2216
2217 Verify the integrity of the current repository.
2218
2219 This will perform an extensive check of the repository's integrity,
2220 validating the hashes and checksums of each entry in the changelog,
2221 manifest, and tracked files, as well as the integrity of their
2222 crosslinks and indices.
2223
2224 Returns 0 on success, 1 if errors are encountered.
2225
2226 version
2227 hg version
2228
2229 output version and copyright information
2230
2232 Mercurial reads configuration data from several files, if they exist.
2233 Below we list the most specific file first.
2234
2235 On Windows, these configuration files are read:
2236
2237 · <repo>\.hg\hgrc
2238
2239 · %USERPROFILE%\.hgrc
2240
2241 · %USERPROFILE%\mercurial.ini
2242
2243 · %HOME%\.hgrc
2244
2245 · %HOME%\mercurial.ini
2246
2247 · C:\mercurial\mercurial.ini (unless regkey or hgrc.dor mercurial.ini
2248 found)
2249
2250 · HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial (unless hgrc.dor mercurial.ini
2251 found)
2252
2253 · <hg.exe-dir>\hgrc.d\*.rc (unless mercurial.ini found)
2254
2255 · <hg.exe-dir>\mercurial.ini
2256
2257 On Unix, these files are read:
2258
2259 · <repo>/.hg/hgrc
2260
2261 · $HOME/.hgrc
2262
2263 · /etc/mercurial/hgrc
2264
2265 · /etc/mercurial/hgrc.d/*.rc
2266
2267 · <install-root>/etc/mercurial/hgrc
2268
2269 · <install-root>/etc/mercurial/hgrc.d/*.rc
2270
2271 These files do not exist by default and you will have to create the
2272 appropriate configuration files yourself: global configuration like the
2273 username setting is typically put into %USERPROFILE%\mercurial.ini or
2274 $HOME/.hgrc and local configuration is put into the per-repository
2275 <repo>/.hg/hgrc file.
2276
2277 If there is a per-repository configuration file which is not owned by
2278 the active user, Mercurial will warn you that the file is skipped:
2279
2280 not trusting file <repo>/.hg/hgrc from untrusted user USER, group GROUP
2281
2282 If this bothers you, the warning can be silenced (the file would still
2283 be ignored) or trust can be established. Use one of the following set‐
2284 tings, the syntax is explained below:
2285
2286 · ui.report_untrusted = False
2287
2288 · trusted.users = USER
2289
2290 · trusted.groups = GROUP
2291
2292 The configuration files for Mercurial use a simple ini-file format. A
2293 configuration file consists of sections, led by a [section] header and
2294 followed by name = value entries:
2295
2296 [ui]
2297 username = Firstname Lastname <firstname.lastname@example.net>
2298 verbose = True
2299
2300 The above entries will be referred to as ui.username and ui.verbose,
2301 respectively. Please see the hgrc man page for a full description of
2302 the possible configuration values:
2303
2304 · on Unix-like systems: man hgrc
2305
2306 · online: http://www.selenic.com/mercurial/hgrc.5.html
2307
2309 Some commands allow the user to specify a date, e.g.:
2310
2311 · backout, commit, import, tag: Specify the commit date.
2312
2313 · log, revert, update: Select revision(s) by date.
2314
2315 Many date formats are valid. Here are some examples:
2316
2317 · Wed Dec 6 13:18:29 2006 (local timezone assumed)
2318
2319 · Dec 6 13:18 -0600 (year assumed, time offset provided)
2320
2321 · Dec 6 13:18 UTC (UTC and GMT are aliases for +0000)
2322
2323 · Dec 6 (midnight)
2324
2325 · 13:18 (today assumed)
2326
2327 · 3:39 (3:39AM assumed)
2328
2329 · 3:39pm (15:39)
2330
2331 · 2006-12-06 13:18:29 (ISO 8601 format)
2332
2333 · 2006-12-6 13:18
2334
2335 · 2006-12-6
2336
2337 · 12-6
2338
2339 · 12/6
2340
2341 · 12/6/6 (Dec 6 2006)
2342
2343 Lastly, there is Mercurial's internal format:
2344
2345 · 1165432709 0 (Wed Dec 6 13:18:29 2006 UTC)
2346
2347 This is the internal representation format for dates. The first number
2348 is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
2349 second is the offset of the local timezone, in seconds west of UTC
2350 (negative if the timezone is east of UTC).
2351
2352 The log command also accepts date ranges:
2353
2354 · <{datetime} - at or before a given date/time
2355
2356 · >{datetime} - on or after a given date/time
2357
2358 · {datetime} to {datetime} - a date range, inclusive
2359
2360 · -{days} - within a given number of days of today
2361
2363 Mercurial accepts several notations for identifying one or more files
2364 at a time.
2365
2366 By default, Mercurial treats filenames as shell-style extended glob
2367 patterns.
2368
2369 Alternate pattern notations must be specified explicitly.
2370
2371 To use a plain path name without any pattern matching, start it with
2372 path:. These path names must completely match starting at the current
2373 repository root.
2374
2375 To use an extended glob, start a name with glob:. Globs are rooted at
2376 the current directory; a glob such as *.c will only match files in the
2377 current directory ending with .c.
2378
2379 The supported glob syntax extensions are ** to match any string across
2380 path separators and {a,b} to mean "a or b".
2381
2382 To use a Perl/Python regular expression, start a name with re:. Regexp
2383 pattern matching is anchored at the root of the repository.
2384
2385 To read name patterns from a file, use listfile: or listfile0:. The
2386 latter expects null delimited patterns while the former expects line
2387 feeds. Each string read from the file is itself treated as a file pat‐
2388 tern.
2389
2390 Plain examples:
2391
2392 path:foo/bar a name bar in a directory named foo in the root
2393 of the repository
2394 path:path:name a file or directory named "path:name"
2395
2396 Glob examples:
2397
2398 glob:*.c any name ending in ".c" in the current directory
2399 *.c any name ending in ".c" in the current directory
2400 **.c any name ending in ".c" in any subdirectory of the
2401 current directory including itself.
2402 foo/*.c any name ending in ".c" in the directory foo
2403 foo/**.c any name ending in ".c" in any subdirectory of foo
2404 including itself.
2405
2406 Regexp examples:
2407
2408 re:.*\.c$ any name ending in ".c", anywhere in the repository
2409
2410 File examples:
2411
2412 listfile:list.txt read list from list.txt with one file pattern per line
2413 listfile0:list.txt read list from list.txt with null byte delimiters
2414
2416 HG Path to the 'hg' executable, automatically passed when running
2417 hooks, extensions or external tools. If unset or empty, this is
2418 the hg executable's name if it's frozen, or an executable named
2419 'hg' (with %PATHEXT% [defaulting to COM/EXE/BAT/CMD] extensions
2420 on Windows) is searched.
2421
2422 HGEDITOR
2423 This is the name of the editor to run when committing. See EDI‐
2424 TOR.
2425
2426 (deprecated, use configuration file)
2427
2428 HGENCODING
2429 This overrides the default locale setting detected by Mercurial.
2430 This setting is used to convert data including usernames,
2431 changeset descriptions, tag names, and branches. This setting
2432 can be overridden with the --encoding command-line option.
2433
2434 HGENCODINGMODE
2435 This sets Mercurial's behavior for handling unknown characters
2436 while transcoding user input. The default is "strict", which
2437 causes Mercurial to abort if it can't map a character. Other
2438 settings include "replace", which replaces unknown characters,
2439 and "ignore", which drops them. This setting can be overridden
2440 with the --encodingmode command-line option.
2441
2442 HGENCODINGAMBIGUOUS
2443 This sets Mercurial's behavior for handling characters with
2444 "ambiguous" widths like accented Latin characters with East
2445 Asian fonts. By default, Mercurial assumes ambiguous characters
2446 are narrow, set this variable to "wide" if such characters cause
2447 formatting problems.
2448
2449 HGMERGE
2450 An executable to use for resolving merge conflicts. The program
2451 will be executed with three arguments: local file, remote file,
2452 ancestor file.
2453
2454 (deprecated, use configuration file)
2455
2456 HGRCPATH
2457 A list of files or directories to search for configuration
2458 files. Item separator is ":" on Unix, ";" on Windows. If HGRC‐
2459 PATH is not set, platform default search path is used. If empty,
2460 only the .hg/hgrc from the current repository is read.
2461
2462 For each element in HGRCPATH:
2463
2464 · if it's a directory, all files ending with .rc are added
2465
2466 · otherwise, the file itself will be added
2467
2468 HGPLAIN
2469 When set, this disables any configuration settings that might
2470 change Mercurial's default output. This includes encoding,
2471 defaults, verbose mode, debug mode, quiet mode, tracebacks, and
2472 localization. This can be useful when scripting against Mercu‐
2473 rial in the face of existing user configuration.
2474
2475 Equivalent options set via command line flags or environment
2476 variables are not overridden.
2477
2478 HGUSER This is the string used as the author of a commit. If not set,
2479 available values will be considered in this order:
2480
2481 · HGUSER (deprecated)
2482
2483 · configuration files from the HGRCPATH
2484
2485 · EMAIL
2486
2487 · interactive prompt
2488
2489 · LOGNAME (with @hostname appended)
2490
2491 (deprecated, use configuration file)
2492
2493 EMAIL May be used as the author of a commit; see HGUSER.
2494
2495 LOGNAME
2496 May be used as the author of a commit; see HGUSER.
2497
2498 VISUAL This is the name of the editor to use when committing. See EDI‐
2499 TOR.
2500
2501 EDITOR Sometimes Mercurial needs to open a text file in an editor for a
2502 user to modify, for example when writing commit messages. The
2503 editor it uses is determined by looking at the environment vari‐
2504 ables HGEDITOR, VISUAL and EDITOR, in that order. The first
2505 non-empty one is chosen. If all of them are empty, the editor
2506 defaults to 'vi'.
2507
2508 PYTHONPATH
2509 This is used by Python to find imported modules and may need to
2510 be set appropriately if this Mercurial is not installed sys‐
2511 tem-wide.
2512
2514 Mercurial supports several ways to specify individual revisions.
2515
2516 A plain integer is treated as a revision number. Negative integers are
2517 treated as sequential offsets from the tip, with -1 denoting the tip,
2518 -2 denoting the revision prior to the tip, and so forth.
2519
2520 A 40-digit hexadecimal string is treated as a unique revision identi‐
2521 fier.
2522
2523 A hexadecimal string less than 40 characters long is treated as a
2524 unique revision identifier and is referred to as a short-form identi‐
2525 fier. A short-form identifier is only valid if it is the prefix of
2526 exactly one full-length identifier.
2527
2528 Any other string is treated as a tag or branch name. A tag name is a
2529 symbolic name associated with a revision identifier. A branch name
2530 denotes the tipmost revision of that branch. Tag and branch names must
2531 not contain the ":" character.
2532
2533 The reserved name "tip" is a special tag that always identifies the
2534 most recent revision.
2535
2536 The reserved name "null" indicates the null revision. This is the revi‐
2537 sion of an empty repository, and the parent of revision 0.
2538
2539 The reserved name "." indicates the working directory parent. If no
2540 working directory is checked out, it is equivalent to null. If an
2541 uncommitted merge is in progress, "." is the revision of the first par‐
2542 ent.
2543
2545 When Mercurial accepts more than one revision, they may be specified
2546 individually, or provided as a topologically continuous range, sepa‐
2547 rated by the ":" character.
2548
2549 The syntax of range notation is [BEGIN]:[END], where BEGIN and END are
2550 revision identifiers. Both BEGIN and END are optional. If BEGIN is not
2551 specified, it defaults to revision number 0. If END is not specified,
2552 it defaults to the tip. The range ":" thus means "all revisions".
2553
2554 If BEGIN is greater than END, revisions are treated in reverse order.
2555
2556 A range acts as a closed interval. This means that a range of 3:5 gives
2557 3, 4 and 5. Similarly, a range of 9:6 gives 9, 8, 7, and 6.
2558
2560 Mercurial supports a functional language for selecting a set of revi‐
2561 sions.
2562
2563 The language supports a number of predicates which are joined by infix
2564 operators. Parenthesis can be used for grouping.
2565
2566 Identifiers such as branch names must be quoted with single or double
2567 quotes if they contain characters outside of [._a-zA-Z0-9\x80-\xff] or
2568 if they match one of the predefined predicates.
2569
2570 Special characters can be used in quoted identifiers by escaping them,
2571 e.g., \n is interpreted as a newline. To prevent them from being inter‐
2572 preted, strings can be prefixed with r, e.g. r'...'.
2573
2574 There is a single prefix operator:
2575
2576 not x
2577
2578 Changesets not in x. Short form is ! x.
2579
2580 These are the supported infix operators:
2581
2582 x::y
2583
2584 A DAG range, meaning all changesets that are descendants of x
2585 and ancestors of y, including x and y themselves. If the first
2586 endpoint is left out, this is equivalent to ancestors(y), if the
2587 second is left out it is equivalent to descendants(x).
2588
2589 An alternative syntax is x..y.
2590
2591 x:y
2592
2593 All changesets with revision numbers between x and y, both
2594 inclusive. Either endpoint can be left out, they default to 0
2595 and tip.
2596
2597 x and y
2598
2599 The intersection of changesets in x and y. Short form is x & y.
2600
2601 x or y
2602
2603 The union of changesets in x and y. There are two alternative
2604 short forms: x | y and x + y.
2605
2606 x - y
2607
2608 Changesets in x but not in y.
2609
2610 The following predicates are supported:
2611
2612 Command line equivalents for hg log:
2613
2614 -f -> ::.
2615 -d x -> date(x)
2616 -k x -> keyword(x)
2617 -m -> merge()
2618 -u x -> user(x)
2619 -b x -> branch(x)
2620 -P x -> !::x
2621 -l x -> limit(expr, x)
2622
2623 Some sample queries:
2624
2625 · Changesets on the default branch:
2626
2627 hg log -r "branch(default)"
2628
2629 · Changesets on the default branch since tag 1.5 (excluding merges):
2630
2631 hg log -r "branch(default) and 1.5:: and not merge()"
2632
2633 · Open branch heads:
2634
2635 hg log -r "head() and not closed()"
2636
2637 · Changesets between tags 1.3 and 1.5 mentioning "bug" that affect
2638 hgext/*:
2639
2640 hg log -r "1.3::1.5 and keyword(bug) and file('hgext/*')"
2641
2642 · Changesets committed in May 2008, sorted by user:
2643
2644 hg log -r "sort(date('May 2008'), user)"
2645
2646 · Changesets mentioning "bug" or "issue" that are not in a tagged
2647 release:
2648
2649 hg log -r "(keyword(bug) or keyword(issue)) and not ancestors(tagged())"
2650
2652 Mercurial's default format for showing changes between two versions of
2653 a file is compatible with the unified format of GNU diff, which can be
2654 used by GNU patch and many other standard tools.
2655
2656 While this standard format is often enough, it does not encode the fol‐
2657 lowing information:
2658
2659 · executable status and other permission bits
2660
2661 · copy or rename information
2662
2663 · changes in binary files
2664
2665 · creation or deletion of empty files
2666
2667 Mercurial also supports the extended diff format from the git VCS which
2668 addresses these limitations. The git diff format is not produced by
2669 default because a few widespread tools still do not understand this
2670 format.
2671
2672 This means that when generating diffs from a Mercurial repository (e.g.
2673 with hg export), you should be careful about things like file copies
2674 and renames or other things mentioned above, because when applying a
2675 standard diff to a different repository, this extra information is
2676 lost. Mercurial's internal operations (like push and pull) are not
2677 affected by this, because they use an internal binary format for commu‐
2678 nicating changes.
2679
2680 To make Mercurial produce the git extended diff format, use the --git
2681 option available for many commands, or set 'git = True' in the [diff]
2682 section of your configuration file. You do not need to set this option
2683 when importing diffs in this format or using them in the mq extension.
2684
2686 To merge files Mercurial uses merge tools.
2687
2688 A merge tool combines two different versions of a file into a merged
2689 file. Merge tools are given the two files and the greatest common
2690 ancestor of the two file versions, so they can determine the changes
2691 made on both branches.
2692
2693 Merge tools are used both for hg resolve, hg merge, hg update, hg back‐
2694 out and in several extensions.
2695
2696 Usually, the merge tool tries to automatically reconcile the files by
2697 combining all non-overlapping changes that occurred separately in the
2698 two different evolutions of the same initial base file. Furthermore,
2699 some interactive merge programs make it easier to manually resolve con‐
2700 flicting merges, either in a graphical way, or by inserting some con‐
2701 flict markers. Mercurial does not include any interactive merge pro‐
2702 grams but relies on external tools for that.
2703
2704 Available merge tools
2705 External merge tools and their properties are configured in the
2706 merge-tools configuration section - see hgrc(5) - but they can often
2707 just be named by their executable.
2708
2709 A merge tool is generally usable if its executable can be found on the
2710 system and if it can handle the merge. The executable is found if it is
2711 an absolute or relative executable path or the name of an application
2712 in the executable search path. The tool is assumed to be able to handle
2713 the merge if it can handle symlinks if the file is a symlink, if it can
2714 handle binary files if the file is binary, and if a GUI is available if
2715 the tool requires a GUI.
2716
2717 There are some internal merge tools which can be used. The internal
2718 merge tools are:
2719
2720 internal:merge
2721
2722 Uses the internal non-interactive simple merge algorithm for
2723 merging files. It will fail if there are any conflicts and leave
2724 markers in the partially merged file.
2725
2726 internal:fail
2727
2728 Rather than attempting to merge files that were modified on both
2729 branches, it marks them as unresolved. The resolve command must
2730 be used to resolve these conflicts.
2731
2732 internal:local
2733
2734 Uses the local version of files as the merged version.
2735
2736 internal:other
2737
2738 Uses the other version of files as the merged version.
2739
2740 internal:prompt
2741
2742 Asks the user which of the local or the other version to keep as
2743 the merged version.
2744
2745 internal:dump
2746
2747 Creates three versions of the files to merge, containing the
2748 contents of local, other and base. These files can then be used
2749 to perform a merge manually. If the file to be merged is named
2750 a.txt, these files will accordingly be named a.txt.local,
2751 a.txt.other and a.txt.base and they will be placed in the same
2752 directory as a.txt.
2753
2754 Internal tools are always available and do not require a GUI but will
2755 by default not handle symlinks or binary files.
2756
2757 Choosing a merge tool
2758 Mercurial uses these rules when deciding which merge tool to use:
2759
2760 1. If a tool has been specified with the --tool option to merge or
2761 resolve, it is used. If it is the name of a tool in the merge-tools
2762 configuration, its configuration is used. Otherwise the specified
2763 tool must be executable by the shell.
2764
2765 2. If the HGMERGE environment variable is present, its value is used
2766 and must be executable by the shell.
2767
2768 3. If the filename of the file to be merged matches any of the patterns
2769 in the merge-patterns configuration section, the first usable merge
2770 tool corresponding to a matching pattern is used. Here, binary capa‐
2771 bilities of the merge tool are not considered.
2772
2773 4. If ui.merge is set it will be considered next. If the value is not
2774 the name of a configured tool, the specified value is used and must
2775 be executable by the shell. Otherwise the named tool is used if it
2776 is usable.
2777
2778 5. If any usable merge tools are present in the merge-tools configura‐
2779 tion section, the one with the highest priority is used.
2780
2781 6. If a program named hgmerge can be found on the system, it is used -
2782 but it will by default not be used for symlinks and binary files.
2783
2784 7. If the file to be merged is not binary and is not a symlink, then
2785 internal:merge is used.
2786
2787 8. The merge of the file fails and must be resolved before commit.
2788
2789 Note After selecting a merge program, Mercurial will by default
2790 attempt to merge the files using a simple merge algorithm first.
2791 Only if it doesn't succeed because of conflicting changes Mercu‐
2792 rial will actually execute the merge program. Whether to use the
2793 simple merge algorithm first can be controlled by the premerge
2794 setting of the merge tool. Premerge is enabled by default unless
2795 the file is binary or a symlink.
2796
2797 See the merge-tools and ui sections of hgrc(5) for details on the con‐
2798 figuration of merge tools.
2799
2801 Mercurial allows you to customize output of commands through templates.
2802 You can either pass in a template from the command line, via the --tem‐
2803 plate option, or select an existing template-style (--style).
2804
2805 You can customize output for any "log-like" command: log, outgoing,
2806 incoming, tip, parents, heads and glog.
2807
2808 Four styles are packaged with Mercurial: default (the style used when
2809 no explicit preference is passed), compact, changelog, and xml. Usage:
2810
2811 $ hg log -r1 --style changelog
2812
2813 A template is a piece of text, with markup to invoke variable expan‐
2814 sion:
2815
2816 $ hg log -r1 --template "{node}\n"
2817 b56ce7b07c52de7d5fd79fb89701ea538af65746
2818
2819 Strings in curly braces are called keywords. The availability of key‐
2820 words depends on the exact context of the templater. These keywords are
2821 usually available for templating a log-like command:
2822
2823 author String. The unmodified author of the changeset.
2824
2825 branch String. The name of the branch on which the changeset was com‐
2826 mitted.
2827
2828 branches
2829 List of strings. The name of the branch on which the changeset
2830 was committed. Will be empty if the branch name was default.
2831
2832 children
2833 List of strings. The children of the changeset.
2834
2835 date Date information. The date when the changeset was committed.
2836
2837 desc String. The text of the changeset description.
2838
2839 diffstat
2840 String. Statistics of changes with the following format: "modi‐
2841 fied files: +added/-removed lines"
2842
2843 files List of strings. All files modified, added, or removed by this
2844 changeset.
2845
2846 file_adds
2847 List of strings. Files added by this changeset.
2848
2849 file_copies
2850 List of strings. Files copied in this changeset with their
2851 sources.
2852
2853 file_copies_switch
2854 List of strings. Like "file_copies" but displayed only if the
2855 --copied switch is set.
2856
2857 file_mods
2858 List of strings. Files modified by this changeset.
2859
2860 file_dels
2861 List of strings. Files removed by this changeset.
2862
2863 node String. The changeset identification hash, as a 40 hexadecimal
2864 digit string.
2865
2866 parents
2867 List of strings. The parents of the changeset.
2868
2869 rev Integer. The repository-local changeset revision number.
2870
2871 tags List of strings. Any tags associated with the changeset.
2872
2873 latesttag
2874 String. Most recent global tag in the ancestors of this change‐
2875 set.
2876
2877 latesttagdistance
2878 Integer. Longest path to the latest tag.
2879
2880 The "date" keyword does not produce human-readable output. If you want
2881 to use a date in your output, you can use a filter to process it. Fil‐
2882 ters are functions which return a string based on the input variable.
2883 Be sure to use the stringify filter first when you're applying a
2884 string-input filter to a list-like input variable. You can also use a
2885 chain of filters to get the desired output:
2886
2887 $ hg tip --template "{date|isodate}\n"
2888 2008-08-21 18:22 +0000
2889
2890 List of filters:
2891
2892 addbreaks
2893 Any text. Add an XHTML "<br />" tag before the end of every line
2894 except the last.
2895
2896 age Date. Returns a human-readable date/time difference between the
2897 given date/time and the current date/time.
2898
2899 basename
2900 Any text. Treats the text as a path, and returns the last compo‐
2901 nent of the path after splitting by the path separator (ignoring
2902 trailing separators). For example, "foo/bar/baz" becomes "baz"
2903 and "foo/bar//" becomes "bar".
2904
2905 stripdir
2906 Treat the text as path and strip a directory level, if possible.
2907 For example, "foo" and "foo/bar" becomes "foo".
2908
2909 date Date. Returns a date in a Unix date format, including the time‐
2910 zone: "Mon Sep 04 15:13:13 2006 0700".
2911
2912 domain Any text. Finds the first string that looks like an email
2913 address, and extracts just the domain component. Example: User
2914 <user@example.com> becomes example.com.
2915
2916 email Any text. Extracts the first string that looks like an email
2917 address. Example: User <user@example.com> becomes user@exam‐
2918 ple.com.
2919
2920 escape Any text. Replaces the special XML/XHTML characters "&", "<" and
2921 ">" with XML entities.
2922
2923 hex Any text. Convert a binary Mercurial node identifier into its
2924 long hexadecimal representation.
2925
2926 fill68 Any text. Wraps the text to fit in 68 columns.
2927
2928 fill76 Any text. Wraps the text to fit in 76 columns.
2929
2930 firstline
2931 Any text. Returns the first line of text.
2932
2933 nonempty
2934 Any text. Returns '(none)' if the string is empty.
2935
2936 hgdate Date. Returns the date as a pair of numbers: "1157407993 25200"
2937 (Unix timestamp, timezone offset).
2938
2939 isodate
2940 Date. Returns the date in ISO 8601 format: "2009-08-18 13:00
2941 +0200".
2942
2943 isodatesec
2944 Date. Returns the date in ISO 8601 format, including seconds:
2945 "2009-08-18 13:00:13 +0200". See also the rfc3339date filter.
2946
2947 localdate
2948 Date. Converts a date to local date.
2949
2950 obfuscate
2951 Any text. Returns the input text rendered as a sequence of XML
2952 entities.
2953
2954 person Any text. Returns the text before an email address.
2955
2956 rfc822date
2957 Date. Returns a date using the same format used in email head‐
2958 ers: "Tue, 18 Aug 2009 13:00:13 +0200".
2959
2960 rfc3339date
2961 Date. Returns a date using the Internet date format specified in
2962 RFC 3339: "2009-08-18T13:00:13+02:00".
2963
2964 short Changeset hash. Returns the short form of a changeset hash, i.e.
2965 a 12 hexadecimal digit string.
2966
2967 shortdate
2968 Date. Returns a date like "2006-09-18".
2969
2970 stringify
2971 Any type. Turns the value into text by converting values into
2972 text and concatenating them.
2973
2974 strip Any text. Strips all leading and trailing whitespace.
2975
2976 tabindent
2977 Any text. Returns the text, with every line except the first
2978 starting with a tab character.
2979
2980 urlescape
2981 Any text. Escapes all "special" characters. For example, "foo
2982 bar" becomes "foo%20bar".
2983
2984 user Any text. Returns the user portion of an email address.
2985
2987 Valid URLs are of the form:
2988
2989 local/filesystem/path[#revision]
2990 file://local/filesystem/path[#revision]
2991 http://[user[:pass]@]host[:port]/[path][#revision]
2992 https://[user[:pass]@]host[:port]/[path][#revision]
2993 ssh://[user@]host[:port]/[path][#revision]
2994
2995 Paths in the local filesystem can either point to Mercurial reposito‐
2996 ries or to bundle files (as created by hg bundle or :hg:` incoming
2997 --bundle`). See also hg help paths.
2998
2999 An optional identifier after # indicates a particular branch, tag, or
3000 changeset to use from the remote repository. See also hg help revisions
3001 .
3002
3003 Some features, such as pushing to http:// and https:// URLs are only
3004 possible if the feature is explicitly enabled on the remote Mercurial
3005 server.
3006
3007 Note that the security of HTTPS URLs depends on proper configuration of
3008 web.cacerts.
3009
3010 Some notes about using SSH with Mercurial:
3011
3012 · SSH requires an accessible shell account on the destination machine
3013 and a copy of hg in the remote path or specified with as remotecmd.
3014
3015 · path is relative to the remote user's home directory by default. Use
3016 an extra slash at the start of a path to specify an absolute path:
3017
3018 ssh://example.com//tmp/repository
3019
3020 · Mercurial doesn't use its own compression via SSH; the right thing to
3021 do is to configure it in your ~/.ssh/config, e.g.:
3022
3023 Host *.mylocalnetwork.example.com
3024 Compression no
3025 Host *
3026 Compression yes
3027
3028 Alternatively specify "ssh -C" as your ssh command in your configura‐
3029 tion file or with the --ssh command line option.
3030
3031 These URLs can all be stored in your configuration file with path
3032 aliases under the [paths] section like so:
3033
3034 [paths]
3035 alias1 = URL1
3036 alias2 = URL2
3037 ...
3038
3039 You can then use the alias for any command that uses a URL (for example
3040 hg pull alias1 will be treated as hg pull URL1).
3041
3042 Two path aliases are special because they are used as defaults when you
3043 do not provide the URL to a command:
3044
3045 default:
3046 When you create a repository with hg clone, the clone command
3047 saves the location of the source repository as the new reposi‐
3048 tory's 'default' path. This is then used when you omit path from
3049 push- and pull-like commands (including incoming and outgoing).
3050
3051 default-push:
3052 The push command will look for a path named 'default-push', and
3053 prefer it over 'default' if both are defined.
3054
3056 Mercurial has the ability to add new features through the use of exten‐
3057 sions. Extensions may add new commands, add options to existing com‐
3058 mands, change the default behavior of commands, or implement hooks.
3059
3060 Extensions are not loaded by default for a variety of reasons: they can
3061 increase startup overhead; they may be meant for advanced usage only;
3062 they may provide potentially dangerous abilities (such as letting you
3063 destroy or modify history); they might not be ready for prime time; or
3064 they may alter some usual behaviors of stock Mercurial. It is thus up
3065 to the user to activate extensions as needed.
3066
3067 To enable the "foo" extension, either shipped with Mercurial or in the
3068 Python search path, create an entry for it in your configuration file,
3069 like this:
3070
3071 [extensions]
3072 foo =
3073
3074 You may also specify the full path to an extension:
3075
3076 [extensions]
3077 myfeature = ~/.hgext/myfeature.py
3078
3079 To explicitly disable an extension enabled in a configuration file of
3080 broader scope, prepend its path with !:
3081
3082 [extensions]
3083 # disabling extension bar residing in /path/to/extension/bar.py
3084 bar = !/path/to/extension/bar.py
3085 # ditto, but no path was supplied for extension baz
3086 baz = !
3087
3088 disabled extensions:
3089
3090 acl hooks for controlling repository access
3091
3092 bugzilla
3093 hooks for integrating with the Bugzilla bug tracker
3094
3095 children
3096 command to display child changesets
3097
3098 churn command to display statistics about repository history
3099
3100 color colorize output from some commands
3101
3102 convert
3103 import revisions from foreign VCS repositories into Mercurial
3104
3105 eol automatically manage newlines in repository files
3106
3107 extdiff
3108 command to allow external programs to compare revisions
3109
3110 fetch pull, update and merge in one command
3111
3112 gpg commands to sign and verify changesets
3113
3114 graphlog
3115 command to view revision graphs from a shell
3116
3117 hgcia hooks for integrating with the CIA.vc notification service
3118
3119 hgk browse the repository in a graphical way
3120
3121 highlight
3122 syntax highlighting for hgweb (requires Pygments)
3123
3124 inotify
3125 accelerate status report using Linux's inotify service
3126
3127 interhg
3128 expand expressions into changelog and summaries
3129
3130 keyword
3131 expand keywords in tracked files
3132
3133 mq manage a stack of patches
3134
3135 notify hooks for sending email notifications at commit/push time
3136
3137 pager browse command output with an external pager
3138
3139 parentrevspec
3140 interpret suffixes to refer to ancestor revisions
3141
3142 patchbomb
3143 command to send changesets as (a series of) patch emails
3144
3145 progress
3146 show progress bars for some actions
3147
3148 purge command to delete untracked files from the working directory
3149
3150 rebase command to move sets of revisions to a different ancestor
3151
3152 record commands to interactively select changes for commit/qrefresh
3153
3154 relink recreates hardlinks between repository clones
3155
3156 schemes
3157 extend schemes with shortcuts to repository swarms
3158
3159 share share a common history between several working directories
3160
3161 transplant
3162 command to transplant changesets from another branch
3163
3164 win32mbcs
3165 allow the use of MBCS paths with problematic encodings
3166
3167 win32text
3168 perform automatic newline conversion
3169
3170 zeroconf
3171 discover and advertise repositories on the local network
3172
3174 Subrepositories let you nest external repositories or projects into a
3175 parent Mercurial repository, and make commands operate on them as a
3176 group. External Mercurial and Subversion projects are currently sup‐
3177 ported.
3178
3179 Subrepositories are made of three components:
3180
3181 1. Nested repository checkouts. They can appear anywhere in the parent
3182 working directory, and are Mercurial clones or Subversion checkouts.
3183
3184 2. Nested repository references. They are defined in .hgsub and tell
3185 where the subrepository checkouts come from. Mercurial subreposito‐
3186 ries are referenced like:
3187
3188 path/to/nested = https://example.com/nested/repo/path
3189
3190 where path/to/nested is the checkout location relatively to the par‐
3191 ent Mercurial root, and https://example.com/nested/repo/path is the
3192 source repository path. The source can also reference a filesystem
3193 path. Subversion repositories are defined with:
3194
3195 path/to/nested = [svn]https://example.com/nested/trunk/path
3196
3197 Note that .hgsub does not exist by default in Mercurial reposito‐
3198 ries, you have to create and add it to the parent repository before
3199 using subrepositories.
3200
3201 3. Nested repository states. They are defined in .hgsubstate and cap‐
3202 ture whatever information is required to restore the subrepositories
3203 to the state they were committed in a parent repository changeset.
3204 Mercurial automatically record the nested repositories states when
3205 committing in the parent repository.
3206
3207 Note
3208 The .hgsubstate file should not be edited manually.
3209
3211 If .hgsub does not exist, create it and add it to the parent reposi‐
3212 tory. Clone or checkout the external projects where you want it to live
3213 in the parent repository. Edit .hgsub and add the subrepository entry
3214 as described above. At this point, the subrepository is tracked and the
3215 next commit will record its state in .hgsubstate and bind it to the
3216 committed changeset.
3217
3219 Subrepos do not automatically track the latest changeset of their
3220 sources. Instead, they are updated to the changeset that corresponds
3221 with the changeset checked out in the top-level changeset. This is so
3222 developers always get a consistent set of compatible code and libraries
3223 when they update.
3224
3225 Thus, updating subrepos is a manual process. Simply check out target
3226 subrepo at the desired revision, test in the top-level repo, then com‐
3227 mit in the parent repository to record the new combination.
3228
3230 To remove a subrepository from the parent repository, delete its refer‐
3231 ence from .hgsub, then remove its files.
3232
3234 add add does not recurse in subrepos unless -S/--subrepos is speci‐
3235 fied. Subversion subrepositories are currently silently ignored.
3236
3237 archive
3238 archive does not recurse in subrepositories unless -S/--subrepos
3239 is specified.
3240
3241 commit commit creates a consistent snapshot of the state of the entire
3242 project and its subrepositories. It does this by first attempt‐
3243 ing to commit all modified subrepositories, then recording their
3244 state and finally committing it in the parent repository. Mercu‐
3245 rial can be made to abort if any subrepository content is modi‐
3246 fied by setting "ui.commitsubrepos=no" in a configuration file
3247 (see hg help config).
3248
3249 diff diff does not recurse in subrepos unless -S/--subrepos is speci‐
3250 fied. Changes are displayed as usual, on the subrepositories
3251 elements. Subversion subrepositories are currently silently
3252 ignored.
3253
3254 incoming
3255 incoming does not recurse in subrepos unless -S/--subrepos is
3256 specified. Subversion subrepositories are currently silently
3257 ignored.
3258
3259 outgoing
3260 outgoing does not recurse in subrepos unless -S/--subrepos is
3261 specified. Subversion subrepositories are currently silently
3262 ignored.
3263
3264 pull pull is not recursive since it is not clear what to pull prior
3265 to running hg update. Listing and retrieving all subrepositories
3266 changes referenced by the parent repository pulled changesets is
3267 expensive at best, impossible in the Subversion case.
3268
3269 push Mercurial will automatically push all subrepositories first when
3270 the parent repository is being pushed. This ensures new sub‐
3271 repository changes are available when referenced by top-level
3272 repositories.
3273
3274 status status does not recurse into subrepositories unless -S/--subre‐
3275 pos is specified. Subrepository changes are displayed as regular
3276 Mercurial changes on the subrepository elements. Subversion sub‐
3277 repositories are currently silently ignored.
3278
3279 update update restores the subrepos in the state they were originally
3280 committed in target changeset. If the recorded changeset is not
3281 available in the current subrepository, Mercurial will pull it
3282 in first before updating. This means that updating can require
3283 network access when using subrepositories.
3284
3286 A subrepository source location may change during a project life,
3287 invalidating references stored in the parent repository history. To fix
3288 this, rewriting rules can be defined in parent repository hgrc file or
3289 in Mercurial configuration. See the [subpaths] section in hgrc(5) for
3290 more details.
3291
3293 Mercurial's internal web server, hgweb, can serve either a single
3294 repository, or a collection of them. In the latter case, a special con‐
3295 figuration file can be used to specify the repository paths to use and
3296 global web configuration options.
3297
3298 This file uses the same syntax as other Mercurial configuration files,
3299 but only the following sections are recognized:
3300
3301 · web
3302
3303 · paths
3304
3305 · collections
3306
3307 The web section can specify all the settings described in the web sec‐
3308 tion of the hgrc(5) documentation. See hg help config for information
3309 on where to find the manual page.
3310
3311 The paths section provides mappings of physical repository paths to
3312 virtual ones. For instance:
3313
3314 [paths]
3315 projects/a = /foo/bar
3316 projects/b = /baz/quux
3317 web/root = /real/root/*
3318 / = /real/root2/*
3319 virtual/root2 = /real/root2/**
3320
3321 · The first two entries make two repositories in different directories
3322 appear under the same directory in the web interface
3323
3324 · The third entry maps every Mercurial repository found in '/real/root'
3325 into 'web/root'. This format is preferred over the [collections] one,
3326 since using absolute paths as configuration keys is not supported on
3327 every platform (especially on Windows).
3328
3329 · The fourth entry is a special case mapping all repositories in
3330 '/real/root2' in the root of the virtual directory.
3331
3332 · The fifth entry recursively finds all repositories under the real
3333 root, and maps their relative paths under the virtual root.
3334
3335 The collections section provides mappings of trees of physical reposi‐
3336 tories paths to virtual ones, though the paths syntax is generally pre‐
3337 ferred. For instance:
3338
3339 [collections]
3340 /foo = /foo
3341
3342 Here, the left side will be stripped off all repositories found in the
3343 right side. Thus /foo/bar and foo/quux/baz will be listed as bar and
3344 quux/baz respectively.
3345
3347 Ancestor
3348 Any changeset that can be reached by an unbroken chain of parent
3349 changesets from a given changeset. More precisely, the ancestors
3350 of a changeset can be defined by two properties: a parent of a
3351 changeset is an ancestor, and a parent of an ancestor is an
3352 ancestor. See also: 'Descendant'.
3353
3354 Branch (Noun) A child changeset that has been created from a parent
3355 that is not a head. These are known as topological branches, see
3356 'Branch, topological'. If a topological branch is named, it
3357 becomes a named branch. If a topological branch is not named, it
3358 becomes an anonymous branch. See 'Branch, anonymous' and
3359 'Branch, named'.
3360
3361 Branches may be created when changes are pulled from or pushed
3362 to a remote repository, since new heads may be created by these
3363 operations. Note that the term branch can also be used infor‐
3364 mally to describe a development process in which certain devel‐
3365 opment is done independently of other development. This is some‐
3366 times done explicitly with a named branch, but it can also be
3367 done locally, using bookmarks or clones and anonymous branches.
3368
3369 Example: "The experimental branch".
3370
3371 (Verb) The action of creating a child changeset which results in
3372 its parent having more than one child.
3373
3374 Example: "I'm going to branch at X".
3375
3376 Branch, anonymous
3377 Every time a new child changeset is created from a parent that
3378 is not a head and the name of the branch is not changed, a new
3379 anonymous branch is created.
3380
3381 Branch, closed
3382 A named branch whose branch heads have all been closed.
3383
3384 Branch, default
3385 The branch assigned to a changeset when no name has previously
3386 been assigned.
3387
3388 Branch head
3389 See 'Head, branch'.
3390
3391 Branch, inactive
3392 If a named branch has no topological heads, it is considered to
3393 be inactive. As an example, a feature branch becomes inactive
3394 when it is merged into the default branch. The hg branches com‐
3395 mand shows inactive branches by default, though they can be hid‐
3396 den with hg branches --active.
3397
3398 NOTE: this concept is deprecated because it is too implicit.
3399 Branches should now be explicitly closed using hg commit
3400 --close-branch when they are no longer needed.
3401
3402 Branch, named
3403 A collection of changesets which have the same branch name. By
3404 default, children of a changeset in a named branch belong to the
3405 same named branch. A child can be explicitly assigned to a dif‐
3406 ferent branch. See hg help branch, hg help branches and hg com‐
3407 mit --close-branch for more information on managing branches.
3408
3409 Named branches can be thought of as a kind of namespace, divid‐
3410 ing the collection of changesets that comprise the repository
3411 into a collection of disjoint subsets. A named branch is not
3412 necessarily a topological branch. If a new named branch is cre‐
3413 ated from the head of another named branch, or the default
3414 branch, but no further changesets are added to that previous
3415 branch, then that previous branch will be a branch in name only.
3416
3417 Branch tip
3418 See 'Tip, branch'.
3419
3420 Branch, topological
3421 Every time a new child changeset is created from a parent that
3422 is not a head, a new topological branch is created. If a topo‐
3423 logical branch is named, it becomes a named branch. If a topo‐
3424 logical branch is not named, it becomes an anonymous branch of
3425 the current, possibly default, branch.
3426
3427 Changelog
3428 A record of the changesets in the order in which they were added
3429 to the repository. This includes details such as changeset id,
3430 author, commit message, date, and list of changed files.
3431
3432 Changeset
3433 A snapshot of the state of the repository used to record a
3434 change.
3435
3436 Changeset, child
3437 The converse of parent changeset: if P is a parent of C, then C
3438 is a child of P. There is no limit to the number of children
3439 that a changeset may have.
3440
3441 Changeset id
3442 A SHA-1 hash that uniquely identifies a changeset. It may be
3443 represented as either a "long" 40 hexadecimal digit string, or a
3444 "short" 12 hexadecimal digit string.
3445
3446 Changeset, merge
3447 A changeset with two parents. This occurs when a merge is com‐
3448 mitted.
3449
3450 Changeset, parent
3451 A revision upon which a child changeset is based. Specifically,
3452 a parent changeset of a changeset C is a changeset whose node
3453 immediately precedes C in the DAG. Changesets have at most two
3454 parents.
3455
3456 Checkout
3457 (Noun) The working directory being updated to a specific revi‐
3458 sion. This use should probably be avoided where possible, as
3459 changeset is much more appropriate than checkout in this con‐
3460 text.
3461
3462 Example: "I'm using checkout X."
3463
3464 (Verb) Updating the working directory to a specific changeset.
3465 See hg help update.
3466
3467 Example: "I'm going to check out changeset X."
3468
3469 Child changeset
3470 See 'Changeset, child'.
3471
3472 Close changeset
3473 See 'Changeset, close'.
3474
3475 Closed branch
3476 See 'Branch, closed'.
3477
3478 Clone (Noun) An entire or partial copy of a repository. The partial
3479 clone must be in the form of a revision and its ancestors.
3480
3481 Example: "Is your clone up to date?".
3482
3483 (Verb) The process of creating a clone, using hg clone.
3484
3485 Example: "I'm going to clone the repository".
3486
3487 Closed branch head
3488 See 'Head, closed branch'.
3489
3490 Commit (Noun) A synonym for changeset.
3491
3492 Example: "Is the bug fixed in your recent commit?"
3493
3494 (Verb) The act of recording changes to a repository. When files
3495 are committed in a working directory, Mercurial finds the dif‐
3496 ferences between the committed files and their parent changeset,
3497 creating a new changeset in the repository.
3498
3499 Example: "You should commit those changes now."
3500
3501 Cset A common abbreviation of the term changeset.
3502
3503 DAG The repository of changesets of a distributed version control
3504 system (DVCS) can be described as a directed acyclic graph
3505 (DAG), consisting of nodes and edges, where nodes correspond to
3506 changesets and edges imply a parent -> child relation. This
3507 graph can be visualized by graphical tools such as hg glog
3508 (graphlog). In Mercurial, the DAG is limited by the requirement
3509 for children to have at most two parents.
3510
3511 Default branch
3512 See 'Branch, default'.
3513
3514 Descendant
3515 Any changeset that can be reached by a chain of child changesets
3516 from a given changeset. More precisely, the descendants of a
3517 changeset can be defined by two properties: the child of a
3518 changeset is a descendant, and the child of a descendant is a
3519 descendant. See also: 'Ancestor'.
3520
3521 Diff (Noun) The difference between the contents and attributes of
3522 files in two changesets or a changeset and the current working
3523 directory. The difference is usually represented in a standard
3524 form called a "diff" or "patch". The "git diff" format is used
3525 when the changes include copies, renames, or changes to file
3526 attributes, none of which can be represented/handled by classic
3527 "diff" and "patch".
3528
3529 Example: "Did you see my correction in the diff?"
3530
3531 (Verb) Diffing two changesets is the action of creating a diff
3532 or patch.
3533
3534 Example: "If you diff with changeset X, you will see what I
3535 mean."
3536
3537 Directory, working
3538 The working directory represents the state of the files tracked
3539 by Mercurial, that will be recorded in the next commit. The
3540 working directory initially corresponds to the snapshot at an
3541 existing changeset, known as the parent of the working direc‐
3542 tory. See 'Parent, working directory'. The state may be modified
3543 by changes to the files introduced manually or by a merge. The
3544 repository metadata exists in the .hg directory inside the work‐
3545 ing directory.
3546
3547 Graph See DAG and hg help graphlog.
3548
3549 Head The term 'head' may be used to refer to both a branch head or a
3550 repository head, depending on the context. See 'Head, branch'
3551 and 'Head, repository' for specific definitions.
3552
3553 Heads are where development generally takes place and are the
3554 usual targets for update and merge operations.
3555
3556 Head, branch
3557 A changeset with no descendants on the same named branch.
3558
3559 Head, closed branch
3560 A changeset that marks a head as no longer interesting. The
3561 closed head is no longer listed by hg heads. A branch is consid‐
3562 ered closed when all its heads are closed and consequently is
3563 not listed by hg branches.
3564
3565 Head, repository
3566 A topological head which has not been closed.
3567
3568 Head, topological
3569 A changeset with no children in the repository.
3570
3571 History, immutable
3572 Once committed, changesets cannot be altered. Extensions which
3573 appear to change history actually create new changesets that
3574 replace existing ones, and then destroy the old changesets.
3575 Doing so in public repositories can result in old changesets
3576 being reintroduced to the repository.
3577
3578 History, rewriting
3579 The changesets in a repository are immutable. However, exten‐
3580 sions to Mercurial can be used to alter the repository, usually
3581 in such a way as to preserve changeset contents.
3582
3583 Immutable history
3584 See 'History, immutable'.
3585
3586 Merge changeset
3587 See 'Changeset, merge'.
3588
3589 Manifest
3590 Each changeset has a manifest, which is the list of files that
3591 are tracked by the changeset.
3592
3593 Merge Used to bring together divergent branches of work. When you
3594 update to a changeset and then merge another changeset, you
3595 bring the history of the latter changeset into your working
3596 directory. Once conflicts are resolved (and marked), this merge
3597 may be committed as a merge changeset, bringing two branches
3598 together in the DAG.
3599
3600 Named branch
3601 See 'Branch, named'.
3602
3603 Null changeset
3604 The empty changeset. It is the parent state of newly-initialized
3605 repositories and repositories with no checked out revision. It
3606 is thus the parent of root changesets and the effective ancestor
3607 when merging unrelated changesets. Can be specified by the alias
3608 'null' or by the changeset ID '000000000000'.
3609
3610 Parent See 'Changeset, parent'.
3611
3612 Parent changeset
3613 See 'Changeset, parent'.
3614
3615 Parent, working directory
3616 The working directory parent reflects a virtual revision which
3617 is the child of the changeset (or two changesets with an uncom‐
3618 mitted merge) shown by hg parents. This is changed with hg
3619 update. Other commands to see the working directory parent are
3620 hg summary and hg id. Can be specified by the alias ".".
3621
3622 Patch (Noun) The product of a diff operation.
3623
3624 Example: "I've sent you my patch."
3625
3626 (Verb) The process of using a patch file to transform one
3627 changeset into another.
3628
3629 Example: "You will need to patch that revision."
3630
3631 Pull An operation in which changesets in a remote repository which
3632 are not in the local repository are brought into the local
3633 repository. Note that this operation without special arguments
3634 only updates the repository, it does not update the files in the
3635 working directory. See hg help pull.
3636
3637 Push An operation in which changesets in a local repository which are
3638 not in a remote repository are sent to the remote repository.
3639 Note that this operation only adds changesets which have been
3640 committed locally to the remote repository. Uncommitted changes
3641 are not sent. See hg help push.
3642
3643 Repository
3644 The metadata describing all recorded states of a collection of
3645 files. Each recorded state is represented by a changeset. A
3646 repository is usually (but not always) found in the .hg subdi‐
3647 rectory of a working directory. Any recorded state can be recre‐
3648 ated by "updating" a working directory to a specific changeset.
3649
3650 Repository head
3651 See 'Head, repository'.
3652
3653 Revision
3654 A state of the repository at some point in time. Earlier revi‐
3655 sions can be updated to by using hg update. See also 'Revision
3656 number'; See also 'Changeset'.
3657
3658 Revision number
3659 This integer uniquely identifies a changeset in a specific
3660 repository. It represents the order in which changesets were
3661 added to a repository, starting with revision number 0. Note
3662 that the revision number may be different in each clone of a
3663 repository. To identify changesets uniquely between different
3664 clones, see 'Changeset id'.
3665
3666 Revlog History storage mechanism used by Mercurial. It is a form of
3667 delta encoding, with occasional full revision of data followed
3668 by delta of each successive revision. It includes data and an
3669 index pointing to the data.
3670
3671 Rewriting history
3672 See 'History, rewriting'.
3673
3674 Root A changeset that has only the null changeset as its parent. Most
3675 repositories have only a single root changeset.
3676
3677 Tip The changeset with the highest revision number. It is the
3678 changeset most recently added in a repository.
3679
3680 Tip, branch
3681 The head of a given branch with the highest revision number.
3682 When a branch name is used as a revision identifier, it refers
3683 to the branch tip. See also 'Branch, head'. Note that because
3684 revision numbers may be different in different repository
3685 clones, the branch tip may be different in different cloned
3686 repositories.
3687
3688 Update (Noun) Another synonym of changeset.
3689
3690 Example: "I've pushed an update".
3691
3692 (Verb) This term is usually used to describe updating the state
3693 of the working directory to that of a specific changeset. See hg
3694 help update.
3695
3696 Example: "You should update".
3697
3698 Working directory
3699 See 'Directory, working'.
3700
3701 Working directory parent
3702 See 'Parent, working directory'.
3703
3705 This section contains help for extensions that are distributed together
3706 with Mercurial. Help for other extensions is available in the help sys‐
3707 tem.
3708
3709 acl
3710 hooks for controlling repository access
3711
3712 This hook makes it possible to allow or deny write access to given
3713 branches and paths of a repository when receiving incoming changesets
3714 via pretxnchangegroup and pretxncommit.
3715
3716 The authorization is matched based on the local user name on the system
3717 where the hook runs, and not the committer of the original changeset
3718 (since the latter is merely informative).
3719
3720 The acl hook is best used along with a restricted shell like hgsh, pre‐
3721 venting authenticating users from doing anything other than pushing or
3722 pulling. The hook is not safe to use if users have interactive shell
3723 access, as they can then disable the hook. Nor is it safe if remote
3724 users share an account, because then there is no way to distinguish
3725 them.
3726
3727 The order in which access checks are performed is:
3728
3729 1. Deny list for branches (section acl.deny.branches)
3730
3731 2. Allow list for branches (section acl.allow.branches)
3732
3733 3. Deny list for paths (section acl.deny)
3734
3735 4. Allow list for paths (section acl.allow)
3736
3737 The allow and deny sections take key-value pairs.
3738
3739 Branch-based Access Control
3740 Use the acl.deny.branches and acl.allow.branches sections to have
3741 branch-based access control. Keys in these sections can be either:
3742
3743 · a branch name, or
3744
3745 · an asterisk, to match any branch;
3746
3747 The corresponding values can be either:
3748
3749 · a comma-separated list containing users and groups, or
3750
3751 · an asterisk, to match anyone;
3752
3753 Path-based Access Control
3754 Use the acl.deny and acl.allow sections to have path-based access con‐
3755 trol. Keys in these sections accept a subtree pattern (with a glob syn‐
3756 tax by default). The corresponding values follow the same syntax as the
3757 other sections above.
3758
3759 Groups
3760 Group names must be prefixed with an @ symbol. Specifying a group name
3761 has the same effect as specifying all the users in that group.
3762
3763 You can define group members in the acl.groups section. If a group
3764 name is not defined there, and Mercurial is running under a Unix-like
3765 system, the list of users will be taken from the OS. Otherwise, an
3766 exception will be raised.
3767
3768 Example Configuration
3769 [hooks]
3770
3771 # Use this if you want to check access restrictions at commit time
3772 pretxncommit.acl = python:hgext.acl.hook
3773
3774 # Use this if you want to check access restrictions for pull, push,
3775 # bundle and serve.
3776 pretxnchangegroup.acl = python:hgext.acl.hook
3777
3778 [acl]
3779 # Allow or deny access for incoming changes only if their source is
3780 # listed here, let them pass otherwise. Source is "serve" for all
3781 # remote access (http or ssh), "push", "pull" or "bundle" when the
3782 # related commands are run locally.
3783 # Default: serve
3784 sources = serve
3785
3786 [acl.deny.branches]
3787
3788 # Everyone is denied to the frozen branch:
3789 frozen-branch = *
3790
3791 # A bad user is denied on all branches:
3792 * = bad-user
3793
3794 [acl.allow.branches]
3795
3796 # A few users are allowed on branch-a:
3797 branch-a = user-1, user-2, user-3
3798
3799 # Only one user is allowed on branch-b:
3800 branch-b = user-1
3801
3802 # The super user is allowed on any branch:
3803 * = super-user
3804
3805 # Everyone is allowed on branch-for-tests:
3806 branch-for-tests = *
3807
3808 [acl.deny]
3809 # This list is checked first. If a match is found, acl.allow is not
3810 # checked. All users are granted access if acl.deny is not present.
3811 # Format for both lists: glob pattern = user, ..., @group, ...
3812
3813 # To match everyone, use an asterisk for the user:
3814 # my/glob/pattern = *
3815
3816 # user6 will not have write access to any file:
3817 ** = user6
3818
3819 # Group "hg-denied" will not have write access to any file:
3820 ** = @hg-denied
3821
3822 # Nobody will be able to change "DONT-TOUCH-THIS.txt", despite
3823 # everyone being able to change all other files. See below.
3824 src/main/resources/DONT-TOUCH-THIS.txt = *
3825
3826 [acl.allow]
3827 # if acl.allow is not present, all users are allowed by default
3828 # empty acl.allow = no users allowed
3829
3830 # User "doc_writer" has write access to any file under the "docs"
3831 # folder:
3832 docs/** = doc_writer
3833
3834 # User "jack" and group "designers" have write access to any file
3835 # under the "images" folder:
3836 images/** = jack, @designers
3837
3838 # Everyone (except for "user6" - see acl.deny above) will have write
3839 # access to any file under the "resources" folder (except for 1
3840 # file. See acl.deny):
3841 src/main/resources/** = *
3842
3843 .hgtags = release_engineer
3844
3845 bugzilla
3846 hooks for integrating with the Bugzilla bug tracker
3847
3848 This hook extension adds comments on bugs in Bugzilla when changesets
3849 that refer to bugs by Bugzilla ID are seen. The hook does not change
3850 bug status.
3851
3852 The hook updates the Bugzilla database directly. Only Bugzilla instal‐
3853 lations using MySQL are supported.
3854
3855 The hook relies on a Bugzilla script to send bug change notification
3856 emails. That script changes between Bugzilla versions; the 'process‐
3857 mail' script used prior to 2.18 is replaced in 2.18 and subsequent ver‐
3858 sions by 'config/sendbugmail.pl'. Note that these will be run by Mercu‐
3859 rial as the user pushing the change; you will need to ensure the
3860 Bugzilla install file permissions are set appropriately.
3861
3862 The extension is configured through three different configuration sec‐
3863 tions. These keys are recognized in the [bugzilla] section:
3864
3865 host Hostname of the MySQL server holding the Bugzilla database.
3866
3867 db Name of the Bugzilla database in MySQL. Default 'bugs'.
3868
3869 user Username to use to access MySQL server. Default 'bugs'.
3870
3871 password
3872 Password to use to access MySQL server.
3873
3874 timeout
3875 Database connection timeout (seconds). Default 5.
3876
3877 version
3878 Bugzilla version. Specify '3.0' for Bugzilla versions 3.0 and
3879 later, '2.18' for Bugzilla versions from 2.18 and '2.16' for
3880 versions prior to 2.18.
3881
3882 bzuser Fallback Bugzilla user name to record comments with, if change‐
3883 set committer cannot be found as a Bugzilla user.
3884
3885 bzdir Bugzilla install directory. Used by default notify. Default
3886 '/var/www/html/bugzilla'.
3887
3888 notify The command to run to get Bugzilla to send bug change notifica‐
3889 tion emails. Substitutes from a map with 3 keys, 'bzdir', 'id'
3890 (bug id) and 'user' (committer bugzilla email). Default depends
3891 on version; from 2.18 it is "cd %(bzdir)s && perl -T con‐
3892 trib/sendbugmail.pl %(id)s %(user)s".
3893
3894 regexp Regular expression to match bug IDs in changeset commit message.
3895 Must contain one "()" group. The default expression matches 'Bug
3896 1234', 'Bug no. 1234', 'Bug number 1234', 'Bugs 1234,5678', 'Bug
3897 1234 and 5678' and variations thereof. Matching is case insensi‐
3898 tive.
3899
3900 style The style file to use when formatting comments.
3901
3902 template
3903 Template to use when formatting comments. Overrides style if
3904 specified. In addition to the usual Mercurial keywords, the
3905 extension specifies:
3906
3907 {bug} The Bugzilla bug ID.
3908 {root} The full pathname of the Mercurial repository.
3909 {webroot} Stripped pathname of the Mercurial repository.
3910 {hgweb} Base URL for browsing Mercurial repositories.
3911
3912 Default 'changeset {node|short} in repo {root} refers '
3913 'to bug {bug}.ndetails:nt{desc|tabindent}'
3914
3915 strip The number of slashes to strip from the front of {root} to pro‐
3916 duce {webroot}. Default 0.
3917
3918 usermap
3919 Path of file containing Mercurial committer ID to Bugzilla user
3920 ID mappings. If specified, the file should contain one mapping
3921 per line, "committer"="Bugzilla user". See also the [usermap]
3922 section.
3923
3924 The [usermap] section is used to specify mappings of Mercurial commit‐
3925 ter ID to Bugzilla user ID. See also [bugzilla].usermap. "commit‐
3926 ter"="Bugzilla user"
3927
3928 Finally, the [web] section supports one entry:
3929
3930 baseurl
3931 Base URL for browsing Mercurial repositories. Reference from
3932 templates as {hgweb}.
3933
3934 Activating the extension:
3935
3936 [extensions]
3937 bugzilla =
3938
3939 [hooks]
3940 # run bugzilla hook on every change pulled or pushed in here
3941 incoming.bugzilla = python:hgext.bugzilla.hook
3942
3943 Example configuration:
3944
3945 This example configuration is for a collection of Mercurial reposito‐
3946 ries in /var/local/hg/repos/ used with a local Bugzilla 3.2 installa‐
3947 tion in /opt/bugzilla-3.2.
3948
3949 [bugzilla]
3950 host=localhost
3951 password=XYZZY
3952 version=3.0
3953 bzuser=unknown@domain.com
3954 bzdir=/opt/bugzilla-3.2
3955 template=Changeset {node|short} in {root|basename}.
3956 {hgweb}/{webroot}/rev/{node|short}\n
3957 {desc}\n
3958 strip=5
3959
3960 [web]
3961 baseurl=http://dev.domain.com/hg
3962
3963 [usermap]
3964 user@emaildomain.com=user.name@bugzilladomain.com
3965
3966 Commits add a comment to the Bugzilla bug record of the form:
3967
3968 Changeset 3b16791d6642 in repository-name.
3969 http://dev.domain.com/hg/repository-name/rev/3b16791d6642
3970
3971 Changeset commit comment. Bug 1234.
3972
3973 children
3974 command to display child changesets
3975
3976 Commands
3977 children
3978 hg children [-r REV] [FILE]
3979
3980 Print the children of the working directory's revisions. If a revision
3981 is given via -r/--rev, the children of that revision will be printed.
3982 If a file argument is given, revision in which the file was last
3983 changed (after the working directory revision or the argument to --rev
3984 if given) is printed.
3985
3986 Options:
3987
3988 -r, --rev
3989 show children of the specified revision
3990
3991 --style
3992 display using template map file
3993
3994 --template
3995 display with template
3996
3997 churn
3998 command to display statistics about repository history
3999
4000 Commands
4001 churn
4002 hg churn [-d DATE] [-r REV] [--aliases FILE] [FILE]
4003
4004 This command will display a histogram representing the number of
4005 changed lines or revisions, grouped according to the given template.
4006 The default template will group changes by author. The --dateformat
4007 option may be used to group the results by date instead.
4008
4009 Statistics are based on the number of changed lines, or alternatively
4010 the number of matching revisions if the --changesets option is speci‐
4011 fied.
4012
4013 Examples:
4014
4015 # display count of changed lines for every committer
4016 hg churn -t '{author|email}'
4017
4018 # display daily activity graph
4019 hg churn -f '%H' -s -c
4020
4021 # display activity of developers by month
4022 hg churn -f '%Y-%m' -s -c
4023
4024 # display count of lines changed in every year
4025 hg churn -f '%Y' -s
4026
4027 It is possible to map alternate email addresses to a main address by
4028 providing a file using the following format:
4029
4030 <alias email> = <actual email>
4031
4032 Such a file may be specified with the --aliases option, otherwise a
4033 .hgchurn file will be looked for in the working directory root.
4034
4035 Options:
4036
4037 -r, --rev
4038 count rate for the specified revision or range
4039
4040 -d, --date
4041 count rate for revisions matching date spec
4042
4043 -t, --template
4044 template to group changesets (default: {author|email})
4045
4046 -f, --dateformat
4047 strftime-compatible format for grouping by date
4048
4049 -c, --changesets
4050 count rate by number of changesets
4051
4052 -s, --sort
4053 sort by key (default: sort by count)
4054
4055 --diffstat
4056 display added/removed lines separately
4057
4058 --aliases
4059 file with email aliases
4060
4061 -I, --include
4062 include names matching the given patterns
4063
4064 -X, --exclude
4065 exclude names matching the given patterns
4066
4067 color
4068 colorize output from some commands
4069
4070 This extension modifies the status and resolve commands to add color to
4071 their output to reflect file status, the qseries command to add color
4072 to reflect patch status (applied, unapplied, missing), and to
4073 diff-related commands to highlight additions, removals, diff headers,
4074 and trailing whitespace.
4075
4076 Other effects in addition to color, like bold and underlined text, are
4077 also available. Effects are rendered with the ECMA-48 SGR control func‐
4078 tion (aka ANSI escape codes).
4079
4080 Default effects may be overridden from your configuration file:
4081
4082 [color]
4083 status.modified = blue bold underline red_background
4084 status.added = green bold
4085 status.removed = red bold blue_background
4086 status.deleted = cyan bold underline
4087 status.unknown = magenta bold underline
4088 status.ignored = black bold
4089
4090 # 'none' turns off all effects
4091 status.clean = none
4092 status.copied = none
4093
4094 qseries.applied = blue bold underline
4095 qseries.unapplied = black bold
4096 qseries.missing = red bold
4097
4098 diff.diffline = bold
4099 diff.extended = cyan bold
4100 diff.file_a = red bold
4101 diff.file_b = green bold
4102 diff.hunk = magenta
4103 diff.deleted = red
4104 diff.inserted = green
4105 diff.changed = white
4106 diff.trailingwhitespace = bold red_background
4107
4108 resolve.unresolved = red bold
4109 resolve.resolved = green bold
4110
4111 bookmarks.current = green
4112
4113 branches.active = none
4114 branches.closed = black bold
4115 branches.current = green
4116 branches.inactive = none
4117
4118 The color extension will try to detect whether to use ANSI codes or
4119 Win32 console APIs, unless it is made explicit:
4120
4121 [color]
4122 mode = ansi
4123
4124 Any value other than 'ansi', 'win32', or 'auto' will disable color.
4125
4126 convert
4127 import revisions from foreign VCS repositories into Mercurial
4128
4129 Commands
4130 convert
4131 hg convert [OPTION]... SOURCE [DEST [REVMAP]]
4132
4133 Accepted source formats [identifiers]:
4134
4135 · Mercurial [hg]
4136
4137 · CVS [cvs]
4138
4139 · Darcs [darcs]
4140
4141 · git [git]
4142
4143 · Subversion [svn]
4144
4145 · Monotone [mtn]
4146
4147 · GNU Arch [gnuarch]
4148
4149 · Bazaar [bzr]
4150
4151 · Perforce [p4]
4152
4153 Accepted destination formats [identifiers]:
4154
4155 · Mercurial [hg]
4156
4157 · Subversion [svn] (history on branches is not preserved)
4158
4159 If no revision is given, all revisions will be converted. Otherwise,
4160 convert will only import up to the named revision (given in a format
4161 understood by the source).
4162
4163 If no destination directory name is specified, it defaults to the base‐
4164 name of the source with -hg appended. If the destination repository
4165 doesn't exist, it will be created.
4166
4167 By default, all sources except Mercurial will use --branchsort. Mercu‐
4168 rial uses --sourcesort to preserve original revision numbers order.
4169 Sort modes have the following effects:
4170
4171 --branchsort
4172 convert from parent to child revision when possible, which means
4173 branches are usually converted one after the other. It generates
4174 more compact repositories.
4175
4176 --datesort
4177 sort revisions by date. Converted repositories have good-looking
4178 changelogs but are often an order of magnitude larger than the
4179 same ones generated by --branchsort.
4180
4181 --sourcesort
4182 try to preserve source revisions order, only supported by Mercu‐
4183 rial sources.
4184
4185 If REVMAP isn't given, it will be put in a default location
4186 (<dest>/.hg/shamap by default). The REVMAP is a simple text file that
4187 maps each source commit ID to the destination ID for that revision,
4188 like so:
4189
4190 <source ID> <destination ID>
4191
4192 If the file doesn't exist, it's automatically created. It's updated on
4193 each commit copied, so hg convert can be interrupted and can be run
4194 repeatedly to copy new commits.
4195
4196 The authormap is a simple text file that maps each source commit author
4197 to a destination commit author. It is handy for source SCMs that use
4198 unix logins to identify authors (eg: CVS). One line per author mapping
4199 and the line format is:
4200
4201 source author = destination author
4202
4203 Empty lines and lines starting with a # are ignored.
4204
4205 The filemap is a file that allows filtering and remapping of files and
4206 directories. Each line can contain one of the following directives:
4207
4208 include path/to/file-or-dir
4209
4210 exclude path/to/file-or-dir
4211
4212 rename path/to/source path/to/destination
4213
4214 Comment lines start with #. A specified path matches if it equals the
4215 full relative name of a file or one of its parent directories. The
4216 include or exclude directive with the longest matching path applies, so
4217 line order does not matter.
4218
4219 The include directive causes a file, or all files under a directory, to
4220 be included in the destination repository, and the exclusion of all
4221 other files and directories not explicitly included. The exclude direc‐
4222 tive causes files or directories to be omitted. The rename directive
4223 renames a file or directory if it is converted. To rename from a subdi‐
4224 rectory into the root of the repository, use . as the path to rename
4225 to.
4226
4227 The splicemap is a file that allows insertion of synthetic history,
4228 letting you specify the parents of a revision. This is useful if you
4229 want to e.g. give a Subversion merge two parents, or graft two discon‐
4230 nected series of history together. Each entry contains a key, followed
4231 by a space, followed by one or two comma-separated values:
4232
4233 key parent1, parent2
4234
4235 The key is the revision ID in the source revision control system whose
4236 parents should be modified (same format as a key in .hg/shamap). The
4237 values are the revision IDs (in either the source or destination revi‐
4238 sion control system) that should be used as the new parents for that
4239 node. For example, if you have merged "release-1.0" into "trunk", then
4240 you should specify the revision on "trunk" as the first parent and the
4241 one on the "release-1.0" branch as the second.
4242
4243 The branchmap is a file that allows you to rename a branch when it is
4244 being brought in from whatever external repository. When used in con‐
4245 junction with a splicemap, it allows for a powerful combination to help
4246 fix even the most badly mismanaged repositories and turn them into
4247 nicely structured Mercurial repositories. The branchmap contains lines
4248 of the form:
4249
4250 original_branch_name new_branch_name
4251
4252 where "original_branch_name" is the name of the branch in the source
4253 repository, and "new_branch_name" is the name of the branch is the des‐
4254 tination repository. No whitespace is allowed in the branch names. This
4255 can be used to (for instance) move code in one repository from
4256 "default" to a named branch.
4257
4258 Mercurial Source
4259 The Mercurial source recognizes the following configuration options,
4260 which you can set on the command line with --config:
4261
4262 convert.hg.ignoreerrors
4263 ignore integrity errors when reading. Use it to fix Mercurial
4264 repositories with missing revlogs, by converting from and to
4265 Mercurial. Default is False.
4266
4267 convert.hg.saverev
4268 store original revision ID in changeset (forces target IDs to
4269 change). It takes and boolean argument and defaults to False.
4270
4271 convert.hg.startrev
4272 convert start revision and its descendants. It takes a hg revi‐
4273 sion identifier and defaults to 0.
4274
4275 CVS Source
4276 CVS source will use a sandbox (i.e. a checked-out copy) from CVS to
4277 indicate the starting point of what will be converted. Direct access to
4278 the repository files is not needed, unless of course the repository is
4279 :local:. The conversion uses the top level directory in the sandbox to
4280 find the CVS repository, and then uses CVS rlog commands to find files
4281 to convert. This means that unless a filemap is given, all files under
4282 the starting directory will be converted, and that any directory reor‐
4283 ganization in the CVS sandbox is ignored.
4284
4285 The following options can be used with --config:
4286
4287 convert.cvsps.cache
4288 Set to False to disable remote log caching, for testing and
4289 debugging purposes. Default is True.
4290
4291 convert.cvsps.fuzz
4292 Specify the maximum time (in seconds) that is allowed between
4293 commits with identical user and log message in a single change‐
4294 set. When very large files were checked in as part of a change‐
4295 set then the default may not be long enough. The default is 60.
4296
4297 convert.cvsps.mergeto
4298 Specify a regular expression to which commit log messages are
4299 matched. If a match occurs, then the conversion process will
4300 insert a dummy revision merging the branch on which this log
4301 message occurs to the branch indicated in the regex. Default is
4302 {{mergetobranch ([-\w]+)}}
4303
4304 convert.cvsps.mergefrom
4305 Specify a regular expression to which commit log messages are
4306 matched. If a match occurs, then the conversion process will add
4307 the most recent revision on the branch indicated in the regex as
4308 the second parent of the changeset. Default is {{mergefrombranch
4309 ([-\w]+)}}
4310
4311 hook.cvslog
4312 Specify a Python function to be called at the end of gathering
4313 the CVS log. The function is passed a list with the log entries,
4314 and can modify the entries in-place, or add or delete them.
4315
4316 hook.cvschangesets
4317 Specify a Python function to be called after the changesets are
4318 calculated from the the CVS log. The function is passed a list
4319 with the changeset entries, and can modify the changesets
4320 in-place, or add or delete them.
4321
4322 An additional "debugcvsps" Mercurial command allows the builtin change‐
4323 set merging code to be run without doing a conversion. Its parameters
4324 and output are similar to that of cvsps 2.1. Please see the command
4325 help for more details.
4326
4327 Subversion Source
4328 Subversion source detects classical trunk/branches/tags layouts. By
4329 default, the supplied svn://repo/path/ source URL is converted as a
4330 single branch. If svn://repo/path/trunk exists it replaces the default
4331 branch. If svn://repo/path/branches exists, its subdirectories are
4332 listed as possible branches. If svn://repo/path/tags exists, it is
4333 looked for tags referencing converted branches. Default trunk, branches
4334 and tags values can be overridden with following options. Set them to
4335 paths relative to the source URL, or leave them blank to disable auto
4336 detection.
4337
4338 The following options can be set with --config:
4339
4340 convert.svn.branches
4341 specify the directory containing branches. The default is
4342 branches.
4343
4344 convert.svn.tags
4345 specify the directory containing tags. The default is tags.
4346
4347 convert.svn.trunk
4348 specify the name of the trunk branch. The default is trunk.
4349
4350 Source history can be retrieved starting at a specific revision,
4351 instead of being integrally converted. Only single branch conversions
4352 are supported.
4353
4354 convert.svn.startrev
4355 specify start Subversion revision number. The default is 0.
4356
4357 Perforce Source
4358 The Perforce (P4) importer can be given a p4 depot path or a client
4359 specification as source. It will convert all files in the source to a
4360 flat Mercurial repository, ignoring labels, branches and integrations.
4361 Note that when a depot path is given you then usually should specify a
4362 target directory, because otherwise the target may be named ...-hg.
4363
4364 It is possible to limit the amount of source history to be converted by
4365 specifying an initial Perforce revision:
4366
4367 convert.p4.startrev
4368 specify initial Perforce revision (a Perforce changelist num‐
4369 ber).
4370
4371 Mercurial Destination
4372 The following options are supported:
4373
4374 convert.hg.clonebranches
4375 dispatch source branches in separate clones. The default is
4376 False.
4377
4378 convert.hg.tagsbranch
4379 branch name for tag revisions, defaults to default.
4380
4381 convert.hg.usebranchnames
4382 preserve branch names. The default is True.
4383
4384 Options:
4385
4386 --authors
4387 username mapping filename (DEPRECATED, use --authormap instead)
4388
4389 -s, --source-type
4390 source repository type
4391
4392 -d, --dest-type
4393 destination repository type
4394
4395 -r, --rev
4396 import up to target revision REV
4397
4398 -A, --authormap
4399 remap usernames using this file
4400
4401 --filemap
4402 remap file names using contents of file
4403
4404 --splicemap
4405 splice synthesized history into place
4406
4407 --branchmap
4408 change branch names while converting
4409
4410 --branchsort
4411 try to sort changesets by branches
4412
4413 --datesort
4414 try to sort changesets by date
4415
4416 --sourcesort
4417 preserve source changesets order
4418
4419 eol
4420 automatically manage newlines in repository files
4421
4422 This extension allows you to manage the type of line endings (CRLF or
4423 LF) that are used in the repository and in the local working directory.
4424 That way you can get CRLF line endings on Windows and LF on Unix/Mac,
4425 thereby letting everybody use their OS native line endings.
4426
4427 The extension reads its configuration from a versioned .hgeol configu‐
4428 ration file found in the root of the working copy. The .hgeol file use
4429 the same syntax as all other Mercurial configuration files. It uses two
4430 sections, [patterns] and [repository].
4431
4432 The [patterns] section specifies how line endings should be converted
4433 between the working copy and the repository. The format is specified by
4434 a file pattern. The first match is used, so put more specific patterns
4435 first. The available line endings are LF, CRLF, and BIN.
4436
4437 Files with the declared format of CRLF or LF are always checked out and
4438 stored in the repository in that format and files declared to be binary
4439 (BIN) are left unchanged. Additionally, native is an alias for checking
4440 out in the platform's default line ending: LF on Unix (including Mac OS
4441 X) and CRLF on Windows. Note that BIN (do nothing to line endings) is
4442 Mercurial's default behaviour; it is only needed if you need to over‐
4443 ride a later, more general pattern.
4444
4445 The optional [repository] section specifies the line endings to use for
4446 files stored in the repository. It has a single setting, native, which
4447 determines the storage line endings for files declared as native in the
4448 [patterns] section. It can be set to LF or CRLF. The default is LF. For
4449 example, this means that on Windows, files configured as native (CRLF
4450 by default) will be converted to LF when stored in the repository.
4451 Files declared as LF, CRLF, or BIN in the [patterns] section are always
4452 stored as-is in the repository.
4453
4454 Example versioned .hgeol file:
4455
4456 [patterns]
4457 **.py = native
4458 **.vcproj = CRLF
4459 **.txt = native
4460 Makefile = LF
4461 **.jpg = BIN
4462
4463 [repository]
4464 native = LF
4465
4466 Note The rules will first apply when files are touched in the working
4467 copy, e.g. by updating to null and back to tip to touch all
4468 files.
4469
4470 The extension uses an optional [eol] section in your hgrc file (not the
4471 .hgeol file) for settings that control the overall behavior. There are
4472 two settings:
4473
4474 · eol.native (default os.linesep) can be set to LF or CRLF to override
4475 the default interpretation of native for checkout. This can be used
4476 with hg archive on Unix, say, to generate an archive where files have
4477 line endings for Windows.
4478
4479 · eol.only-consistent (default True) can be set to False to make the
4480 extension convert files with inconsistent EOLs. Inconsistent means
4481 that there is both CRLF and LF present in the file. Such files are
4482 normally not touched under the assumption that they have mixed EOLs
4483 on purpose.
4484
4485 The extension provides cleverencode: and cleverdecode: filters like the
4486 deprecated win32text extension does. This means that you can disable
4487 win32text and enable eol and your filters will still work. You only
4488 need to these filters until you have prepared a .hgeol file.
4489
4490 The win32text.forbid* hooks provided by the win32text extension have
4491 been unified into a single hook named eol.hook. The hook will lookup
4492 the expected line endings from the .hgeol file, which means you must
4493 migrate to a .hgeol file first before using the hook. Remember to
4494 enable the eol extension in the repository where you install the hook.
4495
4496 See hg help patterns for more information about the glob patterns used.
4497
4498 extdiff
4499 command to allow external programs to compare revisions
4500
4501 The extdiff Mercurial extension allows you to use external programs to
4502 compare revisions, or revision with working directory. The external
4503 diff programs are called with a configurable set of options and two
4504 non-option arguments: paths to directories containing snapshots of
4505 files to compare.
4506
4507 The extdiff extension also allows to configure new diff commands, so
4508 you do not need to type hg extdiff -p kdiff3 always.
4509
4510 [extdiff]
4511 # add new command that runs GNU diff(1) in 'context diff' mode
4512 cdiff = gdiff -Nprc5
4513 ## or the old way:
4514 #cmd.cdiff = gdiff
4515 #opts.cdiff = -Nprc5
4516
4517 # add new command called vdiff, runs kdiff3
4518 vdiff = kdiff3
4519
4520 # add new command called meld, runs meld (no need to name twice)
4521 meld =
4522
4523 # add new command called vimdiff, runs gvimdiff with DirDiff plugin
4524 # (see http://www.vim.org/scripts/script.php?script_id=102) Non
4525 # English user, be sure to put "let g:DirDiffDynamicDiffText = 1" in
4526 # your .vimrc
4527 vimdiff = gvim -f '+next' '+execute "DirDiff" argv(0) argv(1)'
4528
4529 Tool arguments can include variables that are expanded at runtime:
4530
4531 $parent1, $plabel1 - filename, descriptive label of first parent
4532 $child, $clabel - filename, descriptive label of child revision
4533 $parent2, $plabel2 - filename, descriptive label of second parent
4534 $parent is an alias for $parent1.
4535
4536 The extdiff extension will look in your [diff-tools] and [merge-tools]
4537 sections for diff tool arguments, when none are specified in [extdiff].
4538
4539 [extdiff]
4540 kdiff3 =
4541
4542 [diff-tools]
4543 kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child
4544
4545 You can use -I/-X and list of file or directory names like normal hg
4546 diff command. The extdiff extension makes snapshots of only needed
4547 files, so running the external diff program will actually be pretty
4548 fast (at least faster than having to compare the entire tree).
4549
4550 Commands
4551 extdiff
4552 hg extdiff [OPT]... [FILE]...
4553
4554 Show differences between revisions for the specified files, using an
4555 external program. The default program used is diff, with default
4556 options "-Npru".
4557
4558 To select a different program, use the -p/--program option. The program
4559 will be passed the names of two directories to compare. To pass addi‐
4560 tional options to the program, use -o/--option. These will be passed
4561 before the names of the directories to compare.
4562
4563 When two revision arguments are given, then changes are shown between
4564 those revisions. If only one revision is specified then that revision
4565 is compared to the working directory, and, when no revisions are speci‐
4566 fied, the working directory files are compared to its parent.
4567
4568 Options:
4569
4570 -p, --program
4571 comparison program to run
4572
4573 -o, --option
4574 pass option to comparison program
4575
4576 -r, --rev
4577 revision
4578
4579 -c, --change
4580 change made by revision
4581
4582 -I, --include
4583 include names matching the given patterns
4584
4585 -X, --exclude
4586 exclude names matching the given patterns
4587
4588 fetch
4589 pull, update and merge in one command
4590
4591 Commands
4592 fetch
4593 hg fetch [SOURCE]
4594
4595 This finds all changes from the repository at the specified path or URL
4596 and adds them to the local repository.
4597
4598 If the pulled changes add a new branch head, the head is automatically
4599 merged, and the result of the merge is committed. Otherwise, the work‐
4600 ing directory is updated to include the new changes.
4601
4602 When a merge occurs, the newly pulled changes are assumed to be
4603 "authoritative". The head of the new changes is used as the first par‐
4604 ent, with local changes as the second. To switch the merge order, use
4605 --switch-parent.
4606
4607 See hg help dates for a list of formats valid for -d/--date.
4608
4609 Returns 0 on success.
4610
4611 Options:
4612
4613 -r, --rev
4614 a specific revision you would like to pull
4615
4616 -e, --edit
4617 edit commit message
4618
4619 --force-editor
4620 edit commit message (DEPRECATED)
4621
4622 --switch-parent
4623 switch parents when merging
4624
4625 -m, --message
4626 use text as commit message
4627
4628 -l, --logfile
4629 read commit message from file
4630
4631 -d, --date
4632 record the specified date as commit date
4633
4634 -u, --user
4635 record the specified user as committer
4636
4637 -e, --ssh
4638 specify ssh command to use
4639
4640 --remotecmd
4641 specify hg command to run on the remote side
4642
4643 --insecure
4644 do not verify server certificate (ignoring web.cacerts config)
4645
4646 gpg
4647 commands to sign and verify changesets
4648
4649 Commands
4650 sigcheck
4651 hg sigcheck REVISION
4652
4653 verify all the signatures there may be for a particular revision
4654
4655 sign
4656 hg sign [OPTION]... [REVISION]...
4657
4658 If no revision is given, the parent of the working directory is used,
4659 or tip if no revision is checked out.
4660
4661 See hg help dates for a list of formats valid for -d/--date.
4662
4663 Options:
4664
4665 -l, --local
4666 make the signature local
4667
4668 -f, --force
4669 sign even if the sigfile is modified
4670
4671 --no-commit
4672 do not commit the sigfile after signing
4673
4674 -k, --key
4675 the key id to sign with
4676
4677 -m, --message
4678 commit message
4679
4680 -d, --date
4681 record the specified date as commit date
4682
4683 -u, --user
4684 record the specified user as committer
4685
4686 sigs
4687 hg sigs
4688
4689 list signed changesets
4690
4691 graphlog
4692 command to view revision graphs from a shell
4693
4694 This extension adds a --graph option to the incoming, outgoing and log
4695 commands. When this options is given, an ASCII representation of the
4696 revision graph is also shown.
4697
4698 Commands
4699 glog
4700 hg glog [OPTION]... [FILE]
4701
4702 Print a revision history alongside a revision graph drawn with ASCII
4703 characters.
4704
4705 Nodes printed as an @ character are parents of the working directory.
4706
4707 Options:
4708
4709 -l, --limit
4710 limit number of changes displayed
4711
4712 -p, --patch
4713 show patch
4714
4715 -r, --rev
4716 show the specified revision or range
4717
4718 --style
4719 display using template map file
4720
4721 --template
4722 display with template
4723
4724 hgcia
4725 hooks for integrating with the CIA.vc notification service
4726
4727 This is meant to be run as a changegroup or incoming hook. To configure
4728 it, set the following options in your hgrc:
4729
4730 [cia]
4731 # your registered CIA user name
4732 user = foo
4733 # the name of the project in CIA
4734 project = foo
4735 # the module (subproject) (optional)
4736 #module = foo
4737 # Append a diffstat to the log message (optional)
4738 #diffstat = False
4739 # Template to use for log messages (optional)
4740 #template = {desc}\n{baseurl}/rev/{node}-- {diffstat}
4741 # Style to use (optional)
4742 #style = foo
4743 # The URL of the CIA notification service (optional)
4744 # You can use mailto: URLs to send by email, eg
4745 # mailto:cia@cia.vc
4746 # Make sure to set email.from if you do this.
4747 #url = http://cia.vc/
4748 # print message instead of sending it (optional)
4749 #test = False
4750
4751 [hooks]
4752 # one of these:
4753 changegroup.cia = python:hgcia.hook
4754 #incoming.cia = python:hgcia.hook
4755
4756 [web]
4757 # If you want hyperlinks (optional)
4758 baseurl = http://server/path/to/repo
4759
4760 hgk
4761 browse the repository in a graphical way
4762
4763 The hgk extension allows browsing the history of a repository in a
4764 graphical way. It requires Tcl/Tk version 8.4 or later. (Tcl/Tk is not
4765 distributed with Mercurial.)
4766
4767 hgk consists of two parts: a Tcl script that does the displaying and
4768 querying of information, and an extension to Mercurial named hgk.py,
4769 which provides hooks for hgk to get information. hgk can be found in
4770 the contrib directory, and the extension is shipped in the hgext repos‐
4771 itory, and needs to be enabled.
4772
4773 The hg view command will launch the hgk Tcl script. For this command to
4774 work, hgk must be in your search path. Alternately, you can specify the
4775 path to hgk in your configuration file:
4776
4777 [hgk]
4778 path=/location/of/hgk
4779
4780 hgk can make use of the extdiff extension to visualize revisions.
4781 Assuming you had already configured extdiff vdiff command, just add:
4782
4783 [hgk]
4784 vdiff=vdiff
4785
4786 Revisions context menu will now display additional entries to fire
4787 vdiff on hovered and selected revisions.
4788
4789 Commands
4790 view
4791 hg view [-l LIMIT] [REVRANGE]
4792
4793 start interactive history viewer
4794
4795 Options:
4796
4797 -l, --limit
4798 limit number of changes displayed
4799
4800 highlight
4801 syntax highlighting for hgweb (requires Pygments)
4802
4803 It depends on the Pygments syntax highlighting library:
4804 http://pygments.org/
4805
4806 There is a single configuration option:
4807
4808 [web]
4809 pygments_style = <style>
4810
4811 The default is 'colorful'.
4812
4813 inotify
4814 accelerate status report using Linux's inotify service
4815
4816 Commands
4817 inserve
4818 hg inserve [OPTION]...
4819
4820 start an inotify server for this repository
4821
4822 Options:
4823
4824 -d, --daemon
4825 run server in background
4826
4827 --daemon-pipefds
4828 used internally by daemon mode
4829
4830 -t, --idle-timeout
4831 minutes to sit idle before exiting
4832
4833 --pid-file
4834 name of file to write process ID to
4835
4836 interhg
4837 expand expressions into changelog and summaries
4838
4839 This extension allows the use of a special syntax in summaries, which
4840 will be automatically expanded into links or any other arbitrary
4841 expression, much like InterWiki does.
4842
4843 A few example patterns (link to bug tracking, etc.) that may be used in
4844 your hgrc:
4845
4846 [interhg]
4847 issues = s!issue(\d+)!<a href="http://bts/issue\1">issue\1</a>!
4848 bugzilla = s!((?:bug|b=|(?=#?\d{4,}))(?:\s*#?)(\d+))!<a..=\2">\1</a>!i
4849 boldify = s!(^|\s)#(\d+)\b! <b>#\2</b>!
4850
4851 keyword
4852 expand keywords in tracked files
4853
4854 This extension expands RCS/CVS-like or self-customized $Keywords$ in
4855 tracked text files selected by your configuration.
4856
4857 Keywords are only expanded in local repositories and not stored in the
4858 change history. The mechanism can be regarded as a convenience for the
4859 current user or for archive distribution.
4860
4861 Keywords expand to the changeset data pertaining to the latest change
4862 relative to the working directory parent of each file.
4863
4864 Configuration is done in the [keyword], [keywordset] and [keywordmaps]
4865 sections of hgrc files.
4866
4867 Example:
4868
4869 [keyword]
4870 # expand keywords in every python file except those matching "x*"
4871 **.py =
4872 x* = ignore
4873
4874 [keywordset]
4875 # prefer svn- over cvs-like default keywordmaps
4876 svn = True
4877
4878 Note The more specific you are in your filename patterns the less you
4879 lose speed in huge repositories.
4880
4881 For [keywordmaps] template mapping and expansion demonstration and con‐
4882 trol run hg kwdemo. See hg help templates for a list of available tem‐
4883 plates and filters.
4884
4885 Three additional date template filters are provided:
4886
4887 utcdate "2006/09/18 15:13:13"
4888 svnutcdate "2006-09-18 15:13:13Z"
4889 svnisodate "2006-09-18 08:13:13 -700 (Mon, 18 Sep 2006)"
4890
4891 The default template mappings (view with hg kwdemo -d) can be replaced
4892 with customized keywords and templates. Again, run hg kwdemo to control
4893 the results of your configuration changes.
4894
4895 Before changing/disabling active keywords, you must run hg kwshrink to
4896 avoid storing expanded keywords in the change history.
4897
4898 To force expansion after enabling it, or a configuration change, run hg
4899 kwexpand.
4900
4901 Expansions spanning more than one line and incremental expansions, like
4902 CVS' $Log$, are not supported. A keyword template map "Log = {desc}"
4903 expands to the first line of the changeset description.
4904
4905 Commands
4906 kwdemo
4907 hg kwdemo [-d] [-f RCFILE] [TEMPLATEMAP]...
4908
4909 Show current, custom, or default keyword template maps and their expan‐
4910 sions.
4911
4912 Extend the current configuration by specifying maps as arguments and
4913 using -f/--rcfile to source an external hgrc file.
4914
4915 Use -d/--default to disable current configuration.
4916
4917 See hg help templates for information on templates and filters.
4918
4919 Options:
4920
4921 -d, --default
4922 show default keyword template maps
4923
4924 -f, --rcfile
4925 read maps from rcfile
4926
4927 kwexpand
4928 hg kwexpand [OPTION]... [FILE]...
4929
4930 Run after (re)enabling keyword expansion.
4931
4932 kwexpand refuses to run if given files contain local changes.
4933
4934 Options:
4935
4936 -I, --include
4937 include names matching the given patterns
4938
4939 -X, --exclude
4940 exclude names matching the given patterns
4941
4942 kwfiles
4943 hg kwfiles [OPTION]... [FILE]...
4944
4945 List which files in the working directory are matched by the [keyword]
4946 configuration patterns.
4947
4948 Useful to prevent inadvertent keyword expansion and to speed up execu‐
4949 tion by including only files that are actual candidates for expansion.
4950
4951 See hg help keyword on how to construct patterns both for inclusion and
4952 exclusion of files.
4953
4954 With -A/--all and -v/--verbose the codes used to show the status of
4955 files are:
4956
4957 K = keyword expansion candidate
4958 k = keyword expansion candidate (not tracked)
4959 I = ignored
4960 i = ignored (not tracked)
4961
4962 Options:
4963
4964 -A, --all
4965 show keyword status flags of all files
4966
4967 -i, --ignore
4968 show files excluded from expansion
4969
4970 -u, --unknown
4971 only show unknown (not tracked) files
4972
4973 -I, --include
4974 include names matching the given patterns
4975
4976 -X, --exclude
4977 exclude names matching the given patterns
4978
4979 kwshrink
4980 hg kwshrink [OPTION]... [FILE]...
4981
4982 Must be run before changing/disabling active keywords.
4983
4984 kwshrink refuses to run if given files contain local changes.
4985
4986 Options:
4987
4988 -I, --include
4989 include names matching the given patterns
4990
4991 -X, --exclude
4992 exclude names matching the given patterns
4993
4994 mq
4995 manage a stack of patches
4996
4997 This extension lets you work with a stack of patches in a Mercurial
4998 repository. It manages two stacks of patches - all known patches, and
4999 applied patches (subset of known patches).
5000
5001 Known patches are represented as patch files in the .hg/patches direc‐
5002 tory. Applied patches are both patch files and changesets.
5003
5004 Common tasks (use hg help command for more details):
5005
5006 create new patch qnew
5007 import existing patch qimport
5008
5009 print patch series qseries
5010 print applied patches qapplied
5011
5012 add known patch to applied stack qpush
5013 remove patch from applied stack qpop
5014 refresh contents of top applied patch qrefresh
5015
5016 By default, mq will automatically use git patches when required to
5017 avoid losing file mode changes, copy records, binary files or empty
5018 files creations or deletions. This behaviour can be configured with:
5019
5020 [mq]
5021 git = auto/keep/yes/no
5022
5023 If set to 'keep', mq will obey the [diff] section configuration while
5024 preserving existing git patches upon qrefresh. If set to 'yes' or 'no',
5025 mq will override the [diff] section and always generate git or regular
5026 patches, possibly losing data in the second case.
5027
5028 You will by default be managing a patch queue named "patches". You can
5029 create other, independent patch queues with the hg qqueue command.
5030
5031 Commands
5032 qapplied
5033 hg qapplied [-1] [-s] [PATCH]
5034
5035 Returns 0 on success.
5036
5037 Options:
5038
5039 -1, --last
5040 show only the last patch
5041
5042 -s, --summary
5043 print first line of patch header
5044
5045 qclone
5046 hg qclone [OPTION]... SOURCE [DEST]
5047
5048 If source is local, destination will have no patches applied. If source
5049 is remote, this command can not check if patches are applied in source,
5050 so cannot guarantee that patches are not applied in destination. If you
5051 clone remote repository, be sure before that it has no patches applied.
5052
5053 Source patch repository is looked for in <src>/.hg/patches by default.
5054 Use -p <url> to change.
5055
5056 The patch directory must be a nested Mercurial repository, as would be
5057 created by hg init --mq.
5058
5059 Return 0 on success.
5060
5061 Options:
5062
5063 --pull use pull protocol to copy metadata
5064
5065 -U, --noupdate
5066 do not update the new working directories
5067
5068 --uncompressed
5069 use uncompressed transfer (fast over LAN)
5070
5071 -p, --patches
5072 location of source patch repository
5073
5074 -e, --ssh
5075 specify ssh command to use
5076
5077 --remotecmd
5078 specify hg command to run on the remote side
5079
5080 --insecure
5081 do not verify server certificate (ignoring web.cacerts config)
5082
5083 qcommit
5084 hg qcommit [OPTION]... [FILE]...
5085
5086 This command is deprecated; use hg commit --mq instead.
5087
5088 Options:
5089
5090 -A, --addremove
5091 mark new/missing files as added/removed before committing
5092
5093 --close-branch
5094 mark a branch as closed, hiding it from the branch list
5095
5096 -I, --include
5097 include names matching the given patterns
5098
5099 -X, --exclude
5100 exclude names matching the given patterns
5101
5102 -m, --message
5103 use text as commit message
5104
5105 -l, --logfile
5106 read commit message from file
5107
5108 -d, --date
5109 record the specified date as commit date
5110
5111 -u, --user
5112 record the specified user as committer
5113
5114 aliases: qci
5115
5116 qdelete
5117 hg qdelete [-k] [PATCH]...
5118
5119 The patches must not be applied, and at least one patch is required.
5120 With -k/--keep, the patch files are preserved in the patch directory.
5121
5122 To stop managing a patch and move it into permanent history, use the hg
5123 qfinish command.
5124
5125 Options:
5126
5127 -k, --keep
5128 keep patch file
5129
5130 -r, --rev
5131 stop managing a revision (DEPRECATED)
5132
5133 aliases: qremove qrm
5134
5135 qdiff
5136 hg qdiff [OPTION]... [FILE]...
5137
5138 Shows a diff which includes the current patch as well as any changes
5139 which have been made in the working directory since the last refresh
5140 (thus showing what the current patch would become after a qrefresh).
5141
5142 Use hg diff if you only want to see the changes made since the last
5143 qrefresh, or hg export qtip if you want to see changes made by the cur‐
5144 rent patch without including changes made since the qrefresh.
5145
5146 Returns 0 on success.
5147
5148 Options:
5149
5150 -a, --text
5151 treat all files as text
5152
5153 -g, --git
5154 use git extended diff format
5155
5156 --nodates
5157 omit dates from diff headers
5158
5159 -p, --show-function
5160 show which function each change is in
5161
5162 --reverse
5163 produce a diff that undoes the changes
5164
5165 -w, --ignore-all-space
5166 ignore white space when comparing lines
5167
5168 -b, --ignore-space-change
5169 ignore changes in the amount of white space
5170
5171 -B, --ignore-blank-lines
5172 ignore changes whose lines are all blank
5173
5174 -U, --unified
5175 number of lines of context to show
5176
5177 --stat output diffstat-style summary of changes
5178
5179 -I, --include
5180 include names matching the given patterns
5181
5182 -X, --exclude
5183 exclude names matching the given patterns
5184
5185 qfinish
5186 hg qfinish [-a] [REV]...
5187
5188 Finishes the specified revisions (corresponding to applied patches) by
5189 moving them out of mq control into regular repository history.
5190
5191 Accepts a revision range or the -a/--applied option. If --applied is
5192 specified, all applied mq revisions are removed from mq control. Other‐
5193 wise, the given revisions must be at the base of the stack of applied
5194 patches.
5195
5196 This can be especially useful if your changes have been applied to an
5197 upstream repository, or if you are about to push your changes to
5198 upstream.
5199
5200 Returns 0 on success.
5201
5202 Options:
5203
5204 -a, --applied
5205 finish all applied changesets
5206
5207 qfold
5208 hg qfold [-e] [-k] [-m TEXT] [-l FILE] PATCH...
5209
5210 Patches must not yet be applied. Each patch will be successively
5211 applied to the current patch in the order given. If all the patches
5212 apply successfully, the current patch will be refreshed with the new
5213 cumulative patch, and the folded patches will be deleted. With
5214 -k/--keep, the folded patch files will not be removed afterwards.
5215
5216 The header for each folded patch will be concatenated with the current
5217 patch header, separated by a line of * * *.
5218
5219 Returns 0 on success.
5220
5221 Options:
5222
5223 -e, --edit
5224 edit patch header
5225
5226 -k, --keep
5227 keep folded patch files
5228
5229 -m, --message
5230 use text as commit message
5231
5232 -l, --logfile
5233 read commit message from file
5234
5235 qgoto
5236 hg qgoto [OPTION]... PATCH
5237
5238 Returns 0 on success.
5239
5240 Options:
5241
5242 -f, --force
5243 overwrite any local changes
5244
5245 qguard
5246 hg qguard [-l] [-n] [PATCH] [-- [+GUARD]... [-GUARD]...]
5247
5248 Guards control whether a patch can be pushed. A patch with no guards is
5249 always pushed. A patch with a positive guard ("+foo") is pushed only if
5250 the hg qselect command has activated it. A patch with a negative guard
5251 ("-foo") is never pushed if the hg qselect command has activated it.
5252
5253 With no arguments, print the currently active guards. With arguments,
5254 set guards for the named patch.
5255
5256 Note Specifying negative guards now requires '--'.
5257
5258 To set guards on another patch:
5259
5260 hg qguard other.patch -- +2.6.17 -stable
5261
5262 Returns 0 on success.
5263
5264 Options:
5265
5266 -l, --list
5267 list all patches and guards
5268
5269 -n, --none
5270 drop all guards
5271
5272 qheader
5273 hg qheader [PATCH]
5274
5275 Returns 0 on success.
5276
5277 qimport
5278 hg qimport [-e] [-n NAME] [-f] [-g] [-P] [-r REV]... FILE...
5279
5280 The patch is inserted into the series after the last applied patch. If
5281 no patches have been applied, qimport prepends the patch to the series.
5282
5283 The patch will have the same name as its source file unless you give it
5284 a new one with -n/--name.
5285
5286 You can register an existing patch inside the patch directory with the
5287 -e/--existing flag.
5288
5289 With -f/--force, an existing patch of the same name will be overwrit‐
5290 ten.
5291
5292 An existing changeset may be placed under mq control with -r/--rev
5293 (e.g. qimport --rev tip -n patch will place tip under mq control).
5294 With -g/--git, patches imported with --rev will use the git diff for‐
5295 mat. See the diffs help topic for information on why this is important
5296 for preserving rename/copy information and permission changes.
5297
5298 To import a patch from standard input, pass - as the patch file. When
5299 importing from standard input, a patch name must be specified using the
5300 --name flag.
5301
5302 To import an existing patch while renaming it:
5303
5304 hg qimport -e existing-patch -n new-name
5305
5306 Returns 0 if import succeeded.
5307
5308 Options:
5309
5310 -e, --existing
5311 import file in patch directory
5312
5313 -n, --name
5314 name of patch file
5315
5316 -f, --force
5317 overwrite existing files
5318
5319 -r, --rev
5320 place existing revisions under mq control
5321
5322 -g, --git
5323 use git extended diff format
5324
5325 -P, --push
5326 qpush after importing
5327
5328 qinit
5329 hg qinit [-c]
5330
5331 The queue repository is unversioned by default. If -c/--create-repo is
5332 specified, qinit will create a separate nested repository for patches
5333 (qinit -c may also be run later to convert an unversioned patch reposi‐
5334 tory into a versioned one). You can use qcommit to commit changes to
5335 this queue repository.
5336
5337 This command is deprecated. Without -c, it's implied by other relevant
5338 commands. With -c, use hg init --mq instead.
5339
5340 Options:
5341
5342 -c, --create-repo
5343 create queue repository
5344
5345 qnew
5346 hg qnew [-e] [-m TEXT] [-l FILE] PATCH [FILE]...
5347
5348 qnew creates a new patch on top of the currently-applied patch (if
5349 any). The patch will be initialized with any outstanding changes in the
5350 working directory. You may also use -I/--include, -X/--exclude, and/or
5351 a list of files after the patch name to add only changes to matching
5352 files to the new patch, leaving the rest as uncommitted modifications.
5353
5354 -u/--user and -d/--date can be used to set the (given) user and date,
5355 respectively. -U/--currentuser and -D/--currentdate set user to current
5356 user and date to current date.
5357
5358 -e/--edit, -m/--message or -l/--logfile set the patch header as well as
5359 the commit message. If none is specified, the header is empty and the
5360 commit message is '[mq]: PATCH'.
5361
5362 Use the -g/--git option to keep the patch in the git extended diff for‐
5363 mat. Read the diffs help topic for more information on why this is
5364 important for preserving permission changes and copy/rename informa‐
5365 tion.
5366
5367 Returns 0 on successful creation of a new patch.
5368
5369 Options:
5370
5371 -e, --edit
5372 edit commit message
5373
5374 -f, --force
5375 import uncommitted changes (DEPRECATED)
5376
5377 -g, --git
5378 use git extended diff format
5379
5380 -U, --currentuser
5381 add "From: <current user>" to patch
5382
5383 -u, --user
5384 add "From: <USER>" to patch
5385
5386 -D, --currentdate
5387 add "Date: <current date>" to patch
5388
5389 -d, --date
5390 add "Date: <DATE>" to patch
5391
5392 -I, --include
5393 include names matching the given patterns
5394
5395 -X, --exclude
5396 exclude names matching the given patterns
5397
5398 -m, --message
5399 use text as commit message
5400
5401 -l, --logfile
5402 read commit message from file
5403
5404 qnext
5405 hg qnext [-s]
5406
5407 Returns 0 on success.
5408
5409 Options:
5410
5411 -s, --summary
5412 print first line of patch header
5413
5414 qpop
5415 hg qpop [-a] [-f] [PATCH | INDEX]
5416
5417 By default, pops off the top of the patch stack. If given a patch name,
5418 keeps popping off patches until the named patch is at the top of the
5419 stack.
5420
5421 Return 0 on success.
5422
5423 Options:
5424
5425 -a, --all
5426 pop all patches
5427
5428 -n, --name
5429 queue name to pop (DEPRECATED)
5430
5431 -f, --force
5432 forget any local changes to patched files
5433
5434 qprev
5435 hg qprev [-s]
5436
5437 Returns 0 on success.
5438
5439 Options:
5440
5441 -s, --summary
5442 print first line of patch header
5443
5444 qpush
5445 hg qpush [-f] [-l] [-a] [--move] [PATCH | INDEX]
5446
5447 When -f/--force is applied, all local changes in patched files will be
5448 lost.
5449
5450 Return 0 on success.
5451
5452 Options:
5453
5454 -f, --force
5455 apply on top of local changes
5456
5457 -e, --exact
5458 apply the target patch to its recorded parent
5459
5460 -l, --list
5461 list patch name in commit text
5462
5463 -a, --all
5464 apply all patches
5465
5466 -m, --merge
5467 merge from another queue (DEPRECATED)
5468
5469 -n, --name
5470 merge queue name (DEPRECATED)
5471
5472 --move reorder patch series and apply only the patch
5473
5474 qqueue
5475 hg qqueue [OPTION] [QUEUE]
5476
5477 Supports switching between different patch queues, as well as creating
5478 new patch queues and deleting existing ones.
5479
5480 Omitting a queue name or specifying -l/--list will show you the regis‐
5481 tered queues - by default the "normal" patches queue is registered. The
5482 currently active queue will be marked with "(active)".
5483
5484 To create a new queue, use -c/--create. The queue is automatically made
5485 active, except in the case where there are applied patches from the
5486 currently active queue in the repository. Then the queue will only be
5487 created and switching will fail.
5488
5489 To delete an existing queue, use --delete. You cannot delete the cur‐
5490 rently active queue.
5491
5492 Returns 0 on success.
5493
5494 Options:
5495
5496 -l, --list
5497 list all available queues
5498
5499 -c, --create
5500 create new queue
5501
5502 --rename
5503 rename active queue
5504
5505 --delete
5506 delete reference to queue
5507
5508 --purge
5509 delete queue, and remove patch dir
5510
5511 qrefresh
5512 hg qrefresh [-I] [-X] [-e] [-m TEXT] [-l FILE] [-s] [FILE]...
5513
5514 If any file patterns are provided, the refreshed patch will contain
5515 only the modifications that match those patterns; the remaining modifi‐
5516 cations will remain in the working directory.
5517
5518 If -s/--short is specified, files currently included in the patch will
5519 be refreshed just like matched files and remain in the patch.
5520
5521 If -e/--edit is specified, Mercurial will start your configured editor
5522 for you to enter a message. In case qrefresh fails, you will find a
5523 backup of your message in .hg/last-message.txt.
5524
5525 hg add/remove/copy/rename work as usual, though you might want to use
5526 git-style patches (-g/--git or [diff] git=1) to track copies and
5527 renames. See the diffs help topic for more information on the git diff
5528 format.
5529
5530 Returns 0 on success.
5531
5532 Options:
5533
5534 -e, --edit
5535 edit commit message
5536
5537 -g, --git
5538 use git extended diff format
5539
5540 -s, --short
5541 refresh only files already in the patch and specified files
5542
5543 -U, --currentuser
5544 add/update author field in patch with current user
5545
5546 -u, --user
5547 add/update author field in patch with given user
5548
5549 -D, --currentdate
5550 add/update date field in patch with current date
5551
5552 -d, --date
5553 add/update date field in patch with given date
5554
5555 -I, --include
5556 include names matching the given patterns
5557
5558 -X, --exclude
5559 exclude names matching the given patterns
5560
5561 -m, --message
5562 use text as commit message
5563
5564 -l, --logfile
5565 read commit message from file
5566
5567 qrename
5568 hg qrename PATCH1 [PATCH2]
5569
5570 With one argument, renames the current patch to PATCH1. With two argu‐
5571 ments, renames PATCH1 to PATCH2.
5572
5573 Returns 0 on success.
5574
5575 aliases: qmv
5576
5577 qrestore
5578 hg qrestore [-d] [-u] REV
5579
5580 This command is deprecated, use hg rebase instead.
5581
5582 Options:
5583
5584 -d, --delete
5585 delete save entry
5586
5587 -u, --update
5588 update queue working directory
5589
5590 qsave
5591 hg qsave [-m TEXT] [-l FILE] [-c] [-n NAME] [-e] [-f]
5592
5593 This command is deprecated, use hg rebase instead.
5594
5595 Options:
5596
5597 -c, --copy
5598 copy patch directory
5599
5600 -n, --name
5601 copy directory name
5602
5603 -e, --empty
5604 clear queue status file
5605
5606 -f, --force
5607 force copy
5608
5609 -m, --message
5610 use text as commit message
5611
5612 -l, --logfile
5613 read commit message from file
5614
5615 qselect
5616 hg qselect [OPTION]... [GUARD]...
5617
5618 Use the hg qguard command to set or print guards on patch, then use
5619 qselect to tell mq which guards to use. A patch will be pushed if it
5620 has no guards or any positive guards match the currently selected
5621 guard, but will not be pushed if any negative guards match the current
5622 guard. For example:
5623
5624 qguard foo.patch -- -stable (negative guard)
5625 qguard bar.patch +stable (positive guard)
5626 qselect stable
5627
5628 This activates the "stable" guard. mq will skip foo.patch (because it
5629 has a negative match) but push bar.patch (because it has a positive
5630 match).
5631
5632 With no arguments, prints the currently active guards. With one argu‐
5633 ment, sets the active guard.
5634
5635 Use -n/--none to deactivate guards (no other arguments needed). When
5636 no guards are active, patches with positive guards are skipped and
5637 patches with negative guards are pushed.
5638
5639 qselect can change the guards on applied patches. It does not pop
5640 guarded patches by default. Use --pop to pop back to the last applied
5641 patch that is not guarded. Use --reapply (which implies --pop) to push
5642 back to the current patch afterwards, but skip guarded patches.
5643
5644 Use -s/--series to print a list of all guards in the series file (no
5645 other arguments needed). Use -v for more information.
5646
5647 Returns 0 on success.
5648
5649 Options:
5650
5651 -n, --none
5652 disable all guards
5653
5654 -s, --series
5655 list all guards in series file
5656
5657 --pop pop to before first guarded applied patch
5658
5659 --reapply
5660 pop, then reapply patches
5661
5662 qseries
5663 hg qseries [-ms]
5664
5665 Returns 0 on success.
5666
5667 Options:
5668
5669 -m, --missing
5670 print patches not in series
5671
5672 -s, --summary
5673 print first line of patch header
5674
5675 qtop
5676 hg qtop [-s]
5677
5678 Returns 0 on success.
5679
5680 Options:
5681
5682 -s, --summary
5683 print first line of patch header
5684
5685 qunapplied
5686 hg qunapplied [-1] [-s] [PATCH]
5687
5688 Returns 0 on success.
5689
5690 Options:
5691
5692 -1, --first
5693 show only the first patch
5694
5695 -s, --summary
5696 print first line of patch header
5697
5698 strip
5699 hg strip [-k] [-f] [-n] REV...
5700
5701 The strip command removes the specified changesets and all their
5702 descendants. If the working directory has uncommitted changes, the
5703 operation is aborted unless the --force flag is supplied, in which case
5704 changes will be discarded.
5705
5706 If a parent of the working directory is stripped, then the working
5707 directory will automatically be updated to the most recent available
5708 ancestor of the stripped parent after the operation completes.
5709
5710 Any stripped changesets are stored in .hg/strip-backup as a bundle (see
5711 hg help bundle and hg help unbundle). They can be restored by running
5712 hg unbundle .hg/strip-backup/BUNDLE, where BUNDLE is the bundle file
5713 created by the strip. Note that the local revision numbers will in gen‐
5714 eral be different after the restore.
5715
5716 Use the --no-backup option to discard the backup bundle once the opera‐
5717 tion completes.
5718
5719 Return 0 on success.
5720
5721 Options:
5722
5723 -f, --force
5724 force removal of changesets, discard uncommitted changes (no
5725 backup)
5726
5727 -b, --backup
5728 bundle only changesets with local revision number greater than
5729 REV which are not descendants of REV (DEPRECATED)
5730
5731 -n, --no-backup
5732 no backups
5733
5734 --nobackup
5735 no backups (DEPRECATED)
5736
5737 -k, --keep
5738 do not modify working copy during strip
5739
5740 notify
5741 hooks for sending email notifications at commit/push time
5742
5743 Subscriptions can be managed through a hgrc file. Default mode is to
5744 print messages to stdout, for testing and configuring.
5745
5746 To use, configure the notify extension and enable it in hgrc like this:
5747
5748 [extensions]
5749 notify =
5750
5751 [hooks]
5752 # one email for each incoming changeset
5753 incoming.notify = python:hgext.notify.hook
5754 # batch emails when many changesets incoming at one time
5755 changegroup.notify = python:hgext.notify.hook
5756
5757 [notify]
5758 # config items go here
5759
5760 Required configuration items:
5761
5762 config = /path/to/file # file containing subscriptions
5763
5764 Optional configuration items:
5765
5766 test = True # print messages to stdout for testing
5767 strip = 3 # number of slashes to strip for url paths
5768 domain = example.com # domain to use if committer missing domain
5769 style = ... # style file to use when formatting email
5770 template = ... # template to use when formatting email
5771 incoming = ... # template to use when run as incoming hook
5772 changegroup = ... # template when run as changegroup hook
5773 maxdiff = 300 # max lines of diffs to include (0=none, -1=all)
5774 maxsubject = 67 # truncate subject line longer than this
5775 diffstat = True # add a diffstat before the diff content
5776 sources = serve # notify if source of incoming changes in this list
5777 # (serve == ssh or http, push, pull, bundle)
5778 merge = False # send notification for merges (default True)
5779 [email]
5780 from = user@host.com # email address to send as if none given
5781 [web]
5782 baseurl = http://hgserver/... # root of hg web site for browsing commits
5783
5784 The notify config file has same format as a regular hgrc file. It has
5785 two sections so you can express subscriptions in whatever way is hand‐
5786 ier for you.
5787
5788 [usersubs]
5789 # key is subscriber email, value is ","-separated list of glob patterns
5790 user@host = pattern
5791
5792 [reposubs]
5793 # key is glob pattern, value is ","-separated list of subscriber emails
5794 pattern = user@host
5795
5796 Glob patterns are matched against path to repository root.
5797
5798 If you like, you can put notify config file in repository that users
5799 can push changes to, they can manage their own subscriptions.
5800
5801 pager
5802 browse command output with an external pager
5803
5804 To set the pager that should be used, set the application variable:
5805
5806 [pager]
5807 pager = less -FRSX
5808
5809 If no pager is set, the pager extensions uses the environment variable
5810 $PAGER. If neither pager.pager, nor $PAGER is set, no pager is used.
5811
5812 If you notice "BROKEN PIPE" error messages, you can disable them by
5813 setting:
5814
5815 [pager]
5816 quiet = True
5817
5818 You can disable the pager for certain commands by adding them to the
5819 pager.ignore list:
5820
5821 [pager]
5822 ignore = version, help, update
5823
5824 You can also enable the pager only for certain commands using
5825 pager.attend. Below is the default list of commands to be paged:
5826
5827 [pager]
5828 attend = annotate, cat, diff, export, glog, log, qdiff
5829
5830 Setting pager.attend to an empty value will cause all commands to be
5831 paged.
5832
5833 If pager.attend is present, pager.ignore will be ignored.
5834
5835 To ignore global commands like hg version or hg help, you have to spec‐
5836 ify them in your user configuration file.
5837
5838 The --pager=... option can also be used to control when the pager is
5839 used. Use a boolean value like yes, no, on, off, or use auto for normal
5840 behavior.
5841
5842 parentrevspec
5843 interpret suffixes to refer to ancestor revisions
5844
5845 This extension allows you to use git-style suffixes to refer to the
5846 ancestors of a specific revision.
5847
5848 For example, if you can refer to a revision as "foo", then:
5849
5850 foo^N = Nth parent of foo
5851 foo^0 = foo
5852 foo^1 = first parent of foo
5853 foo^2 = second parent of foo
5854 foo^ = foo^1
5855
5856 foo~N = Nth first grandparent of foo
5857 foo~0 = foo
5858 foo~1 = foo^1 = foo^ = first parent of foo
5859 foo~2 = foo^1^1 = foo^^ = first parent of first parent of foo
5860
5861 patchbomb
5862 command to send changesets as (a series of) patch emails
5863
5864 The series is started off with a "[PATCH 0 of N]" introduction, which
5865 describes the series as a whole.
5866
5867 Each patch email has a Subject line of "[PATCH M of N] ...", using the
5868 first line of the changeset description as the subject text. The mes‐
5869 sage contains two or three body parts:
5870
5871 · The changeset description.
5872
5873 · [Optional] The result of running diffstat on the patch.
5874
5875 · The patch itself, as generated by hg export.
5876
5877 Each message refers to the first in the series using the In-Reply-To
5878 and References headers, so they will show up as a sequence in threaded
5879 mail and news readers, and in mail archives.
5880
5881 To configure other defaults, add a section like this to your configura‐
5882 tion file:
5883
5884 [email]
5885 from = My Name <my@email>
5886 to = recipient1, recipient2, ...
5887 cc = cc1, cc2, ...
5888 bcc = bcc1, bcc2, ...
5889 reply-to = address1, address2, ...
5890
5891 Use [patchbomb] as configuration section name if you need to override
5892 global [email] address settings.
5893
5894 Then you can use the hg email command to mail a series of changesets as
5895 a patchbomb.
5896
5897 You can also either configure the method option in the email section to
5898 be a sendmail compatible mailer or fill out the [smtp] section so that
5899 the patchbomb extension can automatically send patchbombs directly from
5900 the commandline. See the [email] and [smtp] sections in hgrc(5) for
5901 details.
5902
5903 Commands
5904 email
5905 hg email [OPTION]... [DEST]...
5906
5907 By default, diffs are sent in the format generated by hg export, one
5908 per message. The series starts with a "[PATCH 0 of N]" introduction,
5909 which describes the series as a whole.
5910
5911 Each patch email has a Subject line of "[PATCH M of N] ...", using the
5912 first line of the changeset description as the subject text. The mes‐
5913 sage contains two or three parts. First, the changeset description.
5914
5915 With the -d/--diffstat option, if the diffstat program is installed,
5916 the result of running diffstat on the patch is inserted.
5917
5918 Finally, the patch itself, as generated by hg export.
5919
5920 With the -d/--diffstat or -c/--confirm options, you will be presented
5921 with a final summary of all messages and asked for confirmation before
5922 the messages are sent.
5923
5924 By default the patch is included as text in the email body for easy
5925 reviewing. Using the -a/--attach option will instead create an attach‐
5926 ment for the patch. With -i/--inline an inline attachment will be cre‐
5927 ated.
5928
5929 With -o/--outgoing, emails will be generated for patches not found in
5930 the destination repository (or only those which are ancestors of the
5931 specified revisions if any are provided)
5932
5933 With -b/--bundle, changesets are selected as for --outgoing, but a sin‐
5934 gle email containing a binary Mercurial bundle as an attachment will be
5935 sent.
5936
5937 With -m/--mbox, instead of previewing each patchbomb message in a pager
5938 or sending the messages directly, it will create a UNIX mailbox file
5939 with the patch emails. This mailbox file can be previewed with any mail
5940 user agent which supports UNIX mbox files.
5941
5942 With -n/--test, all steps will run, but mail will not be sent. You
5943 will be prompted for an email recipient address, a subject and an
5944 introductory message describing the patches of your patchbomb. Then
5945 when all is done, patchbomb messages are displayed. If the PAGER envi‐
5946 ronment variable is set, your pager will be fired up once for each
5947 patchbomb message, so you can verify everything is alright.
5948
5949 In case email sending fails, you will find a backup of your series
5950 introductory message in .hg/last-email.txt.
5951
5952 Examples:
5953
5954 hg email -r 3000 # send patch 3000 only
5955 hg email -r 3000 -r 3001 # send patches 3000 and 3001
5956 hg email -r 3000:3005 # send patches 3000 through 3005
5957 hg email 3000 # send patch 3000 (deprecated)
5958
5959 hg email -o # send all patches not in default
5960 hg email -o DEST # send all patches not in DEST
5961 hg email -o -r 3000 # send all ancestors of 3000 not in default
5962 hg email -o -r 3000 DEST # send all ancestors of 3000 not in DEST
5963
5964 hg email -b # send bundle of all patches not in default
5965 hg email -b DEST # send bundle of all patches not in DEST
5966 hg email -b -r 3000 # bundle of all ancestors of 3000 not in default
5967 hg email -b -r 3000 DEST # bundle of all ancestors of 3000 not in DEST
5968
5969 hg email -o -m mbox && # generate an mbox file...
5970 mutt -R -f mbox # ... and view it with mutt
5971 hg email -o -m mbox && # generate an mbox file ...
5972 formail -s sendmail \ # ... and use formail to send from the mbox
5973 -bm -t < mbox # ... using sendmail
5974
5975 Before using this command, you will need to enable email in your hgrc.
5976 See the [email] section in hgrc(5) for details.
5977
5978 Options:
5979
5980 -g, --git
5981 use git extended diff format
5982
5983 --plain
5984 omit hg patch header
5985
5986 -o, --outgoing
5987 send changes not found in the target repository
5988
5989 -b, --bundle
5990 send changes not in target as a binary bundle
5991
5992 --bundlename
5993 name of the bundle attachment file (default: bundle)
5994
5995 -r, --rev
5996 a revision to send
5997
5998 --force
5999 run even when remote repository is unrelated (with -b/--bundle)
6000
6001 --base a base changeset to specify instead of a destination (with
6002 -b/--bundle)
6003
6004 --intro
6005 send an introduction email for a single patch
6006
6007 -a, --attach
6008 send patches as attachments
6009
6010 -i, --inline
6011 send patches as inline attachments
6012
6013 --bcc email addresses of blind carbon copy recipients
6014
6015 -c, --cc
6016 email addresses of copy recipients
6017
6018 --confirm
6019 ask for confirmation before sending
6020
6021 -d, --diffstat
6022 add diffstat output to messages
6023
6024 --date use the given date as the sending date
6025
6026 --desc use the given file as the series description
6027
6028 -f, --from
6029 email address of sender
6030
6031 -n, --test
6032 print messages that would be sent
6033
6034 -m, --mbox
6035 write messages to mbox file instead of sending them
6036
6037 --reply-to
6038 email addresses replies should be sent to
6039
6040 -s, --subject
6041 subject of first message (intro or single patch)
6042
6043 --in-reply-to
6044 message identifier to reply to
6045
6046 --flag flags to add in subject prefixes
6047
6048 -t, --to
6049 email addresses of recipients
6050
6051 -e, --ssh
6052 specify ssh command to use
6053
6054 --remotecmd
6055 specify hg command to run on the remote side
6056
6057 --insecure
6058 do not verify server certificate (ignoring web.cacerts config)
6059
6060 progress
6061 show progress bars for some actions
6062
6063 This extension uses the progress information logged by hg commands to
6064 draw progress bars that are as informative as possible. Some progress
6065 bars only offer indeterminate information, while others have a definite
6066 end point.
6067
6068 The following settings are available:
6069
6070 [progress]
6071 delay = 3 # number of seconds (float) before showing the progress bar
6072 refresh = 0.1 # time in seconds between refreshes of the progress bar
6073 format = topic bar number estimate # format of the progress bar
6074 width = <none> # if set, the maximum width of the progress information
6075 # (that is, min(width, term width) will be used)
6076 clear-complete = True # clear the progress bar after it's done
6077 disable = False # if true, don't show a progress bar
6078 assume-tty = False # if true, ALWAYS show a progress bar, unless
6079 # disable is given
6080
6081 Valid entries for the format field are topic, bar, number, unit, esti‐
6082 mate, and item. item defaults to the last 20 characters of the item,
6083 but this can be changed by adding either -<num> which would take the
6084 last num characters, or +<num> for the first num characters.
6085
6086 purge
6087 command to delete untracked files from the working directory
6088
6089 Commands
6090 purge
6091 hg purge [OPTION]... [DIR]...
6092
6093 Delete files not known to Mercurial. This is useful to test local and
6094 uncommitted changes in an otherwise-clean source tree.
6095
6096 This means that purge will delete:
6097
6098 · Unknown files: files marked with "?" by hg status
6099
6100 · Empty directories: in fact Mercurial ignores directories unless they
6101 contain files under source control management
6102
6103 But it will leave untouched:
6104
6105 · Modified and unmodified tracked files
6106
6107 · Ignored files (unless --all is specified)
6108
6109 · New files added to the repository (with hg add)
6110
6111 If directories are given on the command line, only files in these
6112 directories are considered.
6113
6114 Be careful with purge, as you could irreversibly delete some files you
6115 forgot to add to the repository. If you only want to print the list of
6116 files that this program would delete, use the --print option.
6117
6118 Options:
6119
6120 -a, --abort-on-err
6121 abort if an error occurs
6122
6123 --all purge ignored files too
6124
6125 -p, --print
6126 print filenames instead of deleting them
6127
6128 -0, --print0
6129 end filenames with NUL, for use with xargs (implies -p/--print)
6130
6131 -I, --include
6132 include names matching the given patterns
6133
6134 -X, --exclude
6135 exclude names matching the given patterns
6136
6137 aliases: clean
6138
6139 rebase
6140 command to move sets of revisions to a different ancestor
6141
6142 This extension lets you rebase changesets in an existing Mercurial
6143 repository.
6144
6145 For more information: http://mercurial.selenic.com/wiki/RebaseExtension
6146
6147 Commands
6148 rebase
6149 hg rebase [-s REV | -b REV] [-d REV] [options]
6150 hg rebase {-a|-c}
6151
6152 Rebase uses repeated merging to graft changesets from one part of his‐
6153 tory (the source) onto another (the destination). This can be useful
6154 for linearizing local changes relative to a master development tree.
6155
6156 You should not rebase changesets that have already been shared with
6157 others. Doing so will force everybody else to perform the same rebase
6158 or they will end up with duplicated changesets after pulling in your
6159 rebased changesets.
6160
6161 If you don't specify a destination changeset (-d/--dest), rebase uses
6162 the tipmost head of the current named branch as the destination. (The
6163 destination changeset is not modified by rebasing, but new changesets
6164 are added as its descendants.)
6165
6166 You can specify which changesets to rebase in two ways: as a "source"
6167 changeset or as a "base" changeset. Both are shorthand for a topologi‐
6168 cally related set of changesets (the "source branch"). If you specify
6169 source (-s/--source), rebase will rebase that changeset and all of its
6170 descendants onto dest. If you specify base (-b/--base), rebase will
6171 select ancestors of base back to but not including the common ancestor
6172 with dest. Thus, -b is less precise but more convenient than -s: you
6173 can specify any changeset in the source branch, and rebase will select
6174 the whole branch. If you specify neither -s nor -b, rebase uses the
6175 parent of the working directory as the base.
6176
6177 By default, rebase recreates the changesets in the source branch as
6178 descendants of dest and then destroys the originals. Use --keep to pre‐
6179 serve the original source changesets. Some changesets in the source
6180 branch (e.g. merges from the destination branch) may be dropped if they
6181 no longer contribute any change.
6182
6183 One result of the rules for selecting the destination changeset and
6184 source branch is that, unlike merge, rebase will do nothing if you are
6185 at the latest (tipmost) head of a named branch with two heads. You need
6186 to explicitly specify source and/or destination (or update to the other
6187 head, if it's the head of the intended source branch).
6188
6189 If a rebase is interrupted to manually resolve a merge, it can be con‐
6190 tinued with --continue/-c or aborted with --abort/-a.
6191
6192 Returns 0 on success, 1 if nothing to rebase.
6193
6194 Options:
6195
6196 -s, --source
6197 rebase from the specified changeset
6198
6199 -b, --base
6200 rebase from the base of the specified changeset (up to greatest
6201 common ancestor of base and dest)
6202
6203 -d, --dest
6204 rebase onto the specified changeset
6205
6206 --collapse
6207 collapse the rebased changesets
6208
6209 --keep keep original changesets
6210
6211 --keepbranches
6212 keep original branch names
6213
6214 --detach
6215 force detaching of source from its original branch
6216
6217 -c, --continue
6218 continue an interrupted rebase
6219
6220 -a, --abort
6221 abort an interrupted rebase
6222
6223 --style
6224 display using template map file
6225
6226 --template
6227 display with template
6228
6229 record
6230 commands to interactively select changes for commit/qrefresh
6231
6232 Commands
6233 record
6234 hg record [OPTION]... [FILE]...
6235
6236 If a list of files is omitted, all changes reported by hg status will
6237 be candidates for recording.
6238
6239 See hg help dates for a list of formats valid for -d/--date.
6240
6241 You will be prompted for whether to record changes to each modified
6242 file, and for files with multiple changes, for each change to use. For
6243 each query, the following responses are possible:
6244
6245 y - record this change
6246 n - skip this change
6247
6248 s - skip remaining changes to this file
6249 f - record remaining changes to this file
6250
6251 d - done, skip remaining changes and files
6252 a - record all changes to all remaining files
6253 q - quit, recording no changes
6254
6255 ? - display help
6256
6257 This command is not available when committing a merge.
6258
6259 Options:
6260
6261 -A, --addremove
6262 mark new/missing files as added/removed before committing
6263
6264 --close-branch
6265 mark a branch as closed, hiding it from the branch list
6266
6267 -I, --include
6268 include names matching the given patterns
6269
6270 -X, --exclude
6271 exclude names matching the given patterns
6272
6273 -m, --message
6274 use text as commit message
6275
6276 -l, --logfile
6277 read commit message from file
6278
6279 -d, --date
6280 record the specified date as commit date
6281
6282 -u, --user
6283 record the specified user as committer
6284
6285 relink
6286 recreates hardlinks between repository clones
6287
6288 Commands
6289 relink
6290 hg relink [ORIGIN]
6291
6292 When repositories are cloned locally, their data files will be
6293 hardlinked so that they only use the space of a single repository.
6294
6295 Unfortunately, subsequent pulls into either repository will break
6296 hardlinks for any files touched by the new changesets, even if both
6297 repositories end up pulling the same changes.
6298
6299 Similarly, passing --rev to "hg clone" will fail to use any hardlinks,
6300 falling back to a complete copy of the source repository.
6301
6302 This command lets you recreate those hardlinks and reclaim that wasted
6303 space.
6304
6305 This repository will be relinked to share space with ORIGIN, which must
6306 be on the same local disk. If ORIGIN is omitted, looks for
6307 "default-relink", then "default", in [paths].
6308
6309 Do not attempt any read operations on this repository while the command
6310 is running. (Both repositories will be locked against writes.)
6311
6312 schemes
6313 extend schemes with shortcuts to repository swarms
6314
6315 This extension allows you to specify shortcuts for parent URLs with a
6316 lot of repositories to act like a scheme, for example:
6317
6318 [schemes]
6319 py = http://code.python.org/hg/
6320
6321 After that you can use it like:
6322
6323 hg clone py://trunk/
6324
6325 Additionally there is support for some more complex schemas, for exam‐
6326 ple used by Google Code:
6327
6328 [schemes]
6329 gcode = http://{1}.googlecode.com/hg/
6330
6331 The syntax is taken from Mercurial templates, and you have unlimited
6332 number of variables, starting with {1} and continuing with {2}, {3} and
6333 so on. This variables will receive parts of URL supplied, split by /.
6334 Anything not specified as {part} will be just appended to an URL.
6335
6336 For convenience, the extension adds these schemes by default:
6337
6338 [schemes]
6339 py = http://hg.python.org/
6340 bb = https://bitbucket.org/
6341 bb+ssh = ssh://hg@bitbucket.org/
6342 gcode = https://{1}.googlecode.com/hg/
6343 kiln = https://{1}.kilnhg.com/Repo/
6344
6345 You can override a predefined scheme by defining a new scheme with the
6346 same name.
6347
6348 share
6349 share a common history between several working directories
6350
6351 Commands
6352 share
6353 hg share [-U] SOURCE [DEST]
6354
6355 Initialize a new repository and working directory that shares its his‐
6356 tory with another repository.
6357
6358 Note using rollback or extensions that destroy/modify history (mq,
6359 rebase, etc.) can cause considerable confusion with shared
6360 clones. In particular, if two shared clones are both updated to
6361 the same changeset, and one of them destroys that changeset with
6362 rollback, the other clone will suddenly stop working: all opera‐
6363 tions will fail with "abort: working directory has unknown par‐
6364 ent". The only known workaround is to use debugsetparents on the
6365 broken clone to reset it to a changeset that still exists (e.g.
6366 tip).
6367
6368 Options:
6369
6370 -U, --noupdate
6371 do not create a working copy
6372
6373 transplant
6374 command to transplant changesets from another branch
6375
6376 This extension allows you to transplant patches from another branch.
6377
6378 Transplanted patches are recorded in .hg/transplant/transplants, as a
6379 map from a changeset hash to its hash in the source repository.
6380
6381 Commands
6382 transplant
6383 hg transplant [-s REPO] [-b BRANCH [-a]] [-p REV] [-m REV] [REV]...
6384
6385 Selected changesets will be applied on top of the current working
6386 directory with the log of the original changeset. The changesets are
6387 copied and will thus appear twice in the history. Use the rebase exten‐
6388 sion instead if you want to move a whole branch of unpublished change‐
6389 sets.
6390
6391 If --log is specified, log messages will have a comment appended of the
6392 form:
6393
6394 (transplanted from CHANGESETHASH)
6395
6396 You can rewrite the changelog message with the --filter option. Its
6397 argument will be invoked with the current changelog message as $1 and
6398 the patch as $2.
6399
6400 If --source/-s is specified, selects changesets from the named reposi‐
6401 tory. If --branch/-b is specified, selects changesets from the branch
6402 holding the named revision, up to that revision. If --all/-a is speci‐
6403 fied, all changesets on the branch will be transplanted, otherwise you
6404 will be prompted to select the changesets you want.
6405
6406 hg transplant --branch REVISION --all will transplant the selected
6407 branch (up to the named revision) onto your current working directory.
6408
6409 You can optionally mark selected transplanted changesets as merge
6410 changesets. You will not be prompted to transplant any ancestors of a
6411 merged transplant, and you can merge descendants of them normally
6412 instead of transplanting them.
6413
6414 If no merges or revisions are provided, hg transplant will start an
6415 interactive changeset browser.
6416
6417 If a changeset application fails, you can fix the merge by hand and
6418 then resume where you left off by calling hg transplant --continue/-c.
6419
6420 Options:
6421
6422 -s, --source
6423 pull patches from REPO
6424
6425 -b, --branch
6426 pull patches from branch BRANCH
6427
6428 -a, --all
6429 pull all changesets up to BRANCH
6430
6431 -p, --prune
6432 skip over REV
6433
6434 -m, --merge
6435 merge at REV
6436
6437 --log append transplant info to log message
6438
6439 -c, --continue
6440 continue last transplant session after repair
6441
6442 --filter
6443 filter changesets through command
6444
6445 win32mbcs
6446 allow the use of MBCS paths with problematic encodings
6447
6448 Some MBCS encodings are not good for some path operations (i.e. split‐
6449 ting path, case conversion, etc.) with its encoded bytes. We call such
6450 a encoding (i.e. shift_jis and big5) as "problematic encoding". This
6451 extension can be used to fix the issue with those encodings by wrapping
6452 some functions to convert to Unicode string before path operation.
6453
6454 This extension is useful for:
6455
6456 · Japanese Windows users using shift_jis encoding.
6457
6458 · Chinese Windows users using big5 encoding.
6459
6460 · All users who use a repository with one of problematic encodings on
6461 case-insensitive file system.
6462
6463 This extension is not needed for:
6464
6465 · Any user who use only ASCII chars in path.
6466
6467 · Any user who do not use any of problematic encodings.
6468
6469 Note that there are some limitations on using this extension:
6470
6471 · You should use single encoding in one repository.
6472
6473 · If the repository path ends with 0x5c, .hg/hgrc cannot be read.
6474
6475 · win32mbcs is not compatible with fixutf8 extension.
6476
6477 By default, win32mbcs uses encoding.encoding decided by Mercurial. You
6478 can specify the encoding by config option:
6479
6480 [win32mbcs]
6481 encoding = sjis
6482
6483 It is useful for the users who want to commit with UTF-8 log message.
6484
6485 win32text
6486 perform automatic newline conversion
6487
6488 Deprecation: The win32text extension requires each user to configure
6489 the extension again and again for each clone since the configuration
6490 is not copied when cloning.
6491
6492 We have therefore made the eol as an alternative. The eol uses a
6493 version controlled file for its configuration and each clone will
6494 therefore use the right settings from the start.
6495
6496 To perform automatic newline conversion, use:
6497
6498 [extensions]
6499 win32text =
6500 [encode]
6501 ** = cleverencode:
6502 # or ** = macencode:
6503
6504 [decode]
6505 ** = cleverdecode:
6506 # or ** = macdecode:
6507
6508 If not doing conversion, to make sure you do not commit CRLF/CR by
6509 accident:
6510
6511 [hooks]
6512 pretxncommit.crlf = python:hgext.win32text.forbidcrlf
6513 # or pretxncommit.cr = python:hgext.win32text.forbidcr
6514
6515 To do the same check on a server to prevent CRLF/CR from being pushed
6516 or pulled:
6517
6518 [hooks]
6519 pretxnchangegroup.crlf = python:hgext.win32text.forbidcrlf
6520 # or pretxnchangegroup.cr = python:hgext.win32text.forbidcr
6521
6522 zeroconf
6523 discover and advertise repositories on the local network
6524
6525 Zeroconf-enabled repositories will be announced in a network without
6526 the need to configure a server or a service. They can be discovered
6527 without knowing their actual IP address.
6528
6529 To allow other people to discover your repository using run hg serve in
6530 your repository:
6531
6532 $ cd test
6533 $ hg serve
6534
6535 You can discover Zeroconf-enabled repositories by running hg paths:
6536
6537 $ hg paths
6538 zc-test = http://example.com:8000/test
6539
6541 .hgignore
6542
6543 This file contains regular expressions (one per line) that
6544 describe file names that should be ignored by hg. For details,
6545 see hgignore(5).
6546
6547 .hgtags
6548
6549 This file contains changeset hash values and text tag names (one
6550 of each separated by spaces) that correspond to tagged versions
6551 of the repository contents.
6552
6553 /etc/mercurial/hgrc, $HOME/.hgrc, .hg/hgrc
6554
6555 This file contains defaults and configuration. Values in
6556 .hg/hgrc override those in $HOME/.hgrc, and these override set‐
6557 tings made in the global /etc/mercurial/hgrc configuration. See
6558 hgrc(5) for details of the contents and format of these files.
6559
6560 Some commands (e.g. revert) produce backup files ending in .orig, if
6561 the .orig file already exists and is not tracked by Mercurial, it will
6562 be overwritten.
6563
6565 Probably lots, please post them to the mailing list (see Resources
6566 below) when you find them.
6567
6569 hgignore(5), hgrc(5)
6570
6572 Written by Matt Mackall <mpm@selenic.com>
6573
6575 Main Web Site: http://mercurial.selenic.com/
6576
6577 Source code repository: http://selenic.com/hg
6578
6579 Mailing list: http://selenic.com/mailman/listinfo/mercurial
6580
6582 Copyright (C) 2005-2010 Matt Mackall. Free use of this software is
6583 granted under the terms of the GNU General Public License version 2 or
6584 any later version.
6585
6587 Matt Mackall <mpm@selenic.com>
6588
6589 Organization: Mercurial
6590
6591
6592
6593
6594 HG(1)