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 re‐
24 vision 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 <REPO>
33 repository root directory or name of overlay bundle file
34
35 --cwd <DIR>
36 change working directory
37
38 -y, --noninteractive
39 do not prompt, automatically pick the first choice for all
40 prompts
41
42 -q, --quiet
43 suppress output
44
45 -v, --verbose
46 enable additional output
47
48 --color <TYPE>
49 when to colorize (boolean, always, auto, never, or debug)
50
51 --config <CONFIG[+]>
52 set/override config option (use 'section.name=value')
53
54 --debug
55 enable debugging output
56
57 --debugger
58 start debugger
59
60 --encoding <ENCODE>
61 set the charset encoding (default: UTF-8)
62
63 --encodingmode <MODE>
64 set the charset encoding mode (default: strict)
65
66 --traceback
67 always print a traceback on exception
68
69 --time time how long the command takes
70
71 --profile
72 print command execution profile
73
74 --version
75 output version information and exit
76
77 -h, --help
78 display help and exit
79
80 --hidden
81 consider hidden changesets
82
83 --pager <TYPE>
84 when to paginate (boolean, always, auto, or never) (default:
85 auto)
86
87 [+] marked option can be specified multiple times
88
90 Repository creation
91 clone
92 make a copy of an existing repository:
93
94 hg clone [OPTION]... SOURCE [DEST]
95
96 Create a copy of an existing repository in a new directory.
97
98 If no destination directory name is specified, it defaults to the base‐
99 name of the source.
100
101 The location of the source is added to the new repository's .hg/hgrc
102 file, as the default to be used for future pulls.
103
104 Only local paths and ssh:// URLs are supported as destinations. For
105 ssh:// destinations, no working directory or .hg/hgrc will be created
106 on the remote side.
107
108 If the source repository has a bookmark called '@' set, that revision
109 will be checked out in the new repository by default.
110
111 To check out a particular version, use -u/--update, or -U/--noupdate to
112 create a clone with no working directory.
113
114 To pull only a subset of changesets, specify one or more revisions
115 identifiers with -r/--rev or branches with -b/--branch. The resulting
116 clone will contain only the specified changesets and their ancestors.
117 These options (or 'clone src#rev dest') imply --pull, even for local
118 source repositories.
119
120 In normal clone mode, the remote normalizes repository data into a com‐
121 mon exchange format and the receiving end translates this data into its
122 local storage format. --stream activates a different clone mode that
123 essentially copies repository files from the remote with minimal data
124 processing. This significantly reduces the CPU cost of a clone both re‐
125 motely and locally. However, it often increases the transferred data
126 size by 30-40%. This can result in substantially faster clones where
127 I/O throughput is plentiful, especially for larger repositories. A
128 side-effect of --stream clones is that storage settings and require‐
129 ments on the remote are applied locally: a modern client may inherit
130 legacy or inefficient storage used by the remote or a legacy Mercurial
131 client may not be able to clone from a modern Mercurial remote.
132
133 Note Specifying a tag will include the tagged changeset but not the
134 changeset containing the tag.
135
136 For efficiency, hardlinks are used for cloning whenever the source and
137 destination are on the same filesystem (note this applies only to the
138 repository data, not to the working directory). Some filesystems, such
139 as AFS, implement hardlinking incorrectly, but do not report errors. In
140 these cases, use the --pull option to avoid hardlinking.
141
142 Mercurial will update the working directory to the first applicable re‐
143 vision from this list:
144
145 a. null if -U or the source repository has no changesets
146
147 b. if -u . and the source repository is local, the first parent of the
148 source repository's working directory
149
150 c. the changeset specified with -u (if a branch name, this means the
151 latest head of that branch)
152
153 d. the changeset specified with -r
154
155 e. the tipmost head specified with -b
156
157 f. the tipmost head specified with the url#branch source syntax
158
159 g. the revision marked with the '@' bookmark, if present
160
161 h. the tipmost head of the default branch
162
163 i. tip
164
165 When cloning from servers that support it, Mercurial may fetch pre-gen‐
166 erated data from a server-advertised URL or inline from the same
167 stream. When this is done, hooks operating on incoming changesets and
168 changegroups may fire more than once, once for each pre-generated bun‐
169 dle and as well as for any additional remaining data. In addition, if
170 an error occurs, the repository may be rolled back to a partial clone.
171 This behavior may change in future releases. See hg help -e cloneb‐
172 undles for more.
173
174 Examples:
175
176 • clone a remote repository to a new directory named hg/:
177
178 hg clone https://www.mercurial-scm.org/repo/hg/
179
180 • create a lightweight local clone:
181
182 hg clone project/ project-feature/
183
184 • clone from an absolute path on an ssh server (note double-slash):
185
186 hg clone ssh://user@server//home/projects/alpha/
187
188 • do a streaming clone while checking out a specified version:
189
190 hg clone --stream http://server/repo -u 1.5
191
192 • create a repository without changesets after a particular revision:
193
194 hg clone -r 04e544 experimental/ good/
195
196 • clone (and track) a particular named branch:
197
198 hg clone https://www.mercurial-scm.org/repo/hg/#stable
199
200 See hg help urls for details on specifying URLs.
201
202 Returns 0 on success.
203
204 Options:
205
206 -U, --noupdate
207 the clone will include an empty working directory (only a repos‐
208 itory)
209
210 -u,--updaterev <REV>
211 revision, tag, or branch to check out
212
213 -r,--rev <REV[+]>
214 do not clone everything, but include this changeset and its an‐
215 cestors
216
217 -b,--branch <BRANCH[+]>
218 do not clone everything, but include this branch's changesets
219 and their ancestors
220
221 --pull use pull protocol to copy metadata
222
223 --uncompressed
224 an alias to --stream (DEPRECATED)
225
226 --stream
227 clone with minimal data processing
228
229 -e,--ssh <CMD>
230 specify ssh command to use
231
232 --remotecmd <CMD>
233 specify hg command to run on the remote side
234
235 --insecure
236 do not verify server certificate (ignoring web.cacerts config)
237
238 [+] marked option can be specified multiple times
239
240 init
241 create a new repository in the given directory:
242
243 hg init [-e CMD] [--remotecmd CMD] [DEST]
244
245 Initialize a new repository in the given directory. If the given direc‐
246 tory does not exist, it will be created.
247
248 If no directory is given, the current directory is used.
249
250 It is possible to specify an ssh:// URL as the destination. See hg
251 help urls for more information.
252
253 Returns 0 on success.
254
255 Options:
256
257 -e,--ssh <CMD>
258 specify ssh command to use
259
260 --remotecmd <CMD>
261 specify hg command to run on the remote side
262
263 --insecure
264 do not verify server certificate (ignoring web.cacerts config)
265
266 Remote repository management
267 incoming
268 show new changesets found in source:
269
270 hg incoming [-p] [-n] [-M] [-f] [-r REV]... [--bundle FILENAME] [SOURCE]
271
272 Show new changesets found in the specified path/URL or the default pull
273 location. These are the changesets that would have been pulled by hg
274 pull at the time you issued this command.
275
276 See pull for valid source format details.
277
278 With -B/--bookmarks, the result of bookmark comparison between local
279 and remote repositories is displayed. With -v/--verbose, status is also
280 displayed for each bookmark like below:
281
282 BM1 01234567890a added
283 BM2 1234567890ab advanced
284 BM3 234567890abc diverged
285 BM4 34567890abcd changed
286
287 The action taken locally when pulling depends on the status of each
288 bookmark:
289
290 added
291
292 pull will create it
293
294 advanced
295
296 pull will update it
297
298 diverged
299
300 pull will create a divergent bookmark
301
302 changed
303
304 result depends on remote changesets
305
306 From the point of view of pulling behavior, bookmark existing only in
307 the remote repository are treated as added, even if it is in fact lo‐
308 cally deleted.
309
310 For remote repository, using --bundle avoids downloading the changesets
311 twice if the incoming is followed by a pull.
312
313 Examples:
314
315 • show incoming changes with patches and full description:
316
317 hg incoming -vp
318
319 • show incoming changes excluding merges, store a bundle:
320
321 hg in -vpM --bundle incoming.hg
322 hg pull incoming.hg
323
324 • briefly list changes inside a bundle:
325
326 hg in changes.hg -T "{desc|firstline}\n"
327
328 Returns 0 if there are incoming changes, 1 otherwise.
329
330 Options:
331
332 -f, --force
333 run even if remote repository is unrelated
334
335 -n, --newest-first
336 show newest record first
337
338 --bundle <FILE>
339 file to store the bundles into
340
341 -r,--rev <REV[+]>
342 a remote changeset intended to be added
343
344 -B, --bookmarks
345 compare bookmarks
346
347 -b,--branch <BRANCH[+]>
348 a specific branch you would like to pull
349
350 -p, --patch
351 show patch
352
353 -g, --git
354 use git extended diff format
355
356 -l,--limit <NUM>
357 limit number of changes displayed
358
359 -M, --no-merges
360 do not show merges
361
362 --stat output diffstat-style summary of changes
363
364 -G, --graph
365 show the revision DAG
366
367 --style <STYLE>
368 display using template map file (DEPRECATED)
369
370 -T,--template <TEMPLATE>
371 display with template
372
373 -e,--ssh <CMD>
374 specify ssh command to use
375
376 --remotecmd <CMD>
377 specify hg command to run on the remote side
378
379 --insecure
380 do not verify server certificate (ignoring web.cacerts config)
381
382 -S, --subrepos
383 recurse into subrepositories
384
385 [+] marked option can be specified multiple times
386
387 aliases: in
388
389 outgoing
390 show changesets not found in the destination:
391
392 hg outgoing [-M] [-p] [-n] [-f] [-r REV]... [DEST]
393
394 Show changesets not found in the specified destination repository or
395 the default push location. These are the changesets that would be
396 pushed if a push was requested.
397
398 See pull for details of valid destination formats.
399
400 With -B/--bookmarks, the result of bookmark comparison between local
401 and remote repositories is displayed. With -v/--verbose, status is also
402 displayed for each bookmark like below:
403
404 BM1 01234567890a added
405 BM2 deleted
406 BM3 234567890abc advanced
407 BM4 34567890abcd diverged
408 BM5 4567890abcde changed
409
410 The action taken when pushing depends on the status of each bookmark:
411
412 added
413
414 push with -B will create it
415
416 deleted
417
418 push with -B will delete it
419
420 advanced
421
422 push will update it
423
424 diverged
425
426 push with -B will update it
427
428 changed
429
430 push with -B will update it
431
432 From the point of view of pushing behavior, bookmarks existing only in
433 the remote repository are treated as deleted, even if it is in fact
434 added remotely.
435
436 Returns 0 if there are outgoing changes, 1 otherwise.
437
438 Options:
439
440 -f, --force
441 run even when the destination is unrelated
442
443 -r,--rev <REV[+]>
444 a changeset intended to be included in the destination
445
446 -n, --newest-first
447 show newest record first
448
449 -B, --bookmarks
450 compare bookmarks
451
452 -b,--branch <BRANCH[+]>
453 a specific branch you would like to push
454
455 -p, --patch
456 show patch
457
458 -g, --git
459 use git extended diff format
460
461 -l,--limit <NUM>
462 limit number of changes displayed
463
464 -M, --no-merges
465 do not show merges
466
467 --stat output diffstat-style summary of changes
468
469 -G, --graph
470 show the revision DAG
471
472 --style <STYLE>
473 display using template map file (DEPRECATED)
474
475 -T,--template <TEMPLATE>
476 display with template
477
478 -e,--ssh <CMD>
479 specify ssh command to use
480
481 --remotecmd <CMD>
482 specify hg command to run on the remote side
483
484 --insecure
485 do not verify server certificate (ignoring web.cacerts config)
486
487 -S, --subrepos
488 recurse into subrepositories
489
490 [+] marked option can be specified multiple times
491
492 aliases: out
493
494 paths
495 show aliases for remote repositories:
496
497 hg paths [NAME]
498
499 Show definition of symbolic path name NAME. If no name is given, show
500 definition of all available names.
501
502 Option -q/--quiet suppresses all output when searching for NAME and
503 shows only the path names when listing all definitions.
504
505 Path names are defined in the [paths] section of your configuration
506 file and in /etc/mercurial/hgrc. If run inside a repository, .hg/hgrc
507 is used, too.
508
509 The path names default and default-push have a special meaning. When
510 performing a push or pull operation, they are used as fallbacks if no
511 location is specified on the command-line. When default-push is set,
512 it will be used for push and default will be used for pull; otherwise
513 default is used as the fallback for both. When cloning a repository,
514 the clone source is written as default in .hg/hgrc.
515
516 Note default and default-push apply to all inbound (e.g. hg incoming
517 ) and outbound (e.g. hg outgoing, hg email and hg bundle) opera‐
518 tions.
519
520 See hg help urls for more information.
521
522 Template:
523
524 The following keywords are supported. See also hg help templates.
525
526 name String. Symbolic name of the path alias.
527
528 pushurl
529 String. URL for push operations.
530
531 url String. URL or directory path for the other operations.
532
533 Returns 0 on success.
534
535 Options:
536
537 -T,--template <TEMPLATE>
538 display with template
539
540 pull
541 pull changes from the specified source:
542
543 hg pull [-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [SOURCE]
544
545 Pull changes from a remote repository to a local one.
546
547 This finds all changes from the repository at the specified path or URL
548 and adds them to a local repository (the current one unless -R is spec‐
549 ified). By default, this does not update the copy of the project in the
550 working directory.
551
552 When cloning from servers that support it, Mercurial may fetch pre-gen‐
553 erated data. When this is done, hooks operating on incoming changesets
554 and changegroups may fire more than once, once for each pre-generated
555 bundle and as well as for any additional remaining data. See hg help -e
556 clonebundles for more.
557
558 Use hg incoming if you want to see what would have been added by a pull
559 at the time you issued this command. If you then decide to add those
560 changes to the repository, you should use hg pull -r X where X is the
561 last changeset listed by hg incoming.
562
563 If SOURCE is omitted, the 'default' path will be used. See hg help
564 urls for more information.
565
566 Specifying bookmark as . is equivalent to specifying the active book‐
567 mark's name.
568
569 Returns 0 on success, 1 if an update had unresolved files.
570
571 Options:
572
573 -u, --update
574 update to new branch head if new descendants were pulled
575
576 -f, --force
577 run even when remote repository is unrelated
578
579 --confirm
580 confirm pull before applying changes
581
582 -r,--rev <REV[+]>
583 a remote changeset intended to be added
584
585 -B,--bookmark <BOOKMARK[+]>
586 bookmark to pull
587
588 -b,--branch <BRANCH[+]>
589 a specific branch you would like to pull
590
591 -e,--ssh <CMD>
592 specify ssh command to use
593
594 --remotecmd <CMD>
595 specify hg command to run on the remote side
596
597 --insecure
598 do not verify server certificate (ignoring web.cacerts config)
599
600 [+] marked option can be specified multiple times
601
602 push
603 push changes to the specified destination:
604
605 hg push [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]
606
607 Push changesets from the local repository to the specified destination.
608
609 This operation is symmetrical to pull: it is identical to a pull in the
610 destination repository from the current one.
611
612 By default, push will not allow creation of new heads at the destina‐
613 tion, since multiple heads would make it unclear which head to use. In
614 this situation, it is recommended to pull and merge before pushing.
615
616 Use --new-branch if you want to allow push to create a new named branch
617 that is not present at the destination. This allows you to only create
618 a new branch without forcing other changes.
619
620 Note Extra care should be taken with the -f/--force option, which
621 will push all new heads on all branches, an action which will
622 almost always cause confusion for collaborators.
623
624 If -r/--rev is used, the specified revision and all its ancestors will
625 be pushed to the remote repository.
626
627 If -B/--bookmark is used, the specified bookmarked revision, its ances‐
628 tors, and the bookmark will be pushed to the remote repository. Speci‐
629 fying . is equivalent to specifying the active bookmark's name. Use the
630 --all-bookmarks option for pushing all current bookmarks.
631
632 Please see hg help urls for important details about ssh:// URLs. If
633 DESTINATION is omitted, a default path will be used.
634
635 The --pushvars option sends strings to the server that become environ‐
636 ment variables prepended with HG_USERVAR_. For example, --pushvars EN‐
637 ABLE_FEATURE=true, provides the server side hooks with HG_USERVAR_EN‐
638 ABLE_FEATURE=true as part of their environment.
639
640 pushvars can provide for user-overridable hooks as well as set debug
641 levels. One example is having a hook that blocks commits containing
642 conflict markers, but enables the user to override the hook if the file
643 is using conflict markers for testing purposes or the file format has
644 strings that look like conflict markers.
645
646 By default, servers will ignore --pushvars. To enable it add the fol‐
647 lowing to your configuration file:
648
649 [push]
650 pushvars.server = true
651
652 Returns 0 if push was successful, 1 if nothing to push.
653
654 Options:
655
656 -f, --force
657 force push
658
659 -r,--rev <REV[+]>
660 a changeset intended to be included in the destination
661
662 -B,--bookmark <BOOKMARK[+]>
663 bookmark to push
664
665 --all-bookmarks
666 push all bookmarks (EXPERIMENTAL)
667
668 -b,--branch <BRANCH[+]>
669 a specific branch you would like to push
670
671 --new-branch
672 allow pushing a new branch
673
674 --pushvars <VALUE[+]>
675 variables that can be sent to server (ADVANCED)
676
677 --publish
678 push the changeset as public (EXPERIMENTAL)
679
680 -e,--ssh <CMD>
681 specify ssh command to use
682
683 --remotecmd <CMD>
684 specify hg command to run on the remote side
685
686 --insecure
687 do not verify server certificate (ignoring web.cacerts config)
688
689 [+] marked option can be specified multiple times
690
691 serve
692 start stand-alone webserver:
693
694 hg serve [OPTION]...
695
696 Start a local HTTP repository browser and pull server. You can use this
697 for ad-hoc sharing and browsing of repositories. It is recommended to
698 use a real web server to serve a repository for longer periods of time.
699
700 Please note that the server does not implement access control. This
701 means that, by default, anybody can read from the server and nobody can
702 write to it by default. Set the web.allow-push option to * to allow ev‐
703 erybody to push to the server. You should use a real web server if you
704 need to authenticate users.
705
706 By default, the server logs accesses to stdout and errors to stderr.
707 Use the -A/--accesslog and -E/--errorlog options to log to files.
708
709 To have the server choose a free port number to listen on, specify a
710 port number of 0; in this case, the server will print the port number
711 it uses.
712
713 Returns 0 on success.
714
715 Options:
716
717 -A,--accesslog <FILE>
718 name of access log file to write to
719
720 -d, --daemon
721 run server in background
722
723 --daemon-postexec <VALUE[+]>
724 used internally by daemon mode
725
726 -E,--errorlog <FILE>
727 name of error log file to write to
728
729 -p,--port <PORT>
730 port to listen on (default: 8000)
731
732 -a,--address <ADDR>
733 address to listen on (default: all interfaces)
734
735 --prefix <PREFIX>
736 prefix path to serve from (default: server root)
737
738 -n,--name <NAME>
739 name to show in web pages (default: working directory)
740
741 --web-conf <FILE>
742 name of the hgweb config file (see 'hg help hgweb')
743
744 --webdir-conf <FILE>
745 name of the hgweb config file (DEPRECATED)
746
747 --pid-file <FILE>
748 name of file to write process ID to
749
750 --stdio
751 for remote clients (ADVANCED)
752
753 --cmdserver <MODE>
754 for remote clients (ADVANCED)
755
756 -t,--templates <TEMPLATE>
757 web templates to use
758
759 --style <STYLE>
760 template style to use
761
762 -6, --ipv6
763 use IPv6 in addition to IPv4
764
765 --certificate <FILE>
766 SSL certificate file
767
768 --print-url
769 start and print only the URL
770
771 -S, --subrepos
772 recurse into subrepositories
773
774 [+] marked option can be specified multiple times
775
776 Change creation
777 commit
778 commit the specified files or all outstanding changes:
779
780 hg commit [OPTION]... [FILE]...
781
782 Commit changes to the given files into the repository. Unlike a cen‐
783 tralized SCM, this operation is a local operation. See hg push for a
784 way to actively distribute your changes.
785
786 If a list of files is omitted, all changes reported by hg status will
787 be committed.
788
789 If you are committing the result of a merge, do not provide any file‐
790 names or -I/-X filters.
791
792 If no commit message is specified, Mercurial starts your configured ed‐
793 itor where you can enter a message. In case your commit fails, you will
794 find a backup of your message in .hg/last-message.txt.
795
796 The --close-branch flag can be used to mark the current branch head
797 closed. When all heads of a branch are closed, the branch will be con‐
798 sidered closed and no longer listed.
799
800 The --amend flag can be used to amend the parent of the working direc‐
801 tory with a new commit that contains the changes in the parent in addi‐
802 tion to those currently reported by hg status, if there are any. The
803 old commit is stored in a backup bundle in .hg/strip-backup (see hg
804 help bundle and hg help unbundle on how to restore it).
805
806 Message, user and date are taken from the amended commit unless speci‐
807 fied. When a message isn't specified on the command line, the editor
808 will open with the message of the amended commit.
809
810 It is not possible to amend public changesets (see hg help phases) or
811 changesets that have children.
812
813 See hg help dates for a list of formats valid for -d/--date.
814
815 Returns 0 on success, 1 if nothing changed.
816
817 Examples:
818
819 • commit all files ending in .py:
820
821 hg commit --include "set:**.py"
822
823 • commit all non-binary files:
824
825 hg commit --exclude "set:binary()"
826
827 • amend the current commit and set the date to now:
828
829 hg commit --amend --date now
830
831 Options:
832
833 -A, --addremove
834 mark new/missing files as added/removed before committing
835
836 --close-branch
837 mark a branch head as closed
838
839 --amend
840 amend the parent of the working directory
841
842 -s, --secret
843 use the secret phase for committing
844
845 -e, --edit
846 invoke editor on commit messages
847
848 --force-close-branch
849 forcibly close branch from a non-head changeset (ADVANCED)
850
851 -i, --interactive
852 use interactive mode
853
854 -I,--include <PATTERN[+]>
855 include names matching the given patterns
856
857 -X,--exclude <PATTERN[+]>
858 exclude names matching the given patterns
859
860 -m,--message <TEXT>
861 use text as commit message
862
863 -l,--logfile <FILE>
864 read commit message from file
865
866 -d,--date <DATE>
867 record the specified date as commit date
868
869 -u,--user <USER>
870 record the specified user as committer
871
872 -S, --subrepos
873 recurse into subrepositories
874
875 [+] marked option can be specified multiple times
876
877 aliases: ci
878
879 Change manipulation
880 abort
881 abort an unfinished operation (EXPERIMENTAL):
882
883 hg abort
884
885 Aborts a multistep operation like graft, histedit, rebase, merge, and
886 unshelve if they are in an unfinished state.
887
888 use --dry-run/-n to dry run the command.
889
890 Options:
891
892 -n, --dry-run
893 do not perform actions, just print output
894
895 backout
896 reverse effect of earlier changeset:
897
898 hg backout [OPTION]... [-r] REV
899
900 Prepare a new changeset with the effect of REV undone in the current
901 working directory. If no conflicts were encountered, it will be commit‐
902 ted immediately.
903
904 If REV is the parent of the working directory, then this new changeset
905 is committed automatically (unless --no-commit is specified).
906
907 Note hg backout cannot be used to fix either an unwanted or incorrect
908 merge.
909
910 Examples:
911
912 • Reverse the effect of the parent of the working directory. This
913 backout will be committed immediately:
914
915 hg backout -r .
916
917 • Reverse the effect of previous bad revision 23:
918
919 hg backout -r 23
920
921 • Reverse the effect of previous bad revision 23 and leave changes un‐
922 committed:
923
924 hg backout -r 23 --no-commit
925 hg commit -m "Backout revision 23"
926
927 By default, the pending changeset will have one parent, maintaining a
928 linear history. With --merge, the pending changeset will instead have
929 two parents: the old parent of the working directory and a new child of
930 REV that simply undoes REV.
931
932 Before version 1.7, the behavior without --merge was equivalent to
933 specifying --merge followed by hg update --clean . to cancel the merge
934 and leave the child of REV as a head to be merged separately.
935
936 See hg help dates for a list of formats valid for -d/--date.
937
938 See hg help revert for a way to restore files to the state of another
939 revision.
940
941 Returns 0 on success, 1 if nothing to backout or there are unresolved
942 files.
943
944 Options:
945
946 --merge
947 merge with old dirstate parent after backout
948
949 --commit
950 commit if no conflicts were encountered (DEPRECATED)
951
952 --no-commit
953 do not commit
954
955 --parent <REV>
956 parent to choose when backing out merge (DEPRECATED)
957
958 -r,--rev <REV>
959 revision to backout
960
961 -e, --edit
962 invoke editor on commit messages
963
964 -t,--tool <TOOL>
965 specify merge tool
966
967 -I,--include <PATTERN[+]>
968 include names matching the given patterns
969
970 -X,--exclude <PATTERN[+]>
971 exclude names matching the given patterns
972
973 -m,--message <TEXT>
974 use text as commit message
975
976 -l,--logfile <FILE>
977 read commit message from file
978
979 -d,--date <DATE>
980 record the specified date as commit date
981
982 -u,--user <USER>
983 record the specified user as committer
984
985 [+] marked option can be specified multiple times
986
987 continue
988 resumes an interrupted operation (EXPERIMENTAL):
989
990 hg continue
991
992 Finishes a multistep operation like graft, histedit, rebase, merge, and
993 unshelve if they are in an interrupted state.
994
995 use --dry-run/-n to dry run the command.
996
997 Options:
998
999 -n, --dry-run
1000 do not perform actions, just print output
1001
1002 graft
1003 copy changes from other branches onto the current branch:
1004
1005 hg graft [OPTION]... [-r REV]... REV...
1006
1007 This command uses Mercurial's merge logic to copy individual changes
1008 from other branches without merging branches in the history graph. This
1009 is sometimes known as 'backporting' or 'cherry-picking'. By default,
1010 graft will copy user, date, and description from the source changesets.
1011
1012 Changesets that are ancestors of the current revision, that have al‐
1013 ready been grafted, or that are merges will be skipped.
1014
1015 If --log is specified, log messages will have a comment appended of the
1016 form:
1017
1018 (grafted from CHANGESETHASH)
1019
1020 If --force is specified, revisions will be grafted even if they are al‐
1021 ready ancestors of, or have been grafted to, the destination. This is
1022 useful when the revisions have since been backed out.
1023
1024 If a graft merge results in conflicts, the graft process is interrupted
1025 so that the current merge can be manually resolved. Once all conflicts
1026 are addressed, the graft process can be continued with the -c/--con‐
1027 tinue option.
1028
1029 The -c/--continue option reapplies all the earlier options.
1030
1031 The --base option exposes more of how graft internally uses merge with
1032 a custom base revision. --base can be used to specify another ancestor
1033 than the first and only parent.
1034
1035 The command:
1036
1037 hg graft -r 345 --base 234
1038
1039 is thus pretty much the same as:
1040
1041 hg diff --from 234 --to 345 | hg import
1042
1043 but using merge to resolve conflicts and track moved files.
1044
1045 The result of a merge can thus be backported as a single commit by
1046 specifying one of the merge parents as base, and thus effectively
1047 grafting the changes from the other side.
1048
1049 It is also possible to collapse multiple changesets and clean up his‐
1050 tory by specifying another ancestor as base, much like rebase --col‐
1051 lapse --keep.
1052
1053 The commit message can be tweaked after the fact using commit --amend .
1054
1055 For using non-ancestors as the base to backout changes, see the backout
1056 command and the hidden --parent option.
1057
1058 Examples:
1059
1060 • copy a single change to the stable branch and edit its description:
1061
1062 hg update stable
1063 hg graft --edit 9393
1064
1065 • graft a range of changesets with one exception, updating dates:
1066
1067 hg graft -D "2085::2093 and not 2091"
1068
1069 • continue a graft after resolving conflicts:
1070
1071 hg graft -c
1072
1073 • show the source of a grafted changeset:
1074
1075 hg log --debug -r .
1076
1077 • show revisions sorted by date:
1078
1079 hg log -r "sort(all(), date)"
1080
1081 • backport the result of a merge as a single commit:
1082
1083 hg graft -r 123 --base 123^
1084
1085 • land a feature branch as one changeset:
1086
1087 hg up -cr default
1088 hg graft -r featureX --base "ancestor('featureX', 'default')"
1089
1090 See hg help revisions for more about specifying revisions.
1091
1092 Returns 0 on successful completion, 1 if there are unresolved files.
1093
1094 Options:
1095
1096 -r,--rev <REV[+]>
1097 revisions to graft
1098
1099 --base <REV>
1100 base revision when doing the graft merge (ADVANCED)
1101
1102 -c, --continue
1103 resume interrupted graft
1104
1105 --stop stop interrupted graft
1106
1107 --abort
1108 abort interrupted graft
1109
1110 -e, --edit
1111 invoke editor on commit messages
1112
1113 --log append graft info to log message
1114
1115 --no-commit
1116 don't commit, just apply the changes in working directory
1117
1118 -f, --force
1119 force graft
1120
1121 -D, --currentdate
1122 record the current date as commit date
1123
1124 -U, --currentuser
1125 record the current user as committer
1126
1127 -d,--date <DATE>
1128 record the specified date as commit date
1129
1130 -u,--user <USER>
1131 record the specified user as committer
1132
1133 -t,--tool <TOOL>
1134 specify merge tool
1135
1136 -n, --dry-run
1137 do not perform actions, just print output
1138
1139 [+] marked option can be specified multiple times
1140
1141 merge
1142 merge another revision into working directory:
1143
1144 hg merge [-P] [[-r] REV]
1145
1146 The current working directory is updated with all changes made in the
1147 requested revision since the last common predecessor revision.
1148
1149 Files that changed between either parent are marked as changed for the
1150 next commit and a commit must be performed before any further updates
1151 to the repository are allowed. The next commit will have two parents.
1152
1153 --tool can be used to specify the merge tool used for file merges. It
1154 overrides the HGMERGE environment variable and your configuration
1155 files. See hg help merge-tools for options.
1156
1157 If no revision is specified, the working directory's parent is a head
1158 revision, and the current branch contains exactly one other head, the
1159 other head is merged with by default. Otherwise, an explicit revision
1160 with which to merge must be provided.
1161
1162 See hg help resolve for information on handling file conflicts.
1163
1164 To undo an uncommitted merge, use hg merge --abort which will check out
1165 a clean copy of the original merge parent, losing all changes.
1166
1167 Returns 0 on success, 1 if there are unresolved files.
1168
1169 Options:
1170
1171 -f, --force
1172 force a merge including outstanding changes (DEPRECATED)
1173
1174 -r,--rev <REV>
1175 revision to merge
1176
1177 -P, --preview
1178 review revisions to merge (no merge is performed)
1179
1180 --abort
1181 abort the ongoing merge
1182
1183 -t,--tool <TOOL>
1184 specify merge tool
1185
1186 Change organization
1187 bookmarks
1188 create a new bookmark or list existing bookmarks:
1189
1190 hg bookmarks [OPTIONS]... [NAME]...
1191
1192 Bookmarks are labels on changesets to help track lines of development.
1193 Bookmarks are unversioned and can be moved, renamed and deleted.
1194 Deleting or moving a bookmark has no effect on the associated change‐
1195 sets.
1196
1197 Creating or updating to a bookmark causes it to be marked as 'active'.
1198 The active bookmark is indicated with a '*'. When a commit is made,
1199 the active bookmark will advance to the new commit. A plain hg update
1200 will also advance an active bookmark, if possible. Updating away from
1201 a bookmark will cause it to be deactivated.
1202
1203 Bookmarks can be pushed and pulled between repositories (see hg help
1204 push and hg help pull). If a shared bookmark has diverged, a new 'di‐
1205 vergent bookmark' of the form 'name@path' will be created. Using hg
1206 merge will resolve the divergence.
1207
1208 Specifying bookmark as '.' to -m/-d/-l options is equivalent to speci‐
1209 fying the active bookmark's name.
1210
1211 A bookmark named '@' has the special property that hg clone will check
1212 it out by default if it exists.
1213
1214 Template:
1215
1216 The following keywords are supported in addition to the common template
1217 keywords and functions such as {bookmark}. See also hg help templates.
1218
1219 active Boolean. True if the bookmark is active.
1220
1221 Examples:
1222
1223 • create an active bookmark for a new line of development:
1224
1225 hg book new-feature
1226
1227 • create an inactive bookmark as a place marker:
1228
1229 hg book -i reviewed
1230
1231 • create an inactive bookmark on another changeset:
1232
1233 hg book -r .^ tested
1234
1235 • rename bookmark turkey to dinner:
1236
1237 hg book -m turkey dinner
1238
1239 • move the '@' bookmark from another branch:
1240
1241 hg book -f @
1242
1243 • print only the active bookmark name:
1244
1245 hg book -ql .
1246
1247 Options:
1248
1249 -f, --force
1250 force
1251
1252 -r,--rev <REV>
1253 revision for bookmark action
1254
1255 -d, --delete
1256 delete a given bookmark
1257
1258 -m,--rename <OLD>
1259 rename a given bookmark
1260
1261 -i, --inactive
1262 mark a bookmark inactive
1263
1264 -l, --list
1265 list existing bookmarks
1266
1267 -T,--template <TEMPLATE>
1268 display with template
1269
1270 aliases: bookmark
1271
1272 branch
1273 set or show the current branch name:
1274
1275 hg branch [-fC] [NAME]
1276
1277 Note Branch names are permanent and global. Use hg bookmark to create
1278 a light-weight bookmark instead. See hg help glossary for more
1279 information about named branches and bookmarks.
1280
1281 With no argument, show the current branch name. With one argument, set
1282 the working directory branch name (the branch will not exist in the
1283 repository until the next commit). Standard practice recommends that
1284 primary development take place on the 'default' branch.
1285
1286 Unless -f/--force is specified, branch will not let you set a branch
1287 name that already exists.
1288
1289 Use -C/--clean to reset the working directory branch to that of the
1290 parent of the working directory, negating a previous branch change.
1291
1292 Use the command hg update to switch to an existing branch. Use hg com‐
1293 mit --close-branch to mark this branch head as closed. When all heads
1294 of a branch are closed, the branch will be considered closed.
1295
1296 Returns 0 on success.
1297
1298 Options:
1299
1300 -f, --force
1301 set branch name even if it shadows an existing branch
1302
1303 -C, --clean
1304 reset branch name to parent branch name
1305
1306 -r,--rev <VALUE[+]>
1307 change branches of the given revs (EXPERIMENTAL)
1308
1309 [+] marked option can be specified multiple times
1310
1311 branches
1312 list repository named branches:
1313
1314 hg branches [-c]
1315
1316 List the repository's named branches, indicating which ones are inac‐
1317 tive. If -c/--closed is specified, also list branches which have been
1318 marked closed (see hg commit --close-branch).
1319
1320 Use the command hg update to switch to an existing branch.
1321
1322 Template:
1323
1324 The following keywords are supported in addition to the common template
1325 keywords and functions such as {branch}. See also hg help templates.
1326
1327 active Boolean. True if the branch is active.
1328
1329 closed Boolean. True if the branch is closed.
1330
1331 current
1332 Boolean. True if it is the current branch.
1333
1334 Returns 0.
1335
1336 Options:
1337
1338 -a, --active
1339 show only branches that have unmerged heads (DEPRECATED)
1340
1341 -c, --closed
1342 show normal and closed branches
1343
1344 -r,--rev <VALUE[+]>
1345 show branch name(s) of the given rev
1346
1347 -T,--template <TEMPLATE>
1348 display with template
1349
1350 [+] marked option can be specified multiple times
1351
1352 phase
1353 set or show the current phase name:
1354
1355 hg phase [-p|-d|-s] [-f] [-r] [REV...]
1356
1357 With no argument, show the phase name of the current revision(s).
1358
1359 With one of -p/--public, -d/--draft or -s/--secret, change the phase
1360 value of the specified revisions.
1361
1362 Unless -f/--force is specified, hg phase won't move changesets from a
1363 lower phase to a higher phase. Phases are ordered as follows:
1364
1365 public < draft < secret
1366
1367 Returns 0 on success, 1 if some phases could not be changed.
1368
1369 (For more information about the phases concept, see hg help phases.)
1370
1371 Options:
1372
1373 -p, --public
1374 set changeset phase to public
1375
1376 -d, --draft
1377 set changeset phase to draft
1378
1379 -s, --secret
1380 set changeset phase to secret
1381
1382 -f, --force
1383 allow to move boundary backward
1384
1385 -r,--rev <REV[+]>
1386 target revision
1387
1388 [+] marked option can be specified multiple times
1389
1390 tag
1391 add one or more tags for the current or given revision:
1392
1393 hg tag [-f] [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME...
1394
1395 Name a particular revision using <name>.
1396
1397 Tags are used to name particular revisions of the repository and are
1398 very useful to compare different revisions, to go back to significant
1399 earlier versions or to mark branch points as releases, etc. Changing an
1400 existing tag is normally disallowed; use -f/--force to override.
1401
1402 If no revision is given, the parent of the working directory is used.
1403
1404 To facilitate version control, distribution, and merging of tags, they
1405 are stored as a file named ".hgtags" which is managed similarly to
1406 other project files and can be hand-edited if necessary. This also
1407 means that tagging creates a new commit. The file ".hg/localtags" is
1408 used for local tags (not shared among repositories).
1409
1410 Tag commits are usually made at the head of a branch. If the parent of
1411 the working directory is not a branch head, hg tag aborts; use
1412 -f/--force to force the tag commit to be based on a non-head changeset.
1413
1414 See hg help dates for a list of formats valid for -d/--date.
1415
1416 Since tag names have priority over branch names during revision lookup,
1417 using an existing branch name as a tag name is discouraged.
1418
1419 Returns 0 on success.
1420
1421 Options:
1422
1423 -f, --force
1424 force tag
1425
1426 -l, --local
1427 make the tag local
1428
1429 -r,--rev <REV>
1430 revision to tag
1431
1432 --remove
1433 remove a tag
1434
1435 -e, --edit
1436 invoke editor on commit messages
1437
1438 -m,--message <TEXT>
1439 use text as commit message
1440
1441 -d,--date <DATE>
1442 record the specified date as commit date
1443
1444 -u,--user <USER>
1445 record the specified user as committer
1446
1447 tags
1448 list repository tags:
1449
1450 hg tags
1451
1452 This lists both regular and local tags. When the -v/--verbose switch is
1453 used, a third column "local" is printed for local tags. When the
1454 -q/--quiet switch is used, only the tag name is printed.
1455
1456 Template:
1457
1458 The following keywords are supported in addition to the common template
1459 keywords and functions such as {tag}. See also hg help templates.
1460
1461 type String. local for local tags.
1462
1463 Returns 0 on success.
1464
1465 Options:
1466
1467 -T,--template <TEMPLATE>
1468 display with template
1469
1470 File content management
1471 annotate
1472 show changeset information by line for each file:
1473
1474 hg annotate [-r REV] [-f] [-a] [-u] [-d] [-n] [-c] [-l] FILE...
1475
1476 List changes in files, showing the revision id responsible for each
1477 line.
1478
1479 This command is useful for discovering when a change was made and by
1480 whom.
1481
1482 If you include --file, --user, or --date, the revision number is sup‐
1483 pressed unless you also include --number.
1484
1485 Without the -a/--text option, annotate will avoid processing files it
1486 detects as binary. With -a, annotate will annotate the file anyway, al‐
1487 though the results will probably be neither useful nor desirable.
1488
1489 Template:
1490
1491 The following keywords are supported in addition to the common template
1492 keywords and functions. See also hg help templates.
1493
1494 lines List of lines with annotation data.
1495
1496 path String. Repository-absolute path of the specified file.
1497
1498 And each entry of {lines} provides the following sub-keywords in addi‐
1499 tion to {date}, {node}, {rev}, {user}, etc.
1500
1501 line String. Line content.
1502
1503 lineno Integer. Line number at that revision.
1504
1505 path String. Repository-absolute path of the file at that revision.
1506
1507 See hg help templates.operators for the list expansion syntax.
1508
1509 Returns 0 on success.
1510
1511 Options:
1512
1513 -r,--rev <REV>
1514 annotate the specified revision
1515
1516 --follow
1517 follow copies/renames and list the filename (DEPRECATED)
1518
1519 --no-follow
1520 don't follow copies and renames
1521
1522 -a, --text
1523 treat all files as text
1524
1525 -u, --user
1526 list the author (long with -v)
1527
1528 -f, --file
1529 list the filename
1530
1531 -d, --date
1532 list the date (short with -q)
1533
1534 -n, --number
1535 list the revision number (default)
1536
1537 -c, --changeset
1538 list the changeset
1539
1540 -l, --line-number
1541 show line number at the first appearance
1542
1543 --skip <REV[+]>
1544 revset to not display (EXPERIMENTAL)
1545
1546 -w, --ignore-all-space
1547 ignore white space when comparing lines
1548
1549 -b, --ignore-space-change
1550 ignore changes in the amount of white space
1551
1552 -B, --ignore-blank-lines
1553 ignore changes whose lines are all blank
1554
1555 -Z, --ignore-space-at-eol
1556 ignore changes in whitespace at EOL
1557
1558 -I,--include <PATTERN[+]>
1559 include names matching the given patterns
1560
1561 -X,--exclude <PATTERN[+]>
1562 exclude names matching the given patterns
1563
1564 -T,--template <TEMPLATE>
1565 display with template
1566
1567 [+] marked option can be specified multiple times
1568
1569 aliases: blame
1570
1571 cat
1572 output the current or given revision of files:
1573
1574 hg cat [OPTION]... FILE...
1575
1576 Print the specified files as they were at the given revision. If no re‐
1577 vision is given, the parent of the working directory is used.
1578
1579 Output may be to a file, in which case the name of the file is given
1580 using a template string. See hg help templates. In addition to the com‐
1581 mon template keywords, the following formatting rules are supported:
1582
1583 %%
1584
1585 literal "%" character
1586
1587 %s
1588
1589 basename of file being printed
1590
1591 %d
1592
1593 dirname of file being printed, or '.' if in repository root
1594
1595 %p
1596
1597 root-relative path name of file being printed
1598
1599 %H
1600
1601 changeset hash (40 hexadecimal digits)
1602
1603 %R
1604
1605 changeset revision number
1606
1607 %h
1608
1609 short-form changeset hash (12 hexadecimal digits)
1610
1611 %r
1612
1613 zero-padded changeset revision number
1614
1615 %b
1616
1617 basename of the exporting repository
1618
1619 \
1620
1621 literal "" character
1622
1623 Template:
1624
1625 The following keywords are supported in addition to the common template
1626 keywords and functions. See also hg help templates.
1627
1628 data String. File content.
1629
1630 path String. Repository-absolute path of the file.
1631
1632 Returns 0 on success.
1633
1634 Options:
1635
1636 -o,--output <FORMAT>
1637 print output to file with formatted name
1638
1639 -r,--rev <REV>
1640 print the given revision
1641
1642 --decode
1643 apply any matching decode filter
1644
1645 -I,--include <PATTERN[+]>
1646 include names matching the given patterns
1647
1648 -X,--exclude <PATTERN[+]>
1649 exclude names matching the given patterns
1650
1651 -T,--template <TEMPLATE>
1652 display with template
1653
1654 [+] marked option can be specified multiple times
1655
1656 copy
1657 mark files as copied for the next commit:
1658
1659 hg copy [OPTION]... (SOURCE... DEST | --forget DEST...)
1660
1661 Mark dest as having copies of source files. If dest is a directory,
1662 copies are put in that directory. If dest is a file, the source must be
1663 a single file.
1664
1665 By default, this command copies the contents of files as they exist in
1666 the working directory. If invoked with -A/--after, the operation is
1667 recorded, but no copying is performed.
1668
1669 To undo marking a destination file as copied, use --forget. With that
1670 option, all given (positional) arguments are unmarked as copies. The
1671 destination file(s) will be left in place (still tracked).
1672
1673 This command takes effect with the next commit by default.
1674
1675 Returns 0 on success, 1 if errors are encountered.
1676
1677 Options:
1678
1679 --forget
1680 unmark a destination file as copied
1681
1682 -A, --after
1683 record a copy that has already occurred
1684
1685 --at-rev <REV>
1686 (un)mark copies in the given revision (EXPERIMENTAL)
1687
1688 -f, --force
1689 forcibly copy over an existing managed file
1690
1691 -I,--include <PATTERN[+]>
1692 include names matching the given patterns
1693
1694 -X,--exclude <PATTERN[+]>
1695 exclude names matching the given patterns
1696
1697 -n, --dry-run
1698 do not perform actions, just print output
1699
1700 [+] marked option can be specified multiple times
1701
1702 aliases: cp
1703
1704 diff
1705 diff repository (or selected files):
1706
1707 hg diff [OPTION]... ([-c REV] | [--from REV1] [--to REV2]) [FILE]...
1708
1709 Show differences between revisions for the specified files.
1710
1711 Differences between files are shown using the unified diff format.
1712
1713 Note hg diff may generate unexpected results for merges, as it will
1714 default to comparing against the working directory's first par‐
1715 ent changeset if no revisions are specified.
1716
1717 By default, the working directory files are compared to its first par‐
1718 ent. To see the differences from another revision, use --from. To see
1719 the difference to another revision, use --to. For example, hg diff
1720 --from .^ will show the differences from the working copy's grandparent
1721 to the working copy, hg diff --to . will show the diff from the working
1722 copy to its parent (i.e. the reverse of the default), and hg diff
1723 --from 1.0 --to 1.2 will show the diff between those two revisions.
1724
1725 Alternatively you can specify -c/--change with a revision to see the
1726 changes in that changeset relative to its first parent (i.e. hg diff -c
1727 42 is equivalent to hg diff --from 42^ --to 42)
1728
1729 Without the -a/--text option, diff will avoid generating diffs of files
1730 it detects as binary. With -a, diff will generate a diff anyway, proba‐
1731 bly with undesirable results.
1732
1733 Use the -g/--git option to generate diffs in the git extended diff for‐
1734 mat. For more information, read hg help diffs.
1735
1736 Examples:
1737
1738 • compare a file in the current working directory to its parent:
1739
1740 hg diff foo.c
1741
1742 • compare two historical versions of a directory, with rename info:
1743
1744 hg diff --git --from 1.0 --to 1.2 lib/
1745
1746 • get change stats relative to the last change on some date:
1747
1748 hg diff --stat --from "date('may 2')"
1749
1750 • diff all newly-added files that contain a keyword:
1751
1752 hg diff "set:added() and grep(GNU)"
1753
1754 • compare a revision and its parents:
1755
1756 hg diff -c 9353 # compare against first parent
1757 hg diff --from 9353^ --to 9353 # same using revset syntax
1758 hg diff --from 9353^2 --to 9353 # compare against the second parent
1759
1760 Returns 0 on success.
1761
1762 Options:
1763
1764 -r,--rev <REV[+]>
1765 revision (DEPRECATED)
1766
1767 --from <REV1>
1768 revision to diff from
1769
1770 --to <REV2>
1771 revision to diff to
1772
1773 -c,--change <REV>
1774 change made by revision
1775
1776 -a, --text
1777 treat all files as text
1778
1779 -g, --git
1780 use git extended diff format (DEFAULT: diff.git)
1781
1782 --binary
1783 generate binary diffs in git mode (default)
1784
1785 --nodates
1786 omit dates from diff headers
1787
1788 --noprefix
1789 omit a/ and b/ prefixes from filenames
1790
1791 -p, --show-function
1792 show which function each change is in (DEFAULT: diff.showfunc)
1793
1794 --reverse
1795 produce a diff that undoes the changes
1796
1797 -w, --ignore-all-space
1798 ignore white space when comparing lines
1799
1800 -b, --ignore-space-change
1801 ignore changes in the amount of white space
1802
1803 -B, --ignore-blank-lines
1804 ignore changes whose lines are all blank
1805
1806 -Z, --ignore-space-at-eol
1807 ignore changes in whitespace at EOL
1808
1809 -U,--unified <NUM>
1810 number of lines of context to show
1811
1812 --stat output diffstat-style summary of changes
1813
1814 --root <DIR>
1815 produce diffs relative to subdirectory
1816
1817 -I,--include <PATTERN[+]>
1818 include names matching the given patterns
1819
1820 -X,--exclude <PATTERN[+]>
1821 exclude names matching the given patterns
1822
1823 -S, --subrepos
1824 recurse into subrepositories
1825
1826 [+] marked option can be specified multiple times
1827
1828 grep
1829 search for a pattern in specified files:
1830
1831 hg grep [--diff] [OPTION]... PATTERN [FILE]...
1832
1833 Search the working directory or revision history for a regular expres‐
1834 sion in the specified files for the entire repository.
1835
1836 By default, grep searches the repository files in the working directory
1837 and prints the files where it finds a match. To specify historical re‐
1838 visions instead of the working directory, use the --rev flag.
1839
1840 To search instead historical revision differences that contains a
1841 change in match status ("-" for a match that becomes a non-match, or
1842 "+" for a non-match that becomes a match), use the --diff flag.
1843
1844 PATTERN can be any Python (roughly Perl-compatible) regular expression.
1845
1846 If no FILEs are specified and the --rev flag isn't supplied, all files
1847 in the working directory are searched. When using the --rev flag and
1848 specifying FILEs, use the --follow argument to also follow the speci‐
1849 fied FILEs across renames and copies.
1850
1851 Template:
1852
1853 The following keywords are supported in addition to the common template
1854 keywords and functions. See also hg help templates.
1855
1856 change String. Character denoting insertion + or removal -. Available
1857 if --diff is specified.
1858
1859 lineno Integer. Line number of the match.
1860
1861 path String. Repository-absolute path of the file.
1862
1863 texts List of text chunks.
1864
1865 And each entry of {texts} provides the following sub-keywords.
1866
1867 matched
1868 Boolean. True if the chunk matches the specified pattern.
1869
1870 text String. Chunk content.
1871
1872 See hg help templates.operators for the list expansion syntax.
1873
1874 Returns 0 if a match is found, 1 otherwise.
1875
1876 Options:
1877
1878 -0, --print0
1879 end fields with NUL
1880
1881 --all an alias to --diff (DEPRECATED)
1882
1883 --diff search revision differences for when the pattern was added or
1884 removed
1885
1886 -a, --text
1887 treat all files as text
1888
1889 -f, --follow
1890 follow changeset history, or file history across copies and re‐
1891 names
1892
1893 -i, --ignore-case
1894 ignore case when matching
1895
1896 -l, --files-with-matches
1897 print only filenames and revisions that match
1898
1899 -n, --line-number
1900 print matching line numbers
1901
1902 -r,--rev <REV[+]>
1903 search files changed within revision range
1904
1905 --all-files
1906 include all files in the changeset while grepping (DEPRECATED)
1907
1908 -u, --user
1909 list the author (long with -v)
1910
1911 -d, --date
1912 list the date (short with -q)
1913
1914 -T,--template <TEMPLATE>
1915 display with template
1916
1917 -I,--include <PATTERN[+]>
1918 include names matching the given patterns
1919
1920 -X,--exclude <PATTERN[+]>
1921 exclude names matching the given patterns
1922
1923 [+] marked option can be specified multiple times
1924
1925 Change navigation
1926 bisect
1927 subdivision search of changesets:
1928
1929 hg bisect [-gbsr] [-U] [-c CMD] [REV]
1930
1931 This command helps to find changesets which introduce problems. To use,
1932 mark the earliest changeset you know exhibits the problem as bad, then
1933 mark the latest changeset which is free from the problem as good. Bi‐
1934 sect will update your working directory to a revision for testing (un‐
1935 less the -U/--noupdate option is specified). Once you have performed
1936 tests, mark the working directory as good or bad, and bisect will ei‐
1937 ther update to another candidate changeset or announce that it has
1938 found the bad revision.
1939
1940 As a shortcut, you can also use the revision argument to mark a revi‐
1941 sion as good or bad without checking it out first.
1942
1943 If you supply a command, it will be used for automatic bisection. The
1944 environment variable HG_NODE will contain the ID of the changeset being
1945 tested. The exit status of the command will be used to mark revisions
1946 as good or bad: status 0 means good, 125 means to skip the revision,
1947 127 (command not found) will abort the bisection, and any other
1948 non-zero exit status means the revision is bad.
1949
1950 Some examples:
1951
1952 • start a bisection with known bad revision 34, and good revision 12:
1953
1954 hg bisect --bad 34
1955 hg bisect --good 12
1956
1957 • advance the current bisection by marking current revision as good or
1958 bad:
1959
1960 hg bisect --good
1961 hg bisect --bad
1962
1963 • mark the current revision, or a known revision, to be skipped (e.g.
1964 if that revision is not usable because of another issue):
1965
1966 hg bisect --skip
1967 hg bisect --skip 23
1968
1969 • skip all revisions that do not touch directories foo or bar:
1970
1971 hg bisect --skip "!( file('path:foo') & file('path:bar') )"
1972
1973 • forget the current bisection:
1974
1975 hg bisect --reset
1976
1977 • use 'make && make tests' to automatically find the first broken revi‐
1978 sion:
1979
1980 hg bisect --reset
1981 hg bisect --bad 34
1982 hg bisect --good 12
1983 hg bisect --command "make && make tests"
1984
1985 • see all changesets whose states are already known in the current bi‐
1986 section:
1987
1988 hg log -r "bisect(pruned)"
1989
1990 • see the changeset currently being bisected (especially useful if run‐
1991 ning with -U/--noupdate):
1992
1993 hg log -r "bisect(current)"
1994
1995 • see all changesets that took part in the current bisection:
1996
1997 hg log -r "bisect(range)"
1998
1999 • you can even get a nice graph:
2000
2001 hg log --graph -r "bisect(range)"
2002
2003 See hg help revisions.bisect for more about the bisect() predicate.
2004
2005 Returns 0 on success.
2006
2007 Options:
2008
2009 -r, --reset
2010 reset bisect state
2011
2012 -g, --good
2013 mark changeset good
2014
2015 -b, --bad
2016 mark changeset bad
2017
2018 -s, --skip
2019 skip testing changeset
2020
2021 -e, --extend
2022 extend the bisect range
2023
2024 -c,--command <CMD>
2025 use command to check changeset state
2026
2027 -U, --noupdate
2028 do not update to target
2029
2030 heads
2031 show branch heads:
2032
2033 hg heads [-ct] [-r STARTREV] [REV]...
2034
2035 With no arguments, show all open branch heads in the repository.
2036 Branch heads are changesets that have no descendants on the same
2037 branch. They are where development generally takes place and are the
2038 usual targets for update and merge operations.
2039
2040 If one or more REVs are given, only open branch heads on the branches
2041 associated with the specified changesets are shown. This means that you
2042 can use hg heads . to see the heads on the currently checked-out
2043 branch.
2044
2045 If -c/--closed is specified, also show branch heads marked closed (see
2046 hg commit --close-branch).
2047
2048 If STARTREV is specified, only those heads that are descendants of
2049 STARTREV will be displayed.
2050
2051 If -t/--topo is specified, named branch mechanics will be ignored and
2052 only topological heads (changesets with no children) will be shown.
2053
2054 Returns 0 if matching heads are found, 1 if not.
2055
2056 Options:
2057
2058 -r,--rev <STARTREV>
2059 show only heads which are descendants of STARTREV
2060
2061 -t, --topo
2062 show topological heads only
2063
2064 -a, --active
2065 show active branchheads only (DEPRECATED)
2066
2067 -c, --closed
2068 show normal and closed branch heads
2069
2070 --style <STYLE>
2071 display using template map file (DEPRECATED)
2072
2073 -T,--template <TEMPLATE>
2074 display with template
2075
2076 identify
2077 identify the working directory or specified revision:
2078
2079 hg identify [-nibtB] [-r REV] [SOURCE]
2080
2081 Print a summary identifying the repository state at REV using one or
2082 two parent hash identifiers, followed by a "+" if the working directory
2083 has uncommitted changes, the branch name (if not default), a list of
2084 tags, and a list of bookmarks.
2085
2086 When REV is not given, print a summary of the current state of the
2087 repository including the working directory. Specify -r. to get informa‐
2088 tion of the working directory parent without scanning uncommitted
2089 changes.
2090
2091 Specifying a path to a repository root or Mercurial bundle will cause
2092 lookup to operate on that repository/bundle.
2093
2094 Template:
2095
2096 The following keywords are supported in addition to the common template
2097 keywords and functions. See also hg help templates.
2098
2099 dirty String. Character + denoting if the working directory has uncom‐
2100 mitted changes.
2101
2102 id String. One or two nodes, optionally followed by +.
2103
2104 parents
2105 List of strings. Parent nodes of the changeset.
2106
2107 Examples:
2108
2109 • generate a build identifier for the working directory:
2110
2111 hg id --id > build-id.dat
2112
2113 • find the revision corresponding to a tag:
2114
2115 hg id -n -r 1.3
2116
2117 • check the most recent revision of a remote repository:
2118
2119 hg id -r tip https://www.mercurial-scm.org/repo/hg/
2120
2121 See hg log for generating more information about specific revisions,
2122 including full hash identifiers.
2123
2124 Returns 0 if successful.
2125
2126 Options:
2127
2128 -r,--rev <REV>
2129 identify the specified revision
2130
2131 -n, --num
2132 show local revision number
2133
2134 -i, --id
2135 show global revision id
2136
2137 -b, --branch
2138 show branch
2139
2140 -t, --tags
2141 show tags
2142
2143 -B, --bookmarks
2144 show bookmarks
2145
2146 -e,--ssh <CMD>
2147 specify ssh command to use
2148
2149 --remotecmd <CMD>
2150 specify hg command to run on the remote side
2151
2152 --insecure
2153 do not verify server certificate (ignoring web.cacerts config)
2154
2155 -T,--template <TEMPLATE>
2156 display with template
2157
2158 aliases: id
2159
2160 log
2161 show revision history of entire repository or files:
2162
2163 hg log [OPTION]... [FILE]
2164
2165 Print the revision history of the specified files or the entire
2166 project.
2167
2168 If no revision range is specified, the default is tip:0 unless --follow
2169 is set.
2170
2171 File history is shown without following rename or copy history of
2172 files. Use -f/--follow with a filename to follow history across renames
2173 and copies. --follow without a filename will only show ancestors of the
2174 starting revisions. The starting revisions can be specified by
2175 -r/--rev, which default to the working directory parent.
2176
2177 By default this command prints revision number and changeset id, tags,
2178 non-trivial parents, user, date and time, and a summary for each com‐
2179 mit. When the -v/--verbose switch is used, the list of changed files
2180 and full commit message are shown.
2181
2182 With --graph the revisions are shown as an ASCII art DAG with the most
2183 recent changeset at the top. 'o' is a changeset, '@' is a working di‐
2184 rectory parent, '%' is a changeset involved in an unresolved merge con‐
2185 flict, '_' closes a branch, 'x' is obsolete, '*' is unstable, and '+'
2186 represents a fork where the changeset from the lines below is a parent
2187 of the 'o' merge on the same line. Paths in the DAG are represented
2188 with '|', '/' and so forth. ':' in place of a '|' indicates one or more
2189 revisions in a path are omitted.
2190
2191 Use -L/--line-range FILE,M:N options to follow the history of lines
2192 from M to N in FILE. With -p/--patch only diff hunks affecting speci‐
2193 fied line range will be shown. This option requires --follow; it can be
2194 specified multiple times. Currently, this option is not compatible with
2195 --graph. This option is experimental.
2196
2197 Note hg log --patch may generate unexpected diff output for merge
2198 changesets, as it will only compare the merge changeset against
2199 its first parent. Also, only files different from BOTH parents
2200 will appear in files:.
2201
2202 Note For performance reasons, hg log FILE may omit duplicate changes
2203 made on branches and will not show removals or mode changes. To
2204 see all such changes, use the --removed switch.
2205
2206 Note The history resulting from -L/--line-range options depends on
2207 diff options; for instance if white-spaces are ignored, respec‐
2208 tive changes with only white-spaces in specified line range will
2209 not be listed.
2210
2211 Some examples:
2212
2213 • changesets with full descriptions and file lists:
2214
2215 hg log -v
2216
2217 • changesets ancestral to the working directory:
2218
2219 hg log -f
2220
2221 • last 10 commits on the current branch:
2222
2223 hg log -l 10 -b .
2224
2225 • changesets showing all modifications of a file, including removals:
2226
2227 hg log --removed file.c
2228
2229 • all changesets that touch a directory, with diffs, excluding merges:
2230
2231 hg log -Mp lib/
2232
2233 • all revision numbers that match a keyword:
2234
2235 hg log -k bug --template "{rev}\n"
2236
2237 • the full hash identifier of the working directory parent:
2238
2239 hg log -r . --template "{node}\n"
2240
2241 • list available log templates:
2242
2243 hg log -T list
2244
2245 • check if a given changeset is included in a tagged release:
2246
2247 hg log -r "a21ccf and ancestor(1.9)"
2248
2249 • find all changesets by some user in a date range:
2250
2251 hg log -k alice -d "may 2008 to jul 2008"
2252
2253 • summary of all changesets after the last tag:
2254
2255 hg log -r "last(tagged())::" --template "{desc|firstline}\n"
2256
2257 • changesets touching lines 13 to 23 for file.c:
2258
2259 hg log -L file.c,13:23
2260
2261 • changesets touching lines 13 to 23 for file.c and lines 2 to 6 of
2262 main.c with patch:
2263
2264 hg log -L file.c,13:23 -L main.c,2:6 -p
2265
2266 See hg help dates for a list of formats valid for -d/--date.
2267
2268 See hg help revisions for more about specifying and ordering revisions.
2269
2270 See hg help templates for more about pre-packaged styles and specifying
2271 custom templates. The default template used by the log command can be
2272 customized via the command-templates.log configuration setting.
2273
2274 Returns 0 on success.
2275
2276 Options:
2277
2278 -f, --follow
2279 follow changeset history, or file history across copies and re‐
2280 names
2281
2282 --follow-first
2283 only follow the first parent of merge changesets (DEPRECATED)
2284
2285 -d,--date <DATE>
2286 show revisions matching date spec
2287
2288 -C, --copies
2289 show copied files
2290
2291 -k,--keyword <TEXT[+]>
2292 do case-insensitive search for a given text
2293
2294 -r,--rev <REV[+]>
2295 revisions to select or follow from
2296
2297 -L,--line-range <FILE,RANGE[+]>
2298 follow line range of specified file (EXPERIMENTAL)
2299
2300 --removed
2301 include revisions where files were removed
2302
2303 -m, --only-merges
2304 show only merges (DEPRECATED) (use -r "merge()" instead)
2305
2306 -u,--user <USER[+]>
2307 revisions committed by user
2308
2309 --only-branch <BRANCH[+]>
2310 show only changesets within the given named branch (DEPRECATED)
2311
2312 -b,--branch <BRANCH[+]>
2313 show changesets within the given named branch
2314
2315 -B,--bookmark <BOOKMARK[+]>
2316 show changesets within the given bookmark
2317
2318 -P,--prune <REV[+]>
2319 do not display revision or any of its ancestors
2320
2321 -p, --patch
2322 show patch
2323
2324 -g, --git
2325 use git extended diff format
2326
2327 -l,--limit <NUM>
2328 limit number of changes displayed
2329
2330 -M, --no-merges
2331 do not show merges
2332
2333 --stat output diffstat-style summary of changes
2334
2335 -G, --graph
2336 show the revision DAG
2337
2338 --style <STYLE>
2339 display using template map file (DEPRECATED)
2340
2341 -T,--template <TEMPLATE>
2342 display with template
2343
2344 -I,--include <PATTERN[+]>
2345 include names matching the given patterns
2346
2347 -X,--exclude <PATTERN[+]>
2348 exclude names matching the given patterns
2349
2350 [+] marked option can be specified multiple times
2351
2352 aliases: history
2353
2354 parents
2355 show the parents of the working directory or revision (DEPRECATED):
2356
2357 hg parents [-r REV] [FILE]
2358
2359 Print the working directory's parent revisions. If a revision is given
2360 via -r/--rev, the parent of that revision will be printed. If a file
2361 argument is given, the revision in which the file was last changed (be‐
2362 fore the working directory revision or the argument to --rev if given)
2363 is printed.
2364
2365 This command is equivalent to:
2366
2367 hg log -r "p1()+p2()" or
2368 hg log -r "p1(REV)+p2(REV)" or
2369 hg log -r "max(::p1() and file(FILE))+max(::p2() and file(FILE))" or
2370 hg log -r "max(::p1(REV) and file(FILE))+max(::p2(REV) and file(FILE))"
2371
2372 See hg summary and hg help revsets for related information.
2373
2374 Returns 0 on success.
2375
2376 Options:
2377
2378 -r,--rev <REV>
2379 show parents of the specified revision
2380
2381 --style <STYLE>
2382 display using template map file (DEPRECATED)
2383
2384 -T,--template <TEMPLATE>
2385 display with template
2386
2387 tip
2388 show the tip revision (DEPRECATED):
2389
2390 hg tip [-p] [-g]
2391
2392 The tip revision (usually just called the tip) is the changeset most
2393 recently added to the repository (and therefore the most recently
2394 changed head).
2395
2396 If you have just made a commit, that commit will be the tip. If you
2397 have just pulled changes from another repository, the tip of that
2398 repository becomes the current tip. The "tip" tag is special and cannot
2399 be renamed or assigned to a different changeset.
2400
2401 This command is deprecated, please use hg heads instead.
2402
2403 Returns 0 on success.
2404
2405 Options:
2406
2407 -p, --patch
2408 show patch
2409
2410 -g, --git
2411 use git extended diff format
2412
2413 --style <STYLE>
2414 display using template map file (DEPRECATED)
2415
2416 -T,--template <TEMPLATE>
2417 display with template
2418
2419 Working directory management
2420 add
2421 add the specified files on the next commit:
2422
2423 hg add [OPTION]... [FILE]...
2424
2425 Schedule files to be version controlled and added to the repository.
2426
2427 The files will be added to the repository at the next commit. To undo
2428 an add before that, see hg forget.
2429
2430 If no names are given, add all files to the repository (except files
2431 matching .hgignore).
2432
2433 Examples:
2434
2435 • New (unknown) files are added automatically by hg add:
2436
2437 $ ls
2438 foo.c
2439 $ hg status
2440 ? foo.c
2441 $ hg add
2442 adding foo.c
2443 $ hg status
2444 A foo.c
2445
2446 • Specific files to be added can be specified:
2447
2448 $ ls
2449 bar.c foo.c
2450 $ hg status
2451 ? bar.c
2452 ? foo.c
2453 $ hg add bar.c
2454 $ hg status
2455 A bar.c
2456 ? foo.c
2457
2458 Returns 0 if all files are successfully added.
2459
2460 Options:
2461
2462 -I,--include <PATTERN[+]>
2463 include names matching the given patterns
2464
2465 -X,--exclude <PATTERN[+]>
2466 exclude names matching the given patterns
2467
2468 -S, --subrepos
2469 recurse into subrepositories
2470
2471 -n, --dry-run
2472 do not perform actions, just print output
2473
2474 [+] marked option can be specified multiple times
2475
2476 addremove
2477 add all new files, delete all missing files:
2478
2479 hg addremove [OPTION]... [FILE]...
2480
2481 Add all new files and remove all missing files from the repository.
2482
2483 Unless names are given, new files are ignored if they match any of the
2484 patterns in .hgignore. As with add, these changes take effect at the
2485 next commit.
2486
2487 Use the -s/--similarity option to detect renamed files. This option
2488 takes a percentage between 0 (disabled) and 100 (files must be identi‐
2489 cal) as its parameter. With a parameter greater than 0, this compares
2490 every removed file with every added file and records those similar
2491 enough as renames. Detecting renamed files this way can be expensive.
2492 After using this option, hg status -C can be used to check which files
2493 were identified as moved or renamed. If not specified, -s/--similarity
2494 defaults to 100 and only renames of identical files are detected.
2495
2496 Examples:
2497
2498 • A number of files (bar.c and foo.c) are new, while foobar.c has
2499 been removed (without using hg remove) from the repository:
2500
2501 $ ls
2502 bar.c foo.c
2503 $ hg status
2504 ! foobar.c
2505 ? bar.c
2506 ? foo.c
2507 $ hg addremove
2508 adding bar.c
2509 adding foo.c
2510 removing foobar.c
2511 $ hg status
2512 A bar.c
2513 A foo.c
2514 R foobar.c
2515
2516 • A file foobar.c was moved to foo.c without using hg rename. Af‐
2517 terwards, it was edited slightly:
2518
2519 $ ls
2520 foo.c
2521 $ hg status
2522 ! foobar.c
2523 ? foo.c
2524 $ hg addremove --similarity 90
2525 removing foobar.c
2526 adding foo.c
2527 recording removal of foobar.c as rename to foo.c (94% similar)
2528 $ hg status -C
2529 A foo.c
2530 foobar.c
2531 R foobar.c
2532
2533 Returns 0 if all files are successfully added.
2534
2535 Options:
2536
2537 -s,--similarity <SIMILARITY>
2538 guess renamed files by similarity (0<=s<=100)
2539
2540 -S, --subrepos
2541 recurse into subrepositories
2542
2543 -I,--include <PATTERN[+]>
2544 include names matching the given patterns
2545
2546 -X,--exclude <PATTERN[+]>
2547 exclude names matching the given patterns
2548
2549 -n, --dry-run
2550 do not perform actions, just print output
2551
2552 [+] marked option can be specified multiple times
2553
2554 files
2555 list tracked files:
2556
2557 hg files [OPTION]... [FILE]...
2558
2559 Print files under Mercurial control in the working directory or speci‐
2560 fied revision for given files (excluding removed files). Files can be
2561 specified as filenames or filesets.
2562
2563 If no files are given to match, this command prints the names of all
2564 files under Mercurial control.
2565
2566 Template:
2567
2568 The following keywords are supported in addition to the common template
2569 keywords and functions. See also hg help templates.
2570
2571 flags String. Character denoting file's symlink and executable bits.
2572
2573 path String. Repository-absolute path of the file.
2574
2575 size Integer. Size of the file in bytes.
2576
2577 Examples:
2578
2579 • list all files under the current directory:
2580
2581 hg files .
2582
2583 • shows sizes and flags for current revision:
2584
2585 hg files -vr .
2586
2587 • list all files named README:
2588
2589 hg files -I "**/README"
2590
2591 • list all binary files:
2592
2593 hg files "set:binary()"
2594
2595 • find files containing a regular expression:
2596
2597 hg files "set:grep('bob')"
2598
2599 • search tracked file contents with xargs and grep:
2600
2601 hg files -0 | xargs -0 grep foo
2602
2603 See hg help patterns and hg help filesets for more information on spec‐
2604 ifying file patterns.
2605
2606 Returns 0 if a match is found, 1 otherwise.
2607
2608 Options:
2609
2610 -r,--rev <REV>
2611 search the repository as it is in REV
2612
2613 -0, --print0
2614 end filenames with NUL, for use with xargs
2615
2616 -I,--include <PATTERN[+]>
2617 include names matching the given patterns
2618
2619 -X,--exclude <PATTERN[+]>
2620 exclude names matching the given patterns
2621
2622 -T,--template <TEMPLATE>
2623 display with template
2624
2625 -S, --subrepos
2626 recurse into subrepositories
2627
2628 [+] marked option can be specified multiple times
2629
2630 forget
2631 forget the specified files on the next commit:
2632
2633 hg forget [OPTION]... FILE...
2634
2635 Mark the specified files so they will no longer be tracked after the
2636 next commit.
2637
2638 This only removes files from the current branch, not from the entire
2639 project history, and it does not delete them from the working direc‐
2640 tory.
2641
2642 To delete the file from the working directory, see hg remove.
2643
2644 To undo a forget before the next commit, see hg add.
2645
2646 Examples:
2647
2648 • forget newly-added binary files:
2649
2650 hg forget "set:added() and binary()"
2651
2652 • forget files that would be excluded by .hgignore:
2653
2654 hg forget "set:hgignore()"
2655
2656 Returns 0 on success.
2657
2658 Options:
2659
2660 -i, --interactive
2661 use interactive mode
2662
2663 -I,--include <PATTERN[+]>
2664 include names matching the given patterns
2665
2666 -X,--exclude <PATTERN[+]>
2667 exclude names matching the given patterns
2668
2669 -n, --dry-run
2670 do not perform actions, just print output
2671
2672 [+] marked option can be specified multiple times
2673
2674 locate
2675 locate files matching specific patterns (DEPRECATED):
2676
2677 hg locate [OPTION]... [PATTERN]...
2678
2679 Print files under Mercurial control in the working directory whose
2680 names match the given patterns.
2681
2682 By default, this command searches all directories in the working direc‐
2683 tory. To search just the current directory and its subdirectories, use
2684 "--include .".
2685
2686 If no patterns are given to match, this command prints the names of all
2687 files under Mercurial control in the working directory.
2688
2689 If you want to feed the output of this command into the "xargs" com‐
2690 mand, use the -0 option to both this command and "xargs". This will
2691 avoid the problem of "xargs" treating single filenames that contain
2692 whitespace as multiple filenames.
2693
2694 See hg help files for a more versatile command.
2695
2696 Returns 0 if a match is found, 1 otherwise.
2697
2698 Options:
2699
2700 -r,--rev <REV>
2701 search the repository as it is in REV
2702
2703 -0, --print0
2704 end filenames with NUL, for use with xargs
2705
2706 -f, --fullpath
2707 print complete paths from the filesystem root
2708
2709 -I,--include <PATTERN[+]>
2710 include names matching the given patterns
2711
2712 -X,--exclude <PATTERN[+]>
2713 exclude names matching the given patterns
2714
2715 [+] marked option can be specified multiple times
2716
2717 remove
2718 remove the specified files on the next commit:
2719
2720 hg remove [OPTION]... FILE...
2721
2722 Schedule the indicated files for removal from the current branch.
2723
2724 This command schedules the files to be removed at the next commit. To
2725 undo a remove before that, see hg revert. To undo added files, see hg
2726 forget.
2727
2728 -A/--after can be used to remove only files that have already been
2729 deleted, -f/--force can be used to force deletion, and -Af can be used
2730 to remove files from the next revision without deleting them from the
2731 working directory.
2732
2733 The following table details the behavior of remove for different file
2734 states (columns) and option combinations (rows). The file states are
2735 Added [A], Clean [C], Modified [M] and Missing [!] (as reported by hg
2736 status). The actions are Warn, Remove (from branch) and Delete (from
2737 disk):
2738
2739 ┌──────────┬───┬────┬────┬───┐
2740 │opt/state │ A │ C │ M │ ! │
2741 ├──────────┼───┼────┼────┼───┤
2742 │none │ W │ RD │ W │ R │
2743 ├──────────┼───┼────┼────┼───┤
2744 │-f │ R │ RD │ RD │ R │
2745 ├──────────┼───┼────┼────┼───┤
2746 │-A │ W │ W │ W │ R │
2747 ├──────────┼───┼────┼────┼───┤
2748 │-Af │ R │ R │ R │ R │
2749 └──────────┴───┴────┴────┴───┘
2750
2751 Note hg remove never deletes files in Added [A] state from the work‐
2752 ing directory, not even if --force is specified.
2753
2754 Returns 0 on success, 1 if any warnings encountered.
2755
2756 Options:
2757
2758 -A, --after
2759 record delete for missing files
2760
2761 -f, --force
2762 forget added files, delete modified files
2763
2764 -S, --subrepos
2765 recurse into subrepositories
2766
2767 -I,--include <PATTERN[+]>
2768 include names matching the given patterns
2769
2770 -X,--exclude <PATTERN[+]>
2771 exclude names matching the given patterns
2772
2773 -n, --dry-run
2774 do not perform actions, just print output
2775
2776 [+] marked option can be specified multiple times
2777
2778 aliases: rm
2779
2780 rename
2781 rename files; equivalent of copy + remove:
2782
2783 hg rename [OPTION]... SOURCE... DEST
2784
2785 Mark dest as copies of sources; mark sources for deletion. If dest is a
2786 directory, copies are put in that directory. If dest is a file, there
2787 can only be one source.
2788
2789 By default, this command copies the contents of files as they exist in
2790 the working directory. If invoked with -A/--after, the operation is
2791 recorded, but no copying is performed.
2792
2793 This command takes effect at the next commit. To undo a rename before
2794 that, see hg revert.
2795
2796 Returns 0 on success, 1 if errors are encountered.
2797
2798 Options:
2799
2800 -A, --after
2801 record a rename that has already occurred
2802
2803 --at-rev <REV>
2804 (un)mark renames in the given revision (EXPERIMENTAL)
2805
2806 -f, --force
2807 forcibly move over an existing managed file
2808
2809 -I,--include <PATTERN[+]>
2810 include names matching the given patterns
2811
2812 -X,--exclude <PATTERN[+]>
2813 exclude names matching the given patterns
2814
2815 -n, --dry-run
2816 do not perform actions, just print output
2817
2818 [+] marked option can be specified multiple times
2819
2820 aliases: move mv
2821
2822 resolve
2823 redo merges or set/view the merge status of files:
2824
2825 hg resolve [OPTION]... [FILE]...
2826
2827 Merges with unresolved conflicts are often the result of non-interac‐
2828 tive merging using the internal:merge configuration setting, or a com‐
2829 mand-line merge tool like diff3. The resolve command is used to manage
2830 the files involved in a merge, after hg merge has been run, and before
2831 hg commit is run (i.e. the working directory must have two parents).
2832 See hg help merge-tools for information on configuring merge tools.
2833
2834 The resolve command can be used in the following ways:
2835
2836 • hg resolve [--re-merge] [--tool TOOL] FILE...: attempt to re-merge
2837 the specified files, discarding any previous merge attempts. Re-merg‐
2838 ing is not performed for files already marked as resolved. Use
2839 --all/-a to select all unresolved files. --tool can be used to spec‐
2840 ify the merge tool used for the given files. It overrides the HGMERGE
2841 environment variable and your configuration files. Previous file
2842 contents are saved with a .orig suffix.
2843
2844 • hg resolve -m [FILE]: mark a file as having been resolved (e.g. after
2845 having manually fixed-up the files). The default is to mark all unre‐
2846 solved files.
2847
2848 • hg resolve -u [FILE]...: mark a file as unresolved. The default is to
2849 mark all resolved files.
2850
2851 • hg resolve -l: list files which had or still have conflicts. In the
2852 printed list, U = unresolved and R = resolved. You can use set:unre‐
2853 solved() or set:resolved() to filter the list. See hg help filesets
2854 for details.
2855
2856 Note Mercurial will not let you commit files with unresolved merge
2857 conflicts. You must use hg resolve -m ... before you can commit
2858 after a conflicting merge.
2859
2860 Template:
2861
2862 The following keywords are supported in addition to the common template
2863 keywords and functions. See also hg help templates.
2864
2865 mergestatus
2866 String. Character denoting merge conflicts, U or R.
2867
2868 path String. Repository-absolute path of the file.
2869
2870 Returns 0 on success, 1 if any files fail a resolve attempt.
2871
2872 Options:
2873
2874 -a, --all
2875 select all unresolved files
2876
2877 -l, --list
2878 list state of files needing merge
2879
2880 -m, --mark
2881 mark files as resolved
2882
2883 -u, --unmark
2884 mark files as unresolved
2885
2886 -n, --no-status
2887 hide status prefix
2888
2889 --re-merge
2890 re-merge files
2891
2892 -t,--tool <TOOL>
2893 specify merge tool
2894
2895 -I,--include <PATTERN[+]>
2896 include names matching the given patterns
2897
2898 -X,--exclude <PATTERN[+]>
2899 exclude names matching the given patterns
2900
2901 -T,--template <TEMPLATE>
2902 display with template
2903
2904 [+] marked option can be specified multiple times
2905
2906 revert
2907 restore files to their checkout state:
2908
2909 hg revert [OPTION]... [-r REV] [NAME]...
2910
2911 Note To check out earlier revisions, you should use hg update REV.
2912 To cancel an uncommitted merge (and lose your changes), use hg
2913 merge --abort.
2914
2915 With no revision specified, revert the specified files or directories
2916 to the contents they had in the parent of the working directory. This
2917 restores the contents of files to an unmodified state and unschedules
2918 adds, removes, copies, and renames. If the working directory has two
2919 parents, you must explicitly specify a revision.
2920
2921 Using the -r/--rev or -d/--date options, revert the given files or di‐
2922 rectories to their states as of a specific revision. Because revert
2923 does not change the working directory parents, this will cause these
2924 files to appear modified. This can be helpful to "back out" some or all
2925 of an earlier change. See hg backout for a related method.
2926
2927 Modified files are saved with a .orig suffix before reverting. To dis‐
2928 able these backups, use --no-backup. It is possible to store the backup
2929 files in a custom directory relative to the root of the repository by
2930 setting the ui.origbackuppath configuration option.
2931
2932 See hg help dates for a list of formats valid for -d/--date.
2933
2934 See hg help backout for a way to reverse the effect of an earlier
2935 changeset.
2936
2937 Returns 0 on success.
2938
2939 Options:
2940
2941 -a, --all
2942 revert all changes when no arguments given
2943
2944 -d,--date <DATE>
2945 tipmost revision matching date
2946
2947 -r,--rev <REV>
2948 revert to the specified revision
2949
2950 -C, --no-backup
2951 do not save backup copies of files
2952
2953 -i, --interactive
2954 interactively select the changes
2955
2956 -I,--include <PATTERN[+]>
2957 include names matching the given patterns
2958
2959 -X,--exclude <PATTERN[+]>
2960 exclude names matching the given patterns
2961
2962 -n, --dry-run
2963 do not perform actions, just print output
2964
2965 [+] marked option can be specified multiple times
2966
2967 root
2968 print the root (top) of the current working directory:
2969
2970 hg root
2971
2972 Print the root directory of the current repository.
2973
2974 Template:
2975
2976 The following keywords are supported in addition to the common template
2977 keywords and functions. See also hg help templates.
2978
2979 hgpath String. Path to the .hg directory.
2980
2981 storepath
2982 String. Path to the directory holding versioned data.
2983
2984 Returns 0 on success.
2985
2986 Options:
2987
2988 -T,--template <TEMPLATE>
2989 display with template
2990
2991 shelve
2992 save and set aside changes from the working directory:
2993
2994 hg shelve [OPTION]... [FILE]...
2995
2996 Shelving takes files that "hg status" reports as not clean, saves the
2997 modifications to a bundle (a shelved change), and reverts the files so
2998 that their state in the working directory becomes clean.
2999
3000 To restore these changes to the working directory, using "hg unshelve";
3001 this will work even if you switch to a different commit.
3002
3003 When no files are specified, "hg shelve" saves all not-clean files. If
3004 specific files or directories are named, only changes to those files
3005 are shelved.
3006
3007 In bare shelve (when no files are specified, without interactive, in‐
3008 clude and exclude option), shelving remembers information if the work‐
3009 ing directory was on newly created branch, in other words working di‐
3010 rectory was on different branch than its first parent. In this situa‐
3011 tion unshelving restores branch information to the working directory.
3012
3013 Each shelved change has a name that makes it easier to find later. The
3014 name of a shelved change defaults to being based on the active book‐
3015 mark, or if there is no active bookmark, the current named branch. To
3016 specify a different name, use --name.
3017
3018 To see a list of existing shelved changes, use the --list option. For
3019 each shelved change, this will print its name, age, and description;
3020 use --patch or --stat for more details.
3021
3022 To delete specific shelved changes, use --delete. To delete all shelved
3023 changes, use --cleanup.
3024
3025 Options:
3026
3027 -A, --addremove
3028 mark new/missing files as added/removed before shelving
3029
3030 -u, --unknown
3031 store unknown files in the shelve
3032
3033 --cleanup
3034 delete all shelved changes
3035
3036 --date <DATE>
3037 shelve with the specified commit date
3038
3039 -d, --delete
3040 delete the named shelved change(s)
3041
3042 -e, --edit
3043 invoke editor on commit messages
3044
3045 -k, --keep
3046 shelve, but keep changes in the working directory
3047
3048 -l, --list
3049 list current shelves
3050
3051 -m,--message <TEXT>
3052 use text as shelve message
3053
3054 -n,--name <NAME>
3055 use the given name for the shelved commit
3056
3057 -p, --patch
3058 output patches for changes (provide the names of the shelved
3059 changes as positional arguments)
3060
3061 -i, --interactive
3062 interactive mode
3063
3064 --stat output diffstat-style summary of changes (provide the names of
3065 the shelved changes as positional arguments)
3066
3067 -I,--include <PATTERN[+]>
3068 include names matching the given patterns
3069
3070 -X,--exclude <PATTERN[+]>
3071 exclude names matching the given patterns
3072
3073 [+] marked option can be specified multiple times
3074
3075 status
3076 show changed files in the working directory:
3077
3078 hg status [OPTION]... [FILE]...
3079
3080 Show status of files in the repository. If names are given, only files
3081 that match are shown. Files that are clean or ignored or the source of
3082 a copy/move operation, are not listed unless -c/--clean, -i/--ignored,
3083 -C/--copies or -A/--all are given. Unless options described with "show
3084 only ..." are given, the options -mardu are used.
3085
3086 Option -q/--quiet hides untracked (unknown and ignored) files unless
3087 explicitly requested with -u/--unknown or -i/--ignored.
3088
3089 Note hg status may appear to disagree with diff if permissions have
3090 changed or a merge has occurred. The standard diff format does
3091 not report permission changes and diff only reports changes rel‐
3092 ative to one merge parent.
3093
3094 If one revision is given, it is used as the base revision. If two re‐
3095 visions are given, the differences between them are shown. The --change
3096 option can also be used as a shortcut to list the changed files of a
3097 revision from its first parent.
3098
3099 The codes used to show the status of files are:
3100
3101 M = modified
3102 A = added
3103 R = removed
3104 C = clean
3105 ! = missing (deleted by non-hg command, but still tracked)
3106 ? = not tracked
3107 I = ignored
3108 = origin of the previous file (with --copies)
3109
3110 The -t/--terse option abbreviates the output by showing only the direc‐
3111 tory name if all the files in it share the same status. The option
3112 takes an argument indicating the statuses to abbreviate: 'm' for 'modi‐
3113 fied', 'a' for 'added', 'r' for 'removed', 'd' for 'deleted', 'u' for
3114 'unknown', 'i' for 'ignored' and 'c' for clean.
3115
3116 It abbreviates only those statuses which are passed. Note that clean
3117 and ignored files are not displayed with '--terse ic' unless the
3118 -c/--clean and -i/--ignored options are also used.
3119
3120 The -v/--verbose option shows information when the repository is in an
3121 unfinished merge, shelve, rebase state etc. You can have this behavior
3122 turned on by default by enabling the commands.status.verbose option.
3123
3124 You can skip displaying some of these states by setting commands.sta‐
3125 tus.skipstates to one or more of: 'bisect', 'graft', 'histedit',
3126 'merge', 'rebase', or 'unshelve'.
3127
3128 Template:
3129
3130 The following keywords are supported in addition to the common template
3131 keywords and functions. See also hg help templates.
3132
3133 path String. Repository-absolute path of the file.
3134
3135 source String. Repository-absolute path of the file originated from.
3136 Available if --copies is specified.
3137
3138 status String. Character denoting file's status.
3139
3140 Examples:
3141
3142 • show changes in the working directory relative to a changeset:
3143
3144 hg status --rev 9353
3145
3146 • show changes in the working directory relative to the current direc‐
3147 tory (see hg help patterns for more information):
3148
3149 hg status re:
3150
3151 • show all changes including copies in an existing changeset:
3152
3153 hg status --copies --change 9353
3154
3155 • get a NUL separated list of added files, suitable for xargs:
3156
3157 hg status -an0
3158
3159 • show more information about the repository status, abbreviating
3160 added, removed, modified, deleted, and untracked paths:
3161
3162 hg status -v -t mardu
3163
3164 Returns 0 on success.
3165
3166 Options:
3167
3168 -A, --all
3169 show status of all files
3170
3171 -m, --modified
3172 show only modified files
3173
3174 -a, --added
3175 show only added files
3176
3177 -r, --removed
3178 show only removed files
3179
3180 -d, --deleted
3181 show only missing files
3182
3183 -c, --clean
3184 show only files without changes
3185
3186 -u, --unknown
3187 show only unknown (not tracked) files
3188
3189 -i, --ignored
3190 show only ignored files
3191
3192 -n, --no-status
3193 hide status prefix
3194
3195 -t,--terse <VALUE>
3196 show the terse output (EXPERIMENTAL) (default: nothing)
3197
3198 -C, --copies
3199 show source of copied files (DEFAULT: ui.statuscopies)
3200
3201 -0, --print0
3202 end filenames with NUL, for use with xargs
3203
3204 --rev <REV[+]>
3205 show difference from revision
3206
3207 --change <REV>
3208 list the changed files of a revision
3209
3210 -I,--include <PATTERN[+]>
3211 include names matching the given patterns
3212
3213 -X,--exclude <PATTERN[+]>
3214 exclude names matching the given patterns
3215
3216 -S, --subrepos
3217 recurse into subrepositories
3218
3219 -T,--template <TEMPLATE>
3220 display with template
3221
3222 [+] marked option can be specified multiple times
3223
3224 aliases: st
3225
3226 summary
3227 summarize working directory state:
3228
3229 hg summary [--remote]
3230
3231 This generates a brief summary of the working directory state, includ‐
3232 ing parents, branch, commit status, phase and available updates.
3233
3234 With the --remote option, this will check the default paths for incom‐
3235 ing and outgoing changes. This can be time-consuming.
3236
3237 Returns 0 on success.
3238
3239 Options:
3240
3241 --remote
3242 check for push and pull
3243
3244 aliases: sum
3245
3246 unshelve
3247 restore a shelved change to the working directory:
3248
3249 hg unshelve [OPTION]... [[-n] SHELVED]
3250
3251 This command accepts an optional name of a shelved change to restore.
3252 If none is given, the most recent shelved change is used.
3253
3254 If a shelved change is applied successfully, the bundle that contains
3255 the shelved changes is moved to a backup location (.hg/shelve-backup).
3256
3257 Since you can restore a shelved change on top of an arbitrary commit,
3258 it is possible that unshelving will result in a conflict between your
3259 changes and the commits you are unshelving onto. If this occurs, you
3260 must resolve the conflict, then use --continue to complete the unshelve
3261 operation. (The bundle will not be moved until you successfully com‐
3262 plete the unshelve.)
3263
3264 (Alternatively, you can use --abort to abandon an unshelve that causes
3265 a conflict. This reverts the unshelved changes, and leaves the bundle
3266 in place.)
3267
3268 If bare shelved change (without interactive, include and exclude op‐
3269 tion) was done on newly created branch it would restore branch informa‐
3270 tion to the working directory.
3271
3272 After a successful unshelve, the shelved changes are stored in a backup
3273 directory. Only the N most recent backups are kept. N defaults to 10
3274 but can be overridden using the shelve.maxbackups configuration option.
3275
3276 Timestamp in seconds is used to decide order of backups. More than
3277 maxbackups backups are kept, if same timestamp prevents from deciding
3278 exact order of them, for safety.
3279
3280 Selected changes can be unshelved with --interactive flag. The working
3281 directory is updated with the selected changes, and only the unselected
3282 changes remain shelved. Note: The whole shelve is applied to working
3283 directory first before running interactively. So, this will bring up
3284 all the conflicts between working directory and the shelve, irrespec‐
3285 tive of which changes will be unshelved.
3286
3287 Options:
3288
3289 -a, --abort
3290 abort an incomplete unshelve operation
3291
3292 -c, --continue
3293 continue an incomplete unshelve operation
3294
3295 -i, --interactive
3296 use interactive mode (EXPERIMENTAL)
3297
3298 -k, --keep
3299 keep shelve after unshelving
3300
3301 -n,--name <NAME>
3302 restore shelved change with given name
3303
3304 -t,--tool <VALUE>
3305 specify merge tool
3306
3307 --date <DATE>
3308 set date for temporary commits (DEPRECATED)
3309
3310 update
3311 update working directory (or switch revisions):
3312
3313 hg update [-C|-c|-m] [-d DATE] [[-r] REV]
3314
3315 Update the repository's working directory to the specified changeset.
3316 If no changeset is specified, update to the tip of the current named
3317 branch and move the active bookmark (see hg help bookmarks).
3318
3319 Update sets the working directory's parent revision to the specified
3320 changeset (see hg help parents).
3321
3322 If the changeset is not a descendant or ancestor of the working direc‐
3323 tory's parent and there are uncommitted changes, the update is aborted.
3324 With the -c/--check option, the working directory is checked for uncom‐
3325 mitted changes; if none are found, the working directory is updated to
3326 the specified changeset.
3327
3328 The -C/--clean, -c/--check, and -m/--merge options control what happens
3329 if the working directory contains uncommitted changes. At most of one
3330 of them can be specified.
3331
3332 1. If no option is specified, and if the requested changeset is an an‐
3333 cestor or descendant of the working directory's parent, the uncom‐
3334 mitted changes are merged into the requested changeset and the
3335 merged result is left uncommitted. If the requested changeset is not
3336 an ancestor or descendant (that is, it is on another branch), the
3337 update is aborted and the uncommitted changes are preserved.
3338
3339 2. With the -m/--merge option, the update is allowed even if the re‐
3340 quested changeset is not an ancestor or descendant of the working
3341 directory's parent.
3342
3343 3. With the -c/--check option, the update is aborted and the uncommit‐
3344 ted changes are preserved.
3345
3346 4. With the -C/--clean option, uncommitted changes are discarded and
3347 the working directory is updated to the requested changeset.
3348
3349 To cancel an uncommitted merge (and lose your changes), use hg merge
3350 --abort.
3351
3352 Use null as the changeset to remove the working directory (like hg
3353 clone -U).
3354
3355 If you want to revert just one file to an older revision, use hg revert
3356 [-r REV] NAME.
3357
3358 See hg help dates for a list of formats valid for -d/--date.
3359
3360 Returns 0 on success, 1 if there are unresolved files.
3361
3362 Options:
3363
3364 -C, --clean
3365 discard uncommitted changes (no backup)
3366
3367 -c, --check
3368 require clean working directory
3369
3370 -m, --merge
3371 merge uncommitted changes
3372
3373 -d,--date <DATE>
3374 tipmost revision matching date
3375
3376 -r,--rev <REV>
3377 revision
3378
3379 -t,--tool <TOOL>
3380 specify merge tool
3381
3382 aliases: up checkout co
3383
3384 Change import/export
3385 archive
3386 create an unversioned archive of a repository revision:
3387
3388 hg archive [OPTION]... DEST
3389
3390 By default, the revision used is the parent of the working directory;
3391 use -r/--rev to specify a different revision.
3392
3393 The archive type is automatically detected based on file extension (to
3394 override, use -t/--type).
3395
3396 Examples:
3397
3398 • create a zip file containing the 1.0 release:
3399
3400 hg archive -r 1.0 project-1.0.zip
3401
3402 • create a tarball excluding .hg files:
3403
3404 hg archive project.tar.gz -X ".hg*"
3405
3406 Valid types are:
3407
3408 files
3409
3410 a directory full of files (default)
3411
3412 tar
3413
3414 tar archive, uncompressed
3415
3416 tbz2
3417
3418 tar archive, compressed using bzip2
3419
3420 tgz
3421
3422 tar archive, compressed using gzip
3423
3424 txz
3425
3426 tar archive, compressed using lzma (only in Python 3)
3427
3428 uzip
3429
3430 zip archive, uncompressed
3431
3432 zip
3433
3434 zip archive, compressed using deflate
3435
3436 The exact name of the destination archive or directory is given using a
3437 format string; see hg help export for details.
3438
3439 Each member added to an archive file has a directory prefix prepended.
3440 Use -p/--prefix to specify a format string for the prefix. The default
3441 is the basename of the archive, with suffixes removed.
3442
3443 Returns 0 on success.
3444
3445 Options:
3446
3447 --no-decode
3448 do not pass files through decoders
3449
3450 -p,--prefix <PREFIX>
3451 directory prefix for files in archive
3452
3453 -r,--rev <REV>
3454 revision to distribute
3455
3456 -t,--type <TYPE>
3457 type of distribution to create
3458
3459 -S, --subrepos
3460 recurse into subrepositories
3461
3462 -I,--include <PATTERN[+]>
3463 include names matching the given patterns
3464
3465 -X,--exclude <PATTERN[+]>
3466 exclude names matching the given patterns
3467
3468 [+] marked option can be specified multiple times
3469
3470 bundle
3471 create a bundle file:
3472
3473 hg bundle [-f] [-t BUNDLESPEC] [-a] [-r REV]... [--base REV]... FILE [DEST]
3474
3475 Generate a bundle file containing data to be transferred to another
3476 repository.
3477
3478 To create a bundle containing all changesets, use -a/--all (or --base
3479 null). Otherwise, hg assumes the destination will have all the nodes
3480 you specify with --base parameters. Otherwise, hg will assume the
3481 repository has all the nodes in destination, or default-push/default if
3482 no destination is specified, where destination is the repository you
3483 provide through DEST option.
3484
3485 You can change bundle format with the -t/--type option. See hg help
3486 bundlespec for documentation on this format. By default, the most ap‐
3487 propriate format is used and compression defaults to bzip2.
3488
3489 The bundle file can then be transferred using conventional means and
3490 applied to another repository with the unbundle or pull command. This
3491 is useful when direct push and pull are not available or when exporting
3492 an entire repository is undesirable.
3493
3494 Applying bundles preserves all changeset contents including permis‐
3495 sions, copy/rename information, and revision history.
3496
3497 Returns 0 on success, 1 if no changes found.
3498
3499 Options:
3500
3501 -f, --force
3502 run even when the destination is unrelated
3503
3504 -r,--rev <REV[+]>
3505 a changeset intended to be added to the destination
3506
3507 -b,--branch <BRANCH[+]>
3508 a specific branch you would like to bundle
3509
3510 --base <REV[+]>
3511 a base changeset assumed to be available at the destination
3512
3513 -a, --all
3514 bundle all changesets in the repository
3515
3516 -t,--type <TYPE>
3517 bundle compression type to use (default: bzip2)
3518
3519 -e,--ssh <CMD>
3520 specify ssh command to use
3521
3522 --remotecmd <CMD>
3523 specify hg command to run on the remote side
3524
3525 --insecure
3526 do not verify server certificate (ignoring web.cacerts config)
3527
3528 [+] marked option can be specified multiple times
3529
3530 export
3531 dump the header and diffs for one or more changesets:
3532
3533 hg export [OPTION]... [-o OUTFILESPEC] [-r] [REV]...
3534
3535 Print the changeset header and diffs for one or more revisions. If no
3536 revision is given, the parent of the working directory is used.
3537
3538 The information shown in the changeset header is: author, date, branch
3539 name (if non-default), changeset hash, parent(s) and commit comment.
3540
3541 Note hg export may generate unexpected diff output for merge change‐
3542 sets, as it will compare the merge changeset against its first
3543 parent only.
3544
3545 Output may be to a file, in which case the name of the file is given
3546 using a template string. See hg help templates. In addition to the com‐
3547 mon template keywords, the following formatting rules are supported:
3548
3549 %%
3550
3551 literal "%" character
3552
3553 %H
3554
3555 changeset hash (40 hexadecimal digits)
3556
3557 %N
3558
3559 number of patches being generated
3560
3561 %R
3562
3563 changeset revision number
3564
3565 %b
3566
3567 basename of the exporting repository
3568
3569 %h
3570
3571 short-form changeset hash (12 hexadecimal digits)
3572
3573 %m
3574
3575 first line of the commit message (only alphanumeric characters)
3576
3577 %n
3578
3579 zero-padded sequence number, starting at 1
3580
3581 %r
3582
3583 zero-padded changeset revision number
3584
3585 \
3586
3587 literal "" character
3588
3589 Without the -a/--text option, export will avoid generating diffs of
3590 files it detects as binary. With -a, export will generate a diff any‐
3591 way, probably with undesirable results.
3592
3593 With -B/--bookmark changesets reachable by the given bookmark are se‐
3594 lected.
3595
3596 Use the -g/--git option to generate diffs in the git extended diff for‐
3597 mat. See hg help diffs for more information.
3598
3599 With the --switch-parent option, the diff will be against the second
3600 parent. It can be useful to review a merge.
3601
3602 Template:
3603
3604 The following keywords are supported in addition to the common template
3605 keywords and functions. See also hg help templates.
3606
3607 diff String. Diff content.
3608
3609 parents
3610 List of strings. Parent nodes of the changeset.
3611
3612 Examples:
3613
3614 • use export and import to transplant a bugfix to the current branch:
3615
3616 hg export -r 9353 | hg import -
3617
3618 • export all the changesets between two revisions to a file with rename
3619 information:
3620
3621 hg export --git -r 123:150 > changes.txt
3622
3623 • split outgoing changes into a series of patches with descriptive
3624 names:
3625
3626 hg export -r "outgoing()" -o "%n-%m.patch"
3627
3628 Returns 0 on success.
3629
3630 Options:
3631
3632 -B,--bookmark <BOOKMARK>
3633 export changes only reachable by given bookmark
3634
3635 -o,--output <FORMAT>
3636 print output to file with formatted name
3637
3638 --switch-parent
3639 diff against the second parent
3640
3641 -r,--rev <REV[+]>
3642 revisions to export
3643
3644 -a, --text
3645 treat all files as text
3646
3647 -g, --git
3648 use git extended diff format (DEFAULT: diff.git)
3649
3650 --binary
3651 generate binary diffs in git mode (default)
3652
3653 --nodates
3654 omit dates from diff headers
3655
3656 -T,--template <TEMPLATE>
3657 display with template
3658
3659 [+] marked option can be specified multiple times
3660
3661 import
3662 import an ordered set of patches:
3663
3664 hg import [OPTION]... PATCH...
3665
3666 Import a list of patches and commit them individually (unless --no-com‐
3667 mit is specified).
3668
3669 To read a patch from standard input (stdin), use "-" as the patch name.
3670 If a URL is specified, the patch will be downloaded from there.
3671
3672 Import first applies changes to the working directory (unless --bypass
3673 is specified), import will abort if there are outstanding changes.
3674
3675 Use --bypass to apply and commit patches directly to the repository,
3676 without affecting the working directory. Without --exact, patches will
3677 be applied on top of the working directory parent revision.
3678
3679 You can import a patch straight from a mail message. Even patches as
3680 attachments work (to use the body part, it must have type text/plain or
3681 text/x-patch). From and Subject headers of email message are used as
3682 default committer and commit message. All text/plain body parts before
3683 first diff are added to the commit message.
3684
3685 If the imported patch was generated by hg export, user and description
3686 from patch override values from message headers and body. Values given
3687 on command line with -m/--message and -u/--user override these.
3688
3689 If --exact is specified, import will set the working directory to the
3690 parent of each patch before applying it, and will abort if the result‐
3691 ing changeset has a different ID than the one recorded in the patch.
3692 This will guard against various ways that portable patch formats and
3693 mail systems might fail to transfer Mercurial data or metadata. See hg
3694 bundle for lossless transmission.
3695
3696 Use --partial to ensure a changeset will be created from the patch even
3697 if some hunks fail to apply. Hunks that fail to apply will be written
3698 to a <target-file>.rej file. Conflicts can then be resolved by hand be‐
3699 fore hg commit --amend is run to update the created changeset. This
3700 flag exists to let people import patches that partially apply without
3701 losing the associated metadata (author, date, description, ...).
3702
3703 Note When no hunks apply cleanly, hg import --partial will create an
3704 empty changeset, importing only the patch metadata.
3705
3706 With -s/--similarity, hg will attempt to discover renames and copies in
3707 the patch in the same way as hg addremove.
3708
3709 It is possible to use external patch programs to perform the patch by
3710 setting the ui.patch configuration option. For the default internal
3711 tool, the fuzz can also be configured via patch.fuzz. See hg help con‐
3712 fig for more information about configuration files and how to use these
3713 options.
3714
3715 See hg help dates for a list of formats valid for -d/--date.
3716
3717 Examples:
3718
3719 • import a traditional patch from a website and detect renames:
3720
3721 hg import -s 80 http://example.com/bugfix.patch
3722
3723 • import a changeset from an hgweb server:
3724
3725 hg import https://www.mercurial-scm.org/repo/hg/rev/5ca8c111e9aa
3726
3727 • import all the patches in an Unix-style mbox:
3728
3729 hg import incoming-patches.mbox
3730
3731 • import patches from stdin:
3732
3733 hg import -
3734
3735 • attempt to exactly restore an exported changeset (not always possi‐
3736 ble):
3737
3738 hg import --exact proposed-fix.patch
3739
3740 • use an external tool to apply a patch which is too fuzzy for the de‐
3741 fault internal tool.
3742
3743 hg import --config ui.patch="patch --merge" fuzzy.patch
3744
3745 • change the default fuzzing from 2 to a less strict 7
3746
3747 hg import --config ui.fuzz=7 fuzz.patch
3748
3749 Returns 0 on success, 1 on partial success (see --partial).
3750
3751 Options:
3752
3753 -p,--strip <NUM>
3754 directory strip option for patch. This has the same meaning as
3755 the corresponding patch option (default: 1)
3756
3757 -b,--base <PATH>
3758 base path (DEPRECATED)
3759
3760 --secret
3761 use the secret phase for committing
3762
3763 -e, --edit
3764 invoke editor on commit messages
3765
3766 -f, --force
3767 skip check for outstanding uncommitted changes (DEPRECATED)
3768
3769 --no-commit
3770 don't commit, just update the working directory
3771
3772 --bypass
3773 apply patch without touching the working directory
3774
3775 --partial
3776 commit even if some hunks fail
3777
3778 --exact
3779 abort if patch would apply lossily
3780
3781 --prefix <DIR>
3782 apply patch to subdirectory
3783
3784 --import-branch
3785 use any branch information in patch (implied by --exact)
3786
3787 -m,--message <TEXT>
3788 use text as commit message
3789
3790 -l,--logfile <FILE>
3791 read commit message from file
3792
3793 -d,--date <DATE>
3794 record the specified date as commit date
3795
3796 -u,--user <USER>
3797 record the specified user as committer
3798
3799 -s,--similarity <SIMILARITY>
3800 guess renamed files by similarity (0<=s<=100)
3801
3802 aliases: patch
3803
3804 unbundle
3805 apply one or more bundle files:
3806
3807 hg unbundle [-u] FILE...
3808
3809 Apply one or more bundle files generated by hg bundle.
3810
3811 Returns 0 on success, 1 if an update has unresolved files.
3812
3813 Options:
3814
3815 -u, --update
3816 update to new branch head if changesets were unbundled
3817
3818 Repository maintenance
3819 manifest
3820 output the current or given revision of the project manifest:
3821
3822 hg manifest [-r REV]
3823
3824 Print a list of version controlled files for the given revision. If no
3825 revision is given, the first parent of the working directory is used,
3826 or the null revision if no revision is checked out.
3827
3828 With -v, print file permissions, symlink and executable bits. With
3829 --debug, print file revision hashes.
3830
3831 If option --all is specified, the list of all files from all revisions
3832 is printed. This includes deleted and renamed files.
3833
3834 Returns 0 on success.
3835
3836 Options:
3837
3838 -r,--rev <REV>
3839 revision to display
3840
3841 --all list files from all revisions
3842
3843 -T,--template <TEMPLATE>
3844 display with template
3845
3846 recover
3847 roll back an interrupted transaction:
3848
3849 hg recover
3850
3851 Recover from an interrupted commit or pull.
3852
3853 This command tries to fix the repository status after an interrupted
3854 operation. It should only be necessary when Mercurial suggests it.
3855
3856 Returns 0 if successful, 1 if nothing to recover or verify fails.
3857
3858 Options:
3859
3860 --verify
3861 run hg verify after successful recover
3862
3863 rollback
3864 roll back the last transaction (DANGEROUS) (DEPRECATED):
3865
3866 hg rollback
3867
3868 Please use hg commit --amend instead of rollback to correct mistakes in
3869 the last commit.
3870
3871 This command should be used with care. There is only one level of roll‐
3872 back, and there is no way to undo a rollback. It will also restore the
3873 dirstate at the time of the last transaction, losing any dirstate
3874 changes since that time. This command does not alter the working direc‐
3875 tory.
3876
3877 Transactions are used to encapsulate the effects of all commands that
3878 create new changesets or propagate existing changesets into a reposi‐
3879 tory.
3880
3881 For example, the following commands are transactional, and their ef‐
3882 fects can be rolled back:
3883
3884 • commit
3885
3886 • import
3887
3888 • pull
3889
3890 • push (with this repository as the destination)
3891
3892 • unbundle
3893
3894 To avoid permanent data loss, rollback will refuse to rollback a commit
3895 transaction if it isn't checked out. Use --force to override this pro‐
3896 tection.
3897
3898 The rollback command can be entirely disabled by setting the ui.roll‐
3899 back configuration setting to false. If you're here because you want to
3900 use rollback and it's disabled, you can re-enable the command by set‐
3901 ting ui.rollback to true.
3902
3903 This command is not intended for use on public repositories. Once
3904 changes are visible for pull by other users, rolling a transaction back
3905 locally is ineffective (someone else may already have pulled the
3906 changes). Furthermore, a race is possible with readers of the reposi‐
3907 tory; for example an in-progress pull from the repository may fail if a
3908 rollback is performed.
3909
3910 Returns 0 on success, 1 if no rollback data is available.
3911
3912 Options:
3913
3914 -n, --dry-run
3915 do not perform actions, just print output
3916
3917 -f, --force
3918 ignore safety measures
3919
3920 verify
3921 verify the integrity of the repository:
3922
3923 hg verify
3924
3925 Verify the integrity of the current repository.
3926
3927 This will perform an extensive check of the repository's integrity,
3928 validating the hashes and checksums of each entry in the changelog,
3929 manifest, and tracked files, as well as the integrity of their
3930 crosslinks and indices.
3931
3932 Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
3933 information about recovery from corruption of the repository.
3934
3935 Returns 0 on success, 1 if errors are encountered.
3936
3937 Options:
3938
3939 --full perform more checks (EXPERIMENTAL)
3940
3941 Help
3942 config
3943 show combined config settings from all hgrc files:
3944
3945 hg config [-u] [NAME]...
3946
3947 With no arguments, print names and values of all config items.
3948
3949 With one argument of the form section.name, print just the value of
3950 that config item.
3951
3952 With multiple arguments, print names and values of all config items
3953 with matching section names or section.names.
3954
3955 With --edit, start an editor on the user-level config file. With
3956 --global, edit the system-wide config file. With --local, edit the
3957 repository-level config file.
3958
3959 With --debug, the source (filename and line number) is printed for each
3960 config item.
3961
3962 See hg help config for more information about config files.
3963
3964 --non-shared flag is used to edit .hg/hgrc-not-shared config file.
3965 This file is not shared across shares when in share-safe mode.
3966
3967 Template:
3968
3969 The following keywords are supported. See also hg help templates.
3970
3971 name String. Config name.
3972
3973 source String. Filename and line number where the item is defined.
3974
3975 value String. Config value.
3976
3977 The --shared flag can be used to edit the config file of shared source
3978 repository. It only works when you have shared using the experimental
3979 share safe feature.
3980
3981 Returns 0 on success, 1 if NAME does not exist.
3982
3983 Options:
3984
3985 -u, --untrusted
3986 show untrusted configuration options
3987
3988 -e, --edit
3989 edit user config
3990
3991 -l, --local
3992 edit repository config
3993
3994 --shared
3995 edit shared source repository config (EXPERIMENTAL)
3996
3997 --non-shared
3998 edit non shared config (EXPERIMENTAL)
3999
4000 -g, --global
4001 edit global config
4002
4003 -T,--template <TEMPLATE>
4004 display with template
4005
4006 aliases: showconfig debugconfig
4007
4008 help
4009 show help for a given topic or a help overview:
4010
4011 hg help [-eck] [-s PLATFORM] [TOPIC]
4012
4013 With no arguments, print a list of commands with short help messages.
4014
4015 Given a topic, extension, or command name, print help for that topic.
4016
4017 Returns 0 if successful.
4018
4019 Options:
4020
4021 -e, --extension
4022 show only help for extensions
4023
4024 -c, --command
4025 show only help for commands
4026
4027 -k, --keyword
4028 show topics matching keyword
4029
4030 -s,--system <PLATFORM[+]>
4031 show help for specific platform(s)
4032
4033 [+] marked option can be specified multiple times
4034
4035 version
4036 output version and copyright information:
4037
4038 hg version
4039
4040 Template:
4041
4042 The following keywords are supported. See also hg help templates.
4043
4044 extensions
4045 List of extensions.
4046
4047 ver String. Version number.
4048
4049 And each entry of {extensions} provides the following sub-keywords in
4050 addition to {ver}.
4051
4052 bundled
4053 Boolean. True if included in the release.
4054
4055 name String. Extension name.
4056
4057 Options:
4058
4059 -T,--template <TEMPLATE>
4060 display with template
4061
4062 Uncategorized commands
4064 Mercurial supports generating standalone "bundle" files that hold
4065 repository data. These "bundles" are typically saved locally and used
4066 later or exchanged between different repositories, possibly on differ‐
4067 ent machines. Example commands using bundles are hg bundle and hg un‐
4068 bundle.
4069
4070 Generation of bundle files is controlled by a "bundle specification"
4071 ("bundlespec") string. This string tells the bundle generation process
4072 how to create the bundle.
4073
4074 A "bundlespec" string is composed of the following elements:
4075
4076 type A string denoting the bundle format to use.
4077
4078 compression
4079 Denotes the compression engine to use compressing the raw bundle
4080 data.
4081
4082 parameters
4083 Arbitrary key-value parameters to further control bundle genera‐
4084 tion.
4085
4086 A "bundlespec" string has the following formats:
4087
4088 <type> The literal bundle format string is used.
4089
4090 <compression>-<type>
4091 The compression engine and format are delimited by a hyphen (-).
4092
4093 Optional parameters follow the <type>. Parameters are URI escaped
4094 key=value pairs. Each pair is delimited by a semicolon (;). The first
4095 parameter begins after a ; immediately following the <type> value.
4096
4097 Available Types
4098 The following bundle <type> strings are available:
4099
4100 v1 Produces a legacy "changegroup" version 1 bundle.
4101
4102 This format is compatible with nearly all Mercurial clients be‐
4103 cause it is the oldest. However, it has some limitations, which
4104 is why it is no longer the default for new repositories.
4105
4106 v1 bundles can be used with modern repositories using the "gen‐
4107 eraldelta" storage format. However, it may take longer to pro‐
4108 duce the bundle and the resulting bundle may be significantly
4109 larger than a v2 bundle.
4110
4111 v1 bundles can only use the gzip, bzip2, and none compression
4112 formats.
4113
4114 v2 Produces a version 2 bundle.
4115
4116 Version 2 bundles are an extensible format that can store addi‐
4117 tional repository data (such as bookmarks and phases informa‐
4118 tion) and they can store data more efficiently, resulting in
4119 smaller bundles.
4120
4121 Version 2 bundles can also use modern compression engines, such
4122 as zstd, making them faster to compress and often smaller.
4123
4124 Available Compression Engines
4125 The following bundle <compression> engines can be used:
4126
4127 bzip2
4128
4129 An algorithm that produces smaller bundles than gzip.
4130
4131 All Mercurial clients should support this format.
4132
4133 This engine will likely produce smaller bundles than gzip but
4134 will be significantly slower, both during compression and decom‐
4135 pression.
4136
4137 If available, the zstd engine can yield similar or better com‐
4138 pression at much higher speeds.
4139
4140 gzip
4141
4142 zlib compression using the DEFLATE algorithm.
4143
4144 All Mercurial clients should support this format. The compres‐
4145 sion algorithm strikes a reasonable balance between compression
4146 ratio and size.
4147
4148 none
4149
4150 No compression is performed.
4151
4152 Use this compression engine to explicitly disable compression.
4153
4154 Examples
4155 v2
4156
4157 Produce a v2 bundle using default options, including compres‐
4158 sion.
4159
4160 none-v1
4161
4162 Produce a v1 bundle with no compression.
4163
4164 zstd-v2
4165
4166 Produce a v2 bundle with zstandard compression using default
4167 settings.
4168
4169 zstd-v1
4170
4171 This errors because zstd is not supported for v1 types.
4172
4174 Mercurial colorizes output from several commands.
4175
4176 For example, the diff command shows additions in green and deletions in
4177 red, while the status command shows modified files in magenta. Many
4178 other commands have analogous colors. It is possible to customize these
4179 colors.
4180
4181 To enable color (default) whenever possible use:
4182
4183 [ui]
4184 color = yes
4185
4186 To disable color use:
4187
4188 [ui]
4189 color = no
4190
4191 See hg help config.ui.color for details.
4192
4193 The default pager on Windows does not support color, so enabling the
4194 pager will effectively disable color. See hg help config.ui.paginate
4195 to disable the pager. Alternately, MSYS and Cygwin shells provide less
4196 as a pager, which can be configured to support ANSI color mode. Win‐
4197 dows 10 natively supports ANSI color mode.
4198
4199 Mode
4200 Mercurial can use various systems to display color. The supported modes
4201 are ansi, win32, and terminfo. See hg help config.color for details
4202 about how to control the mode.
4203
4204 Effects
4205 Other effects in addition to color, like bold and underlined text, are
4206 also available. By default, the terminfo database is used to find the
4207 terminal codes used to change color and effect. If terminfo is not
4208 available, then effects are rendered with the ECMA-48 SGR control func‐
4209 tion (aka ANSI escape codes).
4210
4211 The available effects in terminfo mode are 'blink', 'bold', 'dim', 'in‐
4212 verse', 'invisible', 'italic', 'standout', and 'underline'; in ECMA-48
4213 mode, the options are 'bold', 'inverse', 'italic', and 'underline'.
4214 How each is rendered depends on the terminal emulator. Some may not be
4215 available for a given terminal type, and will be silently ignored.
4216
4217 If the terminfo entry for your terminal is missing codes for an effect
4218 or has the wrong codes, you can add or override those codes in your
4219 configuration:
4220
4221 [color]
4222 terminfo.dim = \E[2m
4223
4224 where 'E' is substituted with an escape character.
4225
4226 Labels
4227 Text receives color effects depending on the labels that it has. Many
4228 default Mercurial commands emit labelled text. You can also define your
4229 own labels in templates using the label function, see hg help templates
4230 . A single portion of text may have more than one label. In that case,
4231 effects given to the last label will override any other effects. This
4232 includes the special "none" effect, which nullifies other effects.
4233
4234 Labels are normally invisible. In order to see these labels and their
4235 position in the text, use the global --color=debug option. The same an‐
4236 chor text may be associated to multiple labels, e.g.
4237
4238 [log.changeset changeset.secret|changeset: 22611:6f0a53c8f587]
4239
4240 The following are the default effects for some default labels. Default
4241 effects may be overridden from your configuration file:
4242
4243 [color]
4244 status.modified = blue bold underline red_background
4245 status.added = green bold
4246 status.removed = red bold blue_background
4247 status.deleted = cyan bold underline
4248 status.unknown = magenta bold underline
4249 status.ignored = black bold
4250
4251 # 'none' turns off all effects
4252 status.clean = none
4253 status.copied = none
4254
4255 qseries.applied = blue bold underline
4256 qseries.unapplied = black bold
4257 qseries.missing = red bold
4258
4259 diff.diffline = bold
4260 diff.extended = cyan bold
4261 diff.file_a = red bold
4262 diff.file_b = green bold
4263 diff.hunk = magenta
4264 diff.deleted = red
4265 diff.inserted = green
4266 diff.changed = white
4267 diff.tab =
4268 diff.trailingwhitespace = bold red_background
4269
4270 # Blank so it inherits the style of the surrounding label
4271 changeset.public =
4272 changeset.draft =
4273 changeset.secret =
4274
4275 resolve.unresolved = red bold
4276 resolve.resolved = green bold
4277
4278 bookmarks.active = green
4279
4280 branches.active = none
4281 branches.closed = black bold
4282 branches.current = green
4283 branches.inactive = none
4284
4285 tags.normal = green
4286 tags.local = black bold
4287
4288 rebase.rebased = blue
4289 rebase.remaining = red bold
4290
4291 shelve.age = cyan
4292 shelve.newest = green bold
4293 shelve.name = blue bold
4294
4295 histedit.remaining = red bold
4296
4297 Custom colors
4298 Because there are only eight standard colors, Mercurial allows you to
4299 define color names for other color slots which might be available for
4300 your terminal type, assuming terminfo mode. For instance:
4301
4302 color.brightblue = 12
4303 color.pink = 207
4304 color.orange = 202
4305
4306 to set 'brightblue' to color slot 12 (useful for 16 color terminals
4307 that have brighter colors defined in the upper eight) and, 'pink' and
4308 'orange' to colors in 256-color xterm's default color cube. These de‐
4309 fined colors may then be used as any of the pre-defined eight, includ‐
4310 ing appending '_background' to set the background to that color.
4311
4313 Some commands allow the user to specify a date, e.g.:
4314
4315 • backout, commit, import, tag: Specify the commit date.
4316
4317 • log, revert, update: Select revision(s) by date.
4318
4319 Many date formats are valid. Here are some examples:
4320
4321 • Wed Dec 6 13:18:29 2006 (local timezone assumed)
4322
4323 • Dec 6 13:18 -0600 (year assumed, time offset provided)
4324
4325 • Dec 6 13:18 UTC (UTC and GMT are aliases for +0000)
4326
4327 • Dec 6 (midnight)
4328
4329 • 13:18 (today assumed)
4330
4331 • 3:39 (3:39AM assumed)
4332
4333 • 3:39pm (15:39)
4334
4335 • 2006-12-06 13:18:29 (ISO 8601 format)
4336
4337 • 2006-12-6 13:18
4338
4339 • 2006-12-6
4340
4341 • 12-6
4342
4343 • 12/6
4344
4345 • 12/6/6 (Dec 6 2006)
4346
4347 • today (midnight)
4348
4349 • yesterday (midnight)
4350
4351 • now - right now
4352
4353 Lastly, there is Mercurial's internal format:
4354
4355 • 1165411109 0 (Wed Dec 6 13:18:29 2006 UTC)
4356
4357 This is the internal representation format for dates. The first number
4358 is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
4359 second is the offset of the local timezone, in seconds west of UTC
4360 (negative if the timezone is east of UTC).
4361
4362 The log command also accepts date ranges:
4363
4364 • <DATE - at or before a given date/time
4365
4366 • >DATE - on or after a given date/time
4367
4368 • DATE to DATE - a date range, inclusive
4369
4370 • -DAYS - within a given number of days from today
4371
4373 Mercurial evolves over time, some features, options, commands may be
4374 replaced by better and more secure alternatives. This topic will help
4375 you migrating your existing usage and/or configuration to newer fea‐
4376 tures.
4377
4378 Commands
4379 The following commands are still available but their use are not recom‐
4380 mended:
4381
4382 locate
4383
4384 This command has been replaced by hg files.
4385
4386 parents
4387
4388 This command can be replaced by hg summary or hg log with appropriate
4389 revsets. See hg help revsets for more information.
4390
4391 tip
4392
4393 The recommended alternative is hg heads.
4394
4395 Options
4396 web.allowpull
4397
4398 Renamed to allow-pull.
4399
4400 web.allow_push
4401
4402 Renamed to allow-push.
4403
4405 Mercurial's default format for showing changes between two versions of
4406 a file is compatible with the unified format of GNU diff, which can be
4407 used by GNU patch and many other standard tools.
4408
4409 While this standard format is often enough, it does not encode the fol‐
4410 lowing information:
4411
4412 • executable status and other permission bits
4413
4414 • copy or rename information
4415
4416 • changes in binary files
4417
4418 • creation or deletion of empty files
4419
4420 Mercurial also supports the extended diff format from the git VCS which
4421 addresses these limitations. The git diff format is not produced by de‐
4422 fault because a few widespread tools still do not understand this for‐
4423 mat.
4424
4425 This means that when generating diffs from a Mercurial repository (e.g.
4426 with hg export), you should be careful about things like file copies
4427 and renames or other things mentioned above, because when applying a
4428 standard diff to a different repository, this extra information is
4429 lost. Mercurial's internal operations (like push and pull) are not af‐
4430 fected by this, because they use an internal binary format for communi‐
4431 cating changes.
4432
4433 To make Mercurial produce the git extended diff format, use the --git
4434 option available for many commands, or set 'git = True' in the [diff]
4435 section of your configuration file. You do not need to set this option
4436 when importing diffs in this format or using them in the mq extension.
4437
4439 HG Path to the 'hg' executable, automatically passed when running
4440 hooks, extensions or external tools. If unset or empty, this is
4441 the hg executable's name if it's frozen, or an executable named
4442 'hg' (with %PATHEXT% [defaulting to COM/EXE/BAT/CMD] extensions
4443 on Windows) is searched.
4444
4445 HGEDITOR
4446 This is the name of the editor to run when committing. See EDI‐
4447 TOR.
4448
4449 (deprecated, see hg help config.ui.editor)
4450
4451 HGENCODING
4452 This overrides the default locale setting detected by Mercurial.
4453 This setting is used to convert data including usernames,
4454 changeset descriptions, tag names, and branches. This setting
4455 can be overridden with the --encoding command-line option.
4456
4457 HGENCODINGMODE
4458 This sets Mercurial's behavior for handling unknown characters
4459 while transcoding user input. The default is "strict", which
4460 causes Mercurial to abort if it can't map a character. Other
4461 settings include "replace", which replaces unknown characters,
4462 and "ignore", which drops them. This setting can be overridden
4463 with the --encodingmode command-line option.
4464
4465 HGENCODINGAMBIGUOUS
4466 This sets Mercurial's behavior for handling characters with "am‐
4467 biguous" widths like accented Latin characters with East Asian
4468 fonts. By default, Mercurial assumes ambiguous characters are
4469 narrow, set this variable to "wide" if such characters cause
4470 formatting problems.
4471
4472 HGMERGE
4473 An executable to use for resolving merge conflicts. The program
4474 will be executed with three arguments: local file, remote file,
4475 ancestor file.
4476
4477 (deprecated, see hg help config.ui.merge)
4478
4479 HGRCPATH
4480 A list of files or directories to search for configuration
4481 files. Item separator is ":" on Unix, ";" on Windows. If HGRC‐
4482 PATH is not set, platform default search path is used. If empty,
4483 only the .hg/hgrc from the current repository is read.
4484
4485 For each element in HGRCPATH:
4486
4487 • if it's a directory, all files ending with .rc are added
4488
4489 • otherwise, the file itself will be added
4490
4491 HGRCSKIPREPO
4492 When set, the .hg/hgrc from repositories are not read.
4493
4494 HGPLAIN
4495 When set, this disables any configuration settings that might
4496 change Mercurial's default output. This includes encoding, de‐
4497 faults, verbose mode, debug mode, quiet mode, tracebacks, and
4498 localization. This can be useful when scripting against Mercu‐
4499 rial in the face of existing user configuration.
4500
4501 In addition to the features disabled by HGPLAIN=, the following
4502 values can be specified to adjust behavior:
4503
4504 +strictflags
4505
4506 Restrict parsing of command line flags.
4507
4508 Equivalent options set via command line flags or environment
4509 variables are not overridden.
4510
4511 See hg help scripting for details.
4512
4513 HGPLAINEXCEPT
4514 This is a comma-separated list of features to preserve when HG‐
4515 PLAIN is enabled. Currently the following values are supported:
4516
4517 alias
4518
4519 Don't remove aliases.
4520
4521 color
4522
4523 Don't disable colored output.
4524
4525 i18n
4526
4527 Preserve internationalization.
4528
4529 revsetalias
4530
4531 Don't remove revset aliases.
4532
4533 templatealias
4534
4535 Don't remove template aliases.
4536
4537 progress
4538
4539 Don't hide progress output.
4540
4541 Setting HGPLAINEXCEPT to anything (even an empty string) will
4542 enable plain mode.
4543
4544 HGUSER This is the string used as the author of a commit. If not set,
4545 available values will be considered in this order:
4546
4547 • HGUSER (deprecated)
4548
4549 • configuration files from the HGRCPATH
4550
4551 • EMAIL
4552
4553 • interactive prompt
4554
4555 • LOGNAME (with @hostname appended)
4556
4557 (deprecated, see hg help config.ui.username)
4558
4559 EMAIL May be used as the author of a commit; see HGUSER.
4560
4561 LOGNAME
4562 May be used as the author of a commit; see HGUSER.
4563
4564 VISUAL This is the name of the editor to use when committing. See EDI‐
4565 TOR.
4566
4567 EDITOR Sometimes Mercurial needs to open a text file in an editor for a
4568 user to modify, for example when writing commit messages. The
4569 editor it uses is determined by looking at the environment vari‐
4570 ables HGEDITOR, VISUAL and EDITOR, in that order. The first
4571 non-empty one is chosen. If all of them are empty, the editor
4572 defaults to 'vi'.
4573
4574 PYTHONPATH
4575 This is used by Python to find imported modules and may need to
4576 be set appropriately if this Mercurial is not installed sys‐
4577 tem-wide.
4578
4580 Mercurial has the ability to add new features through the use of exten‐
4581 sions. Extensions may add new commands, add options to existing com‐
4582 mands, change the default behavior of commands, or implement hooks.
4583
4584 To enable the "foo" extension, either shipped with Mercurial or in the
4585 Python search path, create an entry for it in your configuration file,
4586 like this:
4587
4588 [extensions]
4589 foo =
4590
4591 You may also specify the full path to an extension:
4592
4593 [extensions]
4594 myfeature = ~/.hgext/myfeature.py
4595
4596 See hg help config for more information on configuration files.
4597
4598 Extensions are not loaded by default for a variety of reasons: they can
4599 increase startup overhead; they may be meant for advanced usage only;
4600 they may provide potentially dangerous abilities (such as letting you
4601 destroy or modify history); they might not be ready for prime time; or
4602 they may alter some usual behaviors of stock Mercurial. It is thus up
4603 to the user to activate extensions as needed.
4604
4605 To explicitly disable an extension enabled in a configuration file of
4606 broader scope, prepend its path with !:
4607
4608 [extensions]
4609 # disabling extension bar residing in /path/to/extension/bar.py
4610 bar = !/path/to/extension/bar.py
4611 # ditto, but no path was supplied for extension baz
4612 baz = !
4613
4614 disabled extensions:
4615
4616 acl hooks for controlling repository access
4617
4618 blackbox
4619 log repository events to a blackbox for debugging
4620
4621 bugzilla
4622 hooks for integrating with the Bugzilla bug tracker
4623
4624 censor erase file content at a given revision
4625
4626 churn command to display statistics about repository history
4627
4628 clonebundles
4629 advertise pre-generated bundles to seed clones
4630
4631 closehead
4632 close arbitrary heads without checking them out first
4633
4634 convert
4635 import revisions from foreign VCS repositories into Mercurial
4636
4637 eol automatically manage newlines in repository files
4638
4639 extdiff
4640 command to allow external programs to compare revisions
4641
4642 factotum
4643 http authentication with factotum
4644
4645 fastexport
4646 export repositories as git fast-import stream
4647
4648 githelp
4649 try mapping git commands to Mercurial commands
4650
4651 gpg commands to sign and verify changesets
4652
4653 hgk browse the repository in a graphical way
4654
4655 highlight
4656 syntax highlighting for hgweb (requires Pygments)
4657
4658 histedit
4659 interactive history editing
4660
4661 keyword
4662 expand keywords in tracked files
4663
4664 largefiles
4665 track large binary files
4666
4667 mq manage a stack of patches
4668
4669 notify hooks for sending email push notifications
4670
4671 patchbomb
4672 command to send changesets as (a series of) patch emails
4673
4674 purge command to delete untracked files from the working directory
4675
4676 rebase command to move sets of revisions to a different ancestor
4677
4678 relink recreates hardlinks between repository clones
4679
4680 schemes
4681 extend schemes with shortcuts to repository swarms
4682
4683 share share a common history between several working directories
4684
4685 transplant
4686 command to transplant changesets from another branch
4687
4688 win32mbcs
4689 allow the use of MBCS paths with problematic encodings
4690
4691 zeroconf
4692 discover and advertise repositories on the local network
4693
4695 Mercurial supports a functional language for selecting a set of files.
4696
4697 Like other file patterns, this pattern type is indicated by a prefix,
4698 'set:'. The language supports a number of predicates which are joined
4699 by infix operators. Parenthesis can be used for grouping.
4700
4701 Identifiers such as filenames or patterns must be quoted with single or
4702 double quotes if they contain characters outside of
4703 [.*{}[]?/\_a-zA-Z0-9\x80-\xff] or if they match one of the predefined
4704 predicates. This generally applies to file patterns other than globs
4705 and arguments for predicates. Pattern prefixes such as path: may be
4706 specified without quoting.
4707
4708 Special characters can be used in quoted identifiers by escaping them,
4709 e.g., \n is interpreted as a newline. To prevent them from being inter‐
4710 preted, strings can be prefixed with r, e.g. r'...'.
4711
4712 See also hg help patterns.
4713
4714 Operators
4715 There is a single prefix operator:
4716
4717 not x
4718
4719 Files not in x. Short form is ! x.
4720
4721 These are the supported infix operators:
4722
4723 x and y
4724
4725 The intersection of files in x and y. Short form is x & y.
4726
4727 x or y
4728
4729 The union of files in x and y. There are two alternative short
4730 forms: x | y and x + y.
4731
4732 x - y
4733
4734 Files in x but not in y.
4735
4736 Predicates
4737 The following predicates are supported:
4738
4739 added()
4740
4741 File that is added according to hg status.
4742
4743 binary()
4744
4745 File that appears to be binary (contains NUL bytes).
4746
4747 clean()
4748
4749 File that is clean according to hg status.
4750
4751 copied()
4752
4753 File that is recorded as being copied.
4754
4755 deleted()
4756
4757 Alias for missing().
4758
4759 encoding(name)
4760
4761 File can be successfully decoded with the given character encod‐
4762 ing. May not be useful for encodings other than ASCII and UTF-8.
4763
4764 eol(style)
4765
4766 File contains newlines of the given style (dos, unix, mac). Bi‐
4767 nary files are excluded, files with mixed line endings match
4768 multiple styles.
4769
4770 exec()
4771
4772 File that is marked as executable.
4773
4774 grep(regex)
4775
4776 File contains the given regular expression.
4777
4778 hgignore()
4779
4780 File that matches the active .hgignore pattern.
4781
4782 ignored()
4783
4784 File that is ignored according to hg status.
4785
4786 missing()
4787
4788 File that is missing according to hg status.
4789
4790 modified()
4791
4792 File that is modified according to hg status.
4793
4794 portable()
4795
4796 File that has a portable name. (This doesn't include filenames
4797 with case collisions.)
4798
4799 removed()
4800
4801 File that is removed according to hg status.
4802
4803 resolved()
4804
4805 File that is marked resolved according to hg resolve -l.
4806
4807 revs(revs, pattern)
4808
4809 Evaluate set in the specified revisions. If the revset match
4810 multiple revs, this will return file matching pattern in any of
4811 the revision.
4812
4813 size(expression)
4814
4815 File size matches the given expression. Examples:
4816
4817 • size('1k') - files from 1024 to 2047 bytes
4818
4819 • size('< 20k') - files less than 20480 bytes
4820
4821 • size('>= .5MB') - files at least 524288 bytes
4822
4823 • size('4k - 1MB') - files from 4096 bytes to 1048576 bytes
4824
4825 status(base, rev, pattern)
4826
4827 Evaluate predicate using status change between base and rev. Ex‐
4828 amples:
4829
4830 • status(3, 7, added()) - matches files added from "3" to "7"
4831
4832 subrepo([pattern])
4833
4834 Subrepositories whose paths match the given pattern.
4835
4836 symlink()
4837
4838 File that is marked as a symlink.
4839
4840 tracked()
4841
4842 File that is under Mercurial control.
4843
4844 unknown()
4845
4846 File that is unknown according to hg status.
4847
4848 unresolved()
4849
4850 File that is marked unresolved according to hg resolve -l.
4851
4852 Examples
4853 Some sample queries:
4854
4855 • Show status of files that appear to be binary in the working direc‐
4856 tory:
4857
4858 hg status -A "set:binary()"
4859
4860 • Forget files that are in .hgignore but are already tracked:
4861
4862 hg forget "set:hgignore() and not ignored()"
4863
4864 • Find text files that contain a string:
4865
4866 hg files "set:grep(magic) and not binary()"
4867
4868 • Find C files in a non-standard encoding:
4869
4870 hg files "set:**.c and not encoding('UTF-8')"
4871
4872 • Revert copies of large binary files:
4873
4874 hg revert "set:copied() and binary() and size('>1M')"
4875
4876 • Revert files that were added to the working directory:
4877
4878 hg revert "set:revs('wdir()', added())"
4879
4880 • Remove files listed in foo.lst that contain the letter a or b:
4881
4882 hg remove "set: listfile:foo.lst and (**a* or **b*)"
4883
4885 Most Mercurial commands accept various flags.
4886
4887 Flag names
4888 Flags for each command are listed in hg help for that command. Addi‐
4889 tionally, some flags, such as --repository, are global and can be used
4890 with any command - those are seen in hg help -v, and can be specified
4891 before or after the command.
4892
4893 Every flag has at least a long name, such as --repository. Some flags
4894 may also have a short one-letter name, such as the equivalent -R. Using
4895 the short or long name is equivalent and has the same effect. The long
4896 name may be abbreviated to any unambiguous prefix. For example, hg com‐
4897 mit --amend can be abbreviated to hg commit --am.
4898
4899 Flags that have a short name can also be bundled together - for in‐
4900 stance, to specify both --edit (short -e) and --interactive (short -i),
4901 one could use:
4902
4903 hg commit -ei
4904
4905 If any of the bundled flags takes a value (i.e. is not a boolean), it
4906 must be last, followed by the value:
4907
4908 hg commit -im 'Message'
4909
4910 Flag types
4911 Mercurial command-line flags can be strings, numbers, booleans, or
4912 lists of strings.
4913
4914 Specifying flag values
4915 The following syntaxes are allowed, assuming a flag 'flagname' with
4916 short name 'f':
4917
4918 --flagname=foo
4919 --flagname foo
4920 -f foo
4921 -ffoo
4922
4923 This syntax applies to all non-boolean flags (strings, numbers or
4924 lists).
4925
4926 Specifying boolean flags
4927 Boolean flags do not take a value parameter. To specify a boolean, use
4928 the flag name to set it to true, or the same name prefixed with 'no-'
4929 to set it to false:
4930
4931 hg commit --interactive
4932 hg commit --no-interactive
4933
4934 Specifying list flags
4935 List flags take multiple values. To specify them, pass the flag multi‐
4936 ple times:
4937
4938 hg files --include mercurial --include tests
4939
4940 Setting flag defaults
4941 In order to set a default value for a flag in an hgrc file, it is rec‐
4942 ommended to use aliases:
4943
4944 [alias]
4945 commit = commit --interactive
4946
4947 For more information on hgrc files, see hg help config.
4948
4949 Overriding flags on the command line
4950 If the same non-list flag is specified multiple times on the command
4951 line, the latest specification is used:
4952
4953 hg commit -m "Ignored value" -m "Used value"
4954
4955 This includes the use of aliases - e.g., if one has:
4956
4957 [alias]
4958 committemp = commit -m "Ignored value"
4959
4960 then the following command will override that -m:
4961
4962 hg committemp -m "Used value"
4963
4964 Overriding flag defaults
4965 Every flag has a default value, and you may also set your own defaults
4966 in hgrc as described above. Except for list flags, defaults can be
4967 overridden on the command line simply by specifying the flag in that
4968 location.
4969
4970 Hidden flags
4971 Some flags are not shown in a command's help by default - specifically,
4972 those that are deemed to be experimental, deprecated or advanced. To
4973 show all flags, add the --verbose flag for the help command:
4974
4975 hg help --verbose commit
4976
4978 Ancestor
4979 Any changeset that can be reached by an unbroken chain of parent
4980 changesets from a given changeset. More precisely, the ancestors
4981 of a changeset can be defined by two properties: a parent of a
4982 changeset is an ancestor, and a parent of an ancestor is an an‐
4983 cestor. See also: 'Descendant'.
4984
4985 Bookmark
4986 Bookmarks are pointers to certain commits that move when commit‐
4987 ting. They are similar to tags in that it is possible to use
4988 bookmark names in all places where Mercurial expects a changeset
4989 ID, e.g., with hg update. Unlike tags, bookmarks move along when
4990 you make a commit.
4991
4992 Bookmarks can be renamed, copied and deleted. Bookmarks are lo‐
4993 cal, unless they are explicitly pushed or pulled between reposi‐
4994 tories. Pushing and pulling bookmarks allow you to collaborate
4995 with others on a branch without creating a named branch.
4996
4997 Branch (Noun) A child changeset that has been created from a parent
4998 that is not a head. These are known as topological branches, see
4999 'Branch, topological'. If a topological branch is named, it be‐
5000 comes a named branch. If a topological branch is not named, it
5001 becomes an anonymous branch. See 'Branch, anonymous' and
5002 'Branch, named'.
5003
5004 Branches may be created when changes are pulled from or pushed
5005 to a remote repository, since new heads may be created by these
5006 operations. Note that the term branch can also be used infor‐
5007 mally to describe a development process in which certain devel‐
5008 opment is done independently of other development. This is some‐
5009 times done explicitly with a named branch, but it can also be
5010 done locally, using bookmarks or clones and anonymous branches.
5011
5012 Example: "The experimental branch."
5013
5014 (Verb) The action of creating a child changeset which results in
5015 its parent having more than one child.
5016
5017 Example: "I'm going to branch at X."
5018
5019 Branch, anonymous
5020 Every time a new child changeset is created from a parent that
5021 is not a head and the name of the branch is not changed, a new
5022 anonymous branch is created.
5023
5024 Branch, closed
5025 A named branch whose branch heads have all been closed.
5026
5027 Branch, default
5028 The branch assigned to a changeset when no name has previously
5029 been assigned.
5030
5031 Branch head
5032 See 'Head, branch'.
5033
5034 Branch, inactive
5035 If a named branch has no topological heads, it is considered to
5036 be inactive. As an example, a feature branch becomes inactive
5037 when it is merged into the default branch. The hg branches com‐
5038 mand shows inactive branches by default, though they can be hid‐
5039 den with hg branches --active.
5040
5041 NOTE: this concept is deprecated because it is too implicit.
5042 Branches should now be explicitly closed using hg commit
5043 --close-branch when they are no longer needed.
5044
5045 Branch, named
5046 A collection of changesets which have the same branch name. By
5047 default, children of a changeset in a named branch belong to the
5048 same named branch. A child can be explicitly assigned to a dif‐
5049 ferent branch. See hg help branch, hg help branches and hg com‐
5050 mit --close-branch for more information on managing branches.
5051
5052 Named branches can be thought of as a kind of namespace, divid‐
5053 ing the collection of changesets that comprise the repository
5054 into a collection of disjoint subsets. A named branch is not
5055 necessarily a topological branch. If a new named branch is cre‐
5056 ated from the head of another named branch, or the default
5057 branch, but no further changesets are added to that previous
5058 branch, then that previous branch will be a branch in name only.
5059
5060 Branch tip
5061 See 'Tip, branch'.
5062
5063 Branch, topological
5064 Every time a new child changeset is created from a parent that
5065 is not a head, a new topological branch is created. If a topo‐
5066 logical branch is named, it becomes a named branch. If a topo‐
5067 logical branch is not named, it becomes an anonymous branch of
5068 the current, possibly default, branch.
5069
5070 Changelog
5071 A record of the changesets in the order in which they were added
5072 to the repository. This includes details such as changeset id,
5073 author, commit message, date, and list of changed files.
5074
5075 Changeset
5076 A snapshot of the state of the repository used to record a
5077 change.
5078
5079 Changeset, child
5080 The converse of parent changeset: if P is a parent of C, then C
5081 is a child of P. There is no limit to the number of children
5082 that a changeset may have.
5083
5084 Changeset id
5085 A SHA-1 hash that uniquely identifies a changeset. It may be
5086 represented as either a "long" 40 hexadecimal digit string, or a
5087 "short" 12 hexadecimal digit string.
5088
5089 Changeset, merge
5090 A changeset with two parents. This occurs when a merge is com‐
5091 mitted.
5092
5093 Changeset, parent
5094 A revision upon which a child changeset is based. Specifically,
5095 a parent changeset of a changeset C is a changeset whose node
5096 immediately precedes C in the DAG. Changesets have at most two
5097 parents.
5098
5099 Checkout
5100 (Noun) The working directory being updated to a specific revi‐
5101 sion. This use should probably be avoided where possible, as
5102 changeset is much more appropriate than checkout in this con‐
5103 text.
5104
5105 Example: "I'm using checkout X."
5106
5107 (Verb) Updating the working directory to a specific changeset.
5108 See hg help update.
5109
5110 Example: "I'm going to check out changeset X."
5111
5112 Child changeset
5113 See 'Changeset, child'.
5114
5115 Close changeset
5116 See 'Head, closed branch'.
5117
5118 Closed branch
5119 See 'Branch, closed'.
5120
5121 Clone (Noun) An entire or partial copy of a repository. The partial
5122 clone must be in the form of a revision and its ancestors.
5123
5124 Example: "Is your clone up to date?"
5125
5126 (Verb) The process of creating a clone, using hg clone.
5127
5128 Example: "I'm going to clone the repository."
5129
5130 Closed branch head
5131 See 'Head, closed branch'.
5132
5133 Commit (Noun) A synonym for changeset.
5134
5135 Example: "Is the bug fixed in your recent commit?"
5136
5137 (Verb) The act of recording changes to a repository. When files
5138 are committed in a working directory, Mercurial finds the dif‐
5139 ferences between the committed files and their parent changeset,
5140 creating a new changeset in the repository.
5141
5142 Example: "You should commit those changes now."
5143
5144 Cset A common abbreviation of the term changeset.
5145
5146 DAG The repository of changesets of a distributed version control
5147 system (DVCS) can be described as a directed acyclic graph
5148 (DAG), consisting of nodes and edges, where nodes correspond to
5149 changesets and edges imply a parent -> child relation. This
5150 graph can be visualized by graphical tools such as hg log
5151 --graph. In Mercurial, the DAG is limited by the requirement for
5152 children to have at most two parents.
5153
5154 Deprecated
5155 Feature removed from documentation, but not scheduled for re‐
5156 moval.
5157
5158 Default branch
5159 See 'Branch, default'.
5160
5161 Descendant
5162 Any changeset that can be reached by a chain of child changesets
5163 from a given changeset. More precisely, the descendants of a
5164 changeset can be defined by two properties: the child of a
5165 changeset is a descendant, and the child of a descendant is a
5166 descendant. See also: 'Ancestor'.
5167
5168 Diff (Noun) The difference between the contents and attributes of
5169 files in two changesets or a changeset and the current working
5170 directory. The difference is usually represented in a standard
5171 form called a "diff" or "patch". The "git diff" format is used
5172 when the changes include copies, renames, or changes to file at‐
5173 tributes, none of which can be represented/handled by classic
5174 "diff" and "patch".
5175
5176 Example: "Did you see my correction in the diff?"
5177
5178 (Verb) Diffing two changesets is the action of creating a diff
5179 or patch.
5180
5181 Example: "If you diff with changeset X, you will see what I
5182 mean."
5183
5184 Directory, working
5185 The working directory represents the state of the files tracked
5186 by Mercurial, that will be recorded in the next commit. The
5187 working directory initially corresponds to the snapshot at an
5188 existing changeset, known as the parent of the working direc‐
5189 tory. See 'Parent, working directory'. The state may be modified
5190 by changes to the files introduced manually or by a merge. The
5191 repository metadata exists in the .hg directory inside the work‐
5192 ing directory.
5193
5194 Draft Changesets in the draft phase have not been shared with publish‐
5195 ing repositories and may thus be safely changed by history-modi‐
5196 fying extensions. See hg help phases.
5197
5198 Experimental
5199 Feature that may change or be removed at a later date.
5200
5201 Graph See DAG and hg log --graph.
5202
5203 Head The term 'head' may be used to refer to both a branch head or a
5204 repository head, depending on the context. See 'Head, branch'
5205 and 'Head, repository' for specific definitions.
5206
5207 Heads are where development generally takes place and are the
5208 usual targets for update and merge operations.
5209
5210 Head, branch
5211 A changeset with no descendants on the same named branch.
5212
5213 Head, closed branch
5214 A changeset that marks a head as no longer interesting. The
5215 closed head is no longer listed by hg heads. A branch is consid‐
5216 ered closed when all its heads are closed and consequently is
5217 not listed by hg branches.
5218
5219 Closed heads can be re-opened by committing new changeset as the
5220 child of the changeset that marks a head as closed.
5221
5222 Head, repository
5223 A topological head which has not been closed.
5224
5225 Head, topological
5226 A changeset with no children in the repository.
5227
5228 History, immutable
5229 Once committed, changesets cannot be altered. Extensions which
5230 appear to change history actually create new changesets that re‐
5231 place existing ones, and then destroy the old changesets. Doing
5232 so in public repositories can result in old changesets being
5233 reintroduced to the repository.
5234
5235 History, rewriting
5236 The changesets in a repository are immutable. However, exten‐
5237 sions to Mercurial can be used to alter the repository, usually
5238 in such a way as to preserve changeset contents.
5239
5240 Immutable history
5241 See 'History, immutable'.
5242
5243 Merge changeset
5244 See 'Changeset, merge'.
5245
5246 Manifest
5247 Each changeset has a manifest, which is the list of files that
5248 are tracked by the changeset.
5249
5250 Merge Used to bring together divergent branches of work. When you up‐
5251 date to a changeset and then merge another changeset, you bring
5252 the history of the latter changeset into your working directory.
5253 Once conflicts are resolved (and marked), this merge may be com‐
5254 mitted as a merge changeset, bringing two branches together in
5255 the DAG.
5256
5257 Named branch
5258 See 'Branch, named'.
5259
5260 Null changeset
5261 The empty changeset. It is the parent state of newly-initialized
5262 repositories and repositories with no checked out revision. It
5263 is thus the parent of root changesets and the effective ancestor
5264 when merging unrelated changesets. Can be specified by the alias
5265 'null' or by the changeset ID '000000000000'.
5266
5267 Parent See 'Changeset, parent'.
5268
5269 Parent changeset
5270 See 'Changeset, parent'.
5271
5272 Parent, working directory
5273 The working directory parent reflects a virtual revision which
5274 is the child of the changeset (or two changesets with an uncom‐
5275 mitted merge) shown by hg parents. This is changed with hg up‐
5276 date. Other commands to see the working directory parent are hg
5277 summary and hg id. Can be specified by the alias ".".
5278
5279 Patch (Noun) The product of a diff operation.
5280
5281 Example: "I've sent you my patch."
5282
5283 (Verb) The process of using a patch file to transform one
5284 changeset into another.
5285
5286 Example: "You will need to patch that revision."
5287
5288 Phase A per-changeset state tracking how the changeset has been or
5289 should be shared. See hg help phases.
5290
5291 Public Changesets in the public phase have been shared with publishing
5292 repositories and are therefore considered immutable. See hg help
5293 phases.
5294
5295 Pull An operation in which changesets in a remote repository which
5296 are not in the local repository are brought into the local
5297 repository. Note that this operation without special arguments
5298 only updates the repository, it does not update the files in the
5299 working directory. See hg help pull.
5300
5301 Push An operation in which changesets in a local repository which are
5302 not in a remote repository are sent to the remote repository.
5303 Note that this operation only adds changesets which have been
5304 committed locally to the remote repository. Uncommitted changes
5305 are not sent. See hg help push.
5306
5307 Repository
5308 The metadata describing all recorded states of a collection of
5309 files. Each recorded state is represented by a changeset. A
5310 repository is usually (but not always) found in the .hg subdi‐
5311 rectory of a working directory. Any recorded state can be recre‐
5312 ated by "updating" a working directory to a specific changeset.
5313
5314 Repository head
5315 See 'Head, repository'.
5316
5317 Revision
5318 A state of the repository at some point in time. Earlier revi‐
5319 sions can be updated to by using hg update. See also 'Revision
5320 number'; See also 'Changeset'.
5321
5322 Revision number
5323 This integer uniquely identifies a changeset in a specific
5324 repository. It represents the order in which changesets were
5325 added to a repository, starting with revision number 0. Note
5326 that the revision number may be different in each clone of a
5327 repository. To identify changesets uniquely between different
5328 clones, see 'Changeset id'.
5329
5330 Revlog History storage mechanism used by Mercurial. It is a form of
5331 delta encoding, with occasional full revision of data followed
5332 by delta of each successive revision. It includes data and an
5333 index pointing to the data.
5334
5335 Rewriting history
5336 See 'History, rewriting'.
5337
5338 Root A changeset that has only the null changeset as its parent. Most
5339 repositories have only a single root changeset.
5340
5341 Secret Changesets in the secret phase may not be shared via push, pull,
5342 or clone. See hg help phases.
5343
5344 Tag An alternative name given to a changeset. Tags can be used in
5345 all places where Mercurial expects a changeset ID, e.g., with hg
5346 update. The creation of a tag is stored in the history and will
5347 thus automatically be shared with other using push and pull.
5348
5349 Tip The changeset with the highest revision number. It is the
5350 changeset most recently added in a repository.
5351
5352 Tip, branch
5353 The head of a given branch with the highest revision number.
5354 When a branch name is used as a revision identifier, it refers
5355 to the branch tip. See also 'Branch, head'. Note that because
5356 revision numbers may be different in different repository
5357 clones, the branch tip may be different in different cloned
5358 repositories.
5359
5360 Update (Noun) Another synonym of changeset.
5361
5362 Example: "I've pushed an update."
5363
5364 (Verb) This term is usually used to describe updating the state
5365 of the working directory to that of a specific changeset. See hg
5366 help update.
5367
5368 Example: "You should update."
5369
5370 Working directory
5371 See 'Directory, working'.
5372
5373 Working directory parent
5374 See 'Parent, working directory'.
5375
5377 Synopsis
5378 The Mercurial system uses a file called .hgignore in the root directory
5379 of a repository to control its behavior when it searches for files that
5380 it is not currently tracking.
5381
5382 Description
5383 The working directory of a Mercurial repository will often contain
5384 files that should not be tracked by Mercurial. These include backup
5385 files created by editors and build products created by compilers.
5386 These files can be ignored by listing them in a .hgignore file in the
5387 root of the working directory. The .hgignore file must be created manu‐
5388 ally. It is typically put under version control, so that the settings
5389 will propagate to other repositories with push and pull.
5390
5391 An untracked file is ignored if its path relative to the repository
5392 root directory, or any prefix path of that path, is matched against any
5393 pattern in .hgignore.
5394
5395 For example, say we have an untracked file, file.c, at a/b/file.c in‐
5396 side our repository. Mercurial will ignore file.c if any pattern in
5397 .hgignore matches a/b/file.c, a/b or a.
5398
5399 In addition, a Mercurial configuration file can reference a set of
5400 per-user or global ignore files. See the ignore configuration key on
5401 the [ui] section of hg help config for details of how to configure
5402 these files.
5403
5404 To control Mercurial's handling of files that it manages, many commands
5405 support the -I and -X options; see hg help <command> and hg help pat‐
5406 terns for details.
5407
5408 Files that are already tracked are not affected by .hgignore, even if
5409 they appear in .hgignore. An untracked file X can be explicitly added
5410 with hg add X, even if X would be excluded by a pattern in .hgignore.
5411
5412 Syntax
5413 An ignore file is a plain text file consisting of a list of patterns,
5414 with one pattern per line. Empty lines are skipped. The # character is
5415 treated as a comment character, and the \ character is treated as an
5416 escape character.
5417
5418 Mercurial supports several pattern syntaxes. The default syntax used is
5419 Python/Perl-style regular expressions.
5420
5421 To change the syntax used, use a line of the following form:
5422
5423 syntax: NAME
5424
5425 where NAME is one of the following:
5426
5427 regexp
5428
5429 Regular expression, Python/Perl syntax.
5430
5431 glob
5432
5433 Shell-style glob.
5434
5435 rootglob
5436
5437 A variant of glob that is rooted (see below).
5438
5439 The chosen syntax stays in effect when parsing all patterns that fol‐
5440 low, until another syntax is selected.
5441
5442 Neither glob nor regexp patterns are rooted. A glob-syntax pattern of
5443 the form *.c will match a file ending in .c in any directory, and a
5444 regexp pattern of the form \.c$ will do the same. To root a regexp pat‐
5445 tern, start it with ^. To get the same effect with glob-syntax, you
5446 have to use rootglob.
5447
5448 Subdirectories can have their own .hgignore settings by adding subin‐
5449 clude:path/to/subdir/.hgignore to the root .hgignore. See hg help pat‐
5450 terns for details on subinclude: and include:.
5451
5452 Note Patterns specified in other than .hgignore are always rooted.
5453 Please see hg help patterns for details.
5454
5455 Example
5456 Here is an example ignore file.
5457
5458 # use glob syntax.
5459 syntax: glob
5460
5461 *.elc
5462 *.pyc
5463 *~
5464
5465 # switch to regexp syntax.
5466 syntax: regexp
5467 ^\.pc/
5468
5469 Debugging
5470 Use the debugignore command to see if and why a file is ignored, or to
5471 see the combined ignore pattern. See hg help debugignore for details.
5472
5474 Mercurial's internal web server, hgweb, can serve either a single
5475 repository, or a tree of repositories. In the second case, repository
5476 paths and global options can be defined using a dedicated configuration
5477 file common to hg serve, hgweb.wsgi, hgweb.cgi and hgweb.fcgi.
5478
5479 This file uses the same syntax as other Mercurial configuration files
5480 but recognizes only the following sections:
5481
5482 • web
5483
5484 • paths
5485
5486 • collections
5487
5488 The web options are thoroughly described in hg help config.
5489
5490 The paths section maps URL paths to paths of repositories in the
5491 filesystem. hgweb will not expose the filesystem directly - only Mercu‐
5492 rial repositories can be published and only according to the configura‐
5493 tion.
5494
5495 The left hand side is the path in the URL. Note that hgweb reserves
5496 subpaths like rev or file, try using different names for nested reposi‐
5497 tories to avoid confusing effects.
5498
5499 The right hand side is the path in the filesystem. If the specified
5500 path ends with * or ** the filesystem will be searched recursively for
5501 repositories below that point. With * it will not recurse into the
5502 repositories it finds (except for .hg/patches). With ** it will also
5503 search inside repository working directories and possibly find sub‐
5504 repositories.
5505
5506 In this example:
5507
5508 [paths]
5509 /projects/a = /srv/tmprepos/a
5510 /projects/b = c:/repos/b
5511 / = /srv/repos/*
5512 /user/bob = /home/bob/repos/**
5513
5514 • The first two entries make two repositories in different directories
5515 appear under the same directory in the web interface
5516
5517 • The third entry will publish every Mercurial repository found in
5518 /srv/repos/, for instance the repository /srv/repos/quux/ will appear
5519 as http://server/quux/
5520
5521 • The fourth entry will publish both http://server/user/bob/quux/ and
5522 http://server/user/bob/quux/testsubrepo/
5523
5524 The collections section is deprecated and has been superseded by paths.
5525
5526 URLs and Common Arguments
5527 URLs under each repository have the form /{command}[/{arguments}] where
5528 {command} represents the name of a command or handler and {arguments}
5529 represents any number of additional URL parameters to that command.
5530
5531 The web server has a default style associated with it. Styles map to a
5532 collection of named templates. Each template is used to render a spe‐
5533 cific piece of data, such as a changeset or diff.
5534
5535 The style for the current request can be overridden two ways. First, if
5536 {command} contains a hyphen (-), the text before the hyphen defines the
5537 style. For example, /atom-log will render the log command handler with
5538 the atom style. The second way to set the style is with the style query
5539 string argument. For example, /log?style=atom. The hyphenated URL pa‐
5540 rameter is preferred.
5541
5542 Not all templates are available for all styles. Attempting to use a
5543 style that doesn't have all templates defined may result in an error
5544 rendering the page.
5545
5546 Many commands take a {revision} URL parameter. This defines the change‐
5547 set to operate on. This is commonly specified as the short, 12 digit
5548 hexadecimal abbreviation for the full 40 character unique revision
5549 identifier. However, any value described by hg help revisions typically
5550 works.
5551
5552 Commands and URLs
5553 The following web commands and their URLs are available:
5554
5555 /annotate/{revision}/{path}
5556 Show changeset information for each line in a file.
5557
5558 The ignorews, ignorewsamount, ignorewseol, and ignoreblanklines query
5559 string arguments have the same meaning as their [annotate] config
5560 equivalents. It uses the hgrc boolean parsing logic to interpret the
5561 value. e.g. 0 and false are false and 1 and true are true. If not de‐
5562 fined, the server default settings are used.
5563
5564 The fileannotate template is rendered.
5565
5566 /archive/{revision}.{format}[/{path}]
5567 Obtain an archive of repository content.
5568
5569 The content and type of the archive is defined by a URL path parameter.
5570 format is the file extension of the archive type to be generated. e.g.
5571 zip or tar.bz2. Not all archive types may be allowed by your server
5572 configuration.
5573
5574 The optional path URL parameter controls content to include in the ar‐
5575 chive. If omitted, every file in the specified revision is present in
5576 the archive. If included, only the specified file or contents of the
5577 specified directory will be included in the archive.
5578
5579 No template is used for this handler. Raw, binary content is generated.
5580
5581 /bookmarks
5582 Show information about bookmarks.
5583
5584 No arguments are accepted.
5585
5586 The bookmarks template is rendered.
5587
5588 /branches
5589 Show information about branches.
5590
5591 All known branches are contained in the output, even closed branches.
5592
5593 No arguments are accepted.
5594
5595 The branches template is rendered.
5596
5597 /changelog[/{revision}]
5598 Show information about multiple changesets.
5599
5600 If the optional revision URL argument is absent, information about all
5601 changesets starting at tip will be rendered. If the revision argument
5602 is present, changesets will be shown starting from the specified revi‐
5603 sion.
5604
5605 If revision is absent, the rev query string argument may be defined.
5606 This will perform a search for changesets.
5607
5608 The argument for rev can be a single revision, a revision set, or a
5609 literal keyword to search for in changeset data (equivalent to hg log
5610 -k).
5611
5612 The revcount query string argument defines the maximum numbers of
5613 changesets to render.
5614
5615 For non-searches, the changelog template will be rendered.
5616
5617 /changeset[/{revision}]
5618 Show information about a single changeset.
5619
5620 A URL path argument is the changeset identifier to show. See hg help
5621 revisions for possible values. If not defined, the tip changeset will
5622 be shown.
5623
5624 The changeset template is rendered. Contents of the changesettag,
5625 changesetbookmark, filenodelink, filenolink, and the many templates re‐
5626 lated to diffs may all be used to produce the output.
5627
5628 /comparison/{revision}/{path}
5629 Show a comparison between the old and new versions of a file from
5630 changes made on a particular revision.
5631
5632 This is similar to the diff handler. However, this form features a
5633 split or side-by-side diff rather than a unified diff.
5634
5635 The context query string argument can be used to control the lines of
5636 context in the diff.
5637
5638 The filecomparison template is rendered.
5639
5640 /diff/{revision}/{path}
5641 Show how a file changed in a particular commit.
5642
5643 The filediff template is rendered.
5644
5645 This handler is registered under both the /diff and /filediff paths.
5646 /diff is used in modern code.
5647
5648 /file/{revision}[/{path}]
5649 Show information about a directory or file in the repository.
5650
5651 Info about the path given as a URL parameter will be rendered.
5652
5653 If path is a directory, information about the entries in that directory
5654 will be rendered. This form is equivalent to the manifest handler.
5655
5656 If path is a file, information about that file will be shown via the
5657 filerevision template.
5658
5659 If path is not defined, information about the root directory will be
5660 rendered.
5661
5662 /diff/{revision}/{path}
5663 Show how a file changed in a particular commit.
5664
5665 The filediff template is rendered.
5666
5667 This handler is registered under both the /diff and /filediff paths.
5668 /diff is used in modern code.
5669
5670 /filelog/{revision}/{path}
5671 Show information about the history of a file in the repository.
5672
5673 The revcount query string argument can be defined to control the maxi‐
5674 mum number of entries to show.
5675
5676 The filelog template will be rendered.
5677
5678 /graph[/{revision}]
5679 Show information about the graphical topology of the repository.
5680
5681 Information rendered by this handler can be used to create visual rep‐
5682 resentations of repository topology.
5683
5684 The revision URL parameter controls the starting changeset. If it's ab‐
5685 sent, the default is tip.
5686
5687 The revcount query string argument can define the number of changesets
5688 to show information for.
5689
5690 The graphtop query string argument can specify the starting changeset
5691 for producing jsdata variable that is used for rendering graph in Java‐
5692 Script. By default it has the same value as revision.
5693
5694 This handler will render the graph template.
5695
5696 /help[/{topic}]
5697 Render help documentation.
5698
5699 This web command is roughly equivalent to hg help. If a topic is de‐
5700 fined, that help topic will be rendered. If not, an index of available
5701 help topics will be rendered.
5702
5703 The help template will be rendered when requesting help for a topic.
5704 helptopics will be rendered for the index of help topics.
5705
5706 /log[/{revision}[/{path}]]
5707 Show repository or file history.
5708
5709 For URLs of the form /log/{revision}, a list of changesets starting at
5710 the specified changeset identifier is shown. If {revision} is not de‐
5711 fined, the default is tip. This form is equivalent to the changelog
5712 handler.
5713
5714 For URLs of the form /log/{revision}/{file}, the history for a specific
5715 file will be shown. This form is equivalent to the filelog handler.
5716
5717 /manifest[/{revision}[/{path}]]
5718 Show information about a directory.
5719
5720 If the URL path arguments are omitted, information about the root di‐
5721 rectory for the tip changeset will be shown.
5722
5723 Because this handler can only show information for directories, it is
5724 recommended to use the file handler instead, as it can handle both di‐
5725 rectories and files.
5726
5727 The manifest template will be rendered for this handler.
5728
5729 /changeset[/{revision}]
5730 Show information about a single changeset.
5731
5732 A URL path argument is the changeset identifier to show. See hg help
5733 revisions for possible values. If not defined, the tip changeset will
5734 be shown.
5735
5736 The changeset template is rendered. Contents of the changesettag,
5737 changesetbookmark, filenodelink, filenolink, and the many templates re‐
5738 lated to diffs may all be used to produce the output.
5739
5740 /shortlog
5741 Show basic information about a set of changesets.
5742
5743 This accepts the same parameters as the changelog handler. The only
5744 difference is the shortlog template will be rendered instead of the
5745 changelog template.
5746
5747 /summary
5748 Show a summary of repository state.
5749
5750 Information about the latest changesets, bookmarks, tags, and branches
5751 is captured by this handler.
5752
5753 The summary template is rendered.
5754
5755 /tags
5756 Show information about tags.
5757
5758 No arguments are accepted.
5759
5760 The tags template is rendered.
5761
5763 To access a subtopic, use "hg help internals.{subtopic-name}"
5764
5765 bid-merge
5766 Bid Merge Algorithm
5767
5768 bundle2
5769 Bundle2
5770
5771 bundles
5772 Bundles
5773
5774 cbor CBOR
5775
5776 censor Censor
5777
5778 changegroups
5779 Changegroups
5780
5781 config Config Registrar
5782
5783 extensions
5784 Extension API
5785
5786 mergestate
5787 Mergestate
5788
5789 requirements
5790 Repository Requirements
5791
5792 revlogs
5793 Revision Logs
5794
5795 wireprotocol
5796 Wire Protocol
5797
5798 wireprotocolrpc
5799 Wire Protocol RPC
5800
5801 wireprotocolv2
5802 Wire Protocol Version 2
5803
5805 To merge files Mercurial uses merge tools.
5806
5807 A merge tool combines two different versions of a file into a merged
5808 file. Merge tools are given the two files and the greatest common an‐
5809 cestor of the two file versions, so they can determine the changes made
5810 on both branches.
5811
5812 Merge tools are used both for hg resolve, hg merge, hg update, hg back‐
5813 out and in several extensions.
5814
5815 Usually, the merge tool tries to automatically reconcile the files by
5816 combining all non-overlapping changes that occurred separately in the
5817 two different evolutions of the same initial base file. Furthermore,
5818 some interactive merge programs make it easier to manually resolve con‐
5819 flicting merges, either in a graphical way, or by inserting some con‐
5820 flict markers. Mercurial does not include any interactive merge pro‐
5821 grams but relies on external tools for that.
5822
5823 Available merge tools
5824 External merge tools and their properties are configured in the
5825 merge-tools configuration section - see hgrc(5) - but they can often
5826 just be named by their executable.
5827
5828 A merge tool is generally usable if its executable can be found on the
5829 system and if it can handle the merge. The executable is found if it is
5830 an absolute or relative executable path or the name of an application
5831 in the executable search path. The tool is assumed to be able to handle
5832 the merge if it can handle symlinks if the file is a symlink, if it can
5833 handle binary files if the file is binary, and if a GUI is available if
5834 the tool requires a GUI.
5835
5836 There are some internal merge tools which can be used. The internal
5837 merge tools are:
5838
5839 :dump
5840
5841 Creates three versions of the files to merge, containing the
5842 contents of local, other and base. These files can then be used
5843 to perform a merge manually. If the file to be merged is named
5844 a.txt, these files will accordingly be named a.txt.local,
5845 a.txt.other and a.txt.base and they will be placed in the same
5846 directory as a.txt.
5847
5848 This implies premerge. Therefore, files aren't dumped, if pre‐
5849 merge runs successfully. Use :forcedump to forcibly write files
5850 out.
5851
5852 (actual capabilities: binary, symlink)
5853
5854 :fail
5855
5856 Rather than attempting to merge files that were modified on both
5857 branches, it marks them as unresolved. The resolve command must
5858 be used to resolve these conflicts.
5859
5860 (actual capabilities: binary, symlink)
5861
5862 :forcedump
5863
5864 Creates three versions of the files as same as :dump, but omits
5865 premerge.
5866
5867 (actual capabilities: binary, symlink)
5868
5869 :local
5870
5871 Uses the local p1() version of files as the merged version.
5872
5873 (actual capabilities: binary, symlink)
5874
5875 :merge
5876
5877 Uses the internal non-interactive simple merge algorithm for
5878 merging files. It will fail if there are any conflicts and leave
5879 markers in the partially merged file. Markers will have two sec‐
5880 tions, one for each side of merge.
5881
5882 :merge-local
5883
5884 Like :merge, but resolve all conflicts non-interactively in fa‐
5885 vor of the local p1() changes.
5886
5887 :merge-other
5888
5889 Like :merge, but resolve all conflicts non-interactively in fa‐
5890 vor of the other p2() changes.
5891
5892 :merge3
5893
5894 Uses the internal non-interactive simple merge algorithm for
5895 merging files. It will fail if there are any conflicts and leave
5896 markers in the partially merged file. Marker will have three
5897 sections, one from each side of the merge and one for the base
5898 content.
5899
5900 :mergediff
5901
5902 Uses the internal non-interactive simple merge algorithm for
5903 merging files. It will fail if there are any conflicts and leave
5904 markers in the partially merged file. The marker will have two
5905 sections, one with the content from one side of the merge, and
5906 one with a diff from the base content to the content on the
5907 other side. (experimental)
5908
5909 :other
5910
5911 Uses the other p2() version of files as the merged version.
5912
5913 (actual capabilities: binary, symlink)
5914
5915 :prompt
5916
5917 Asks the user which of the local p1() or the other p2() version
5918 to keep as the merged version.
5919
5920 (actual capabilities: binary, symlink)
5921
5922 :tagmerge
5923
5924 Uses the internal tag merge algorithm (experimental).
5925
5926 :union
5927
5928 Uses the internal non-interactive simple merge algorithm for
5929 merging files. It will use both left and right sides for con‐
5930 flict regions. No markers are inserted.
5931
5932 Internal tools are always available and do not require a GUI but will
5933 by default not handle symlinks or binary files. See next section for
5934 detail about "actual capabilities" described above.
5935
5936 Choosing a merge tool
5937 Mercurial uses these rules when deciding which merge tool to use:
5938
5939 1. If a tool has been specified with the --tool option to merge or re‐
5940 solve, it is used. If it is the name of a tool in the merge-tools
5941 configuration, its configuration is used. Otherwise the specified
5942 tool must be executable by the shell.
5943
5944 2. If the HGMERGE environment variable is present, its value is used
5945 and must be executable by the shell.
5946
5947 3. If the filename of the file to be merged matches any of the patterns
5948 in the merge-patterns configuration section, the first usable merge
5949 tool corresponding to a matching pattern is used.
5950
5951 4. If ui.merge is set it will be considered next. If the value is not
5952 the name of a configured tool, the specified value is used and must
5953 be executable by the shell. Otherwise the named tool is used if it
5954 is usable.
5955
5956 5. If any usable merge tools are present in the merge-tools configura‐
5957 tion section, the one with the highest priority is used.
5958
5959 6. If a program named hgmerge can be found on the system, it is used -
5960 but it will by default not be used for symlinks and binary files.
5961
5962 7. If the file to be merged is not binary and is not a symlink, then
5963 internal :merge is used.
5964
5965 8. Otherwise, :prompt is used.
5966
5967 For historical reason, Mercurial treats merge tools as below while ex‐
5968 amining rules above.
5969
5970 ┌───────────┬────────────────┬────────┬─────────┐
5971 │step │ specified via │ binary │ symlink │
5972 ├───────────┼────────────────┼────────┼─────────┤
5973 │ │ --tool │ o/o │ o/o │
5974 │ 1. │ │ │ │
5975 ├───────────┼────────────────┼────────┼─────────┤
5976 │ │ HGMERGE │ o/o │ o/o │
5977 │ 2. │ │ │ │
5978 ├───────────┼────────────────┼────────┼─────────┤
5979 │ │ merge-patterns │ o/o(*) │ x/?(*) │
5980 │ 3. │ │ │ │
5981 ├───────────┼────────────────┼────────┼─────────┤
5982 │ │ ui.merge │ x/?(*) │ x/?(*) │
5983 │ 4. │ │ │ │
5984 └───────────┴────────────────┴────────┴─────────┘
5985
5986 Each capability column indicates Mercurial behavior for internal/exter‐
5987 nal merge tools at examining each rule.
5988
5989 • "o": "assume that a tool has capability"
5990
5991 • "x": "assume that a tool does not have capability"
5992
5993 • "?": "check actual capability of a tool"
5994
5995 If merge.strict-capability-check configuration is true, Mercurial
5996 checks capabilities of merge tools strictly in (*) cases above (= each
5997 capability column becomes "?/?"). It is false by default for backward
5998 compatibility.
5999
6000 Note After selecting a merge program, Mercurial will by default at‐
6001 tempt to merge the files using a simple merge algorithm first.
6002 Only if it doesn't succeed because of conflicting changes will
6003 Mercurial actually execute the merge program. Whether to use the
6004 simple merge algorithm first can be controlled by the premerge
6005 setting of the merge tool. Premerge is enabled by default unless
6006 the file is binary or a symlink.
6007
6008 See the merge-tools and ui sections of hgrc(5) for details on the con‐
6009 figuration of merge tools.
6010
6012 Some Mercurial commands can produce a lot of output, and Mercurial will
6013 attempt to use a pager to make those commands more pleasant.
6014
6015 To set the pager that should be used, set the application variable:
6016
6017 [pager]
6018 pager = less -FRX
6019
6020 If no pager is set in the user or repository configuration, Mercurial
6021 uses the environment variable $PAGER. If $PAGER is not set, pager.pager
6022 from the default or system configuration is used. If none of these are
6023 set, a default pager will be used, typically less on Unix and more on
6024 Windows.
6025
6026 On Windows, more is not color aware, so using it effectively disables
6027 color. MSYS and Cygwin shells provide less as a pager, which can be
6028 configured to support ANSI color codes. See hg help con‐
6029 fig.color.pagermode to configure the color mode when invoking a pager.
6030
6031 You can disable the pager for certain commands by adding them to the
6032 pager.ignore list:
6033
6034 [pager]
6035 ignore = version, help, update
6036
6037 To ignore global commands like hg version or hg help, you have to spec‐
6038 ify them in your user configuration file.
6039
6040 To control whether the pager is used at all for an individual command,
6041 you can use --pager=<value>:
6042
6043 • use as needed: auto.
6044
6045 • require the pager: yes or on.
6046
6047 • suppress the pager: no or off (any unrecognized value will also
6048 work).
6049
6050 To globally turn off all attempts to use a pager, set:
6051
6052 [ui]
6053 paginate = never
6054
6055 which will prevent the pager from running.
6056
6058 Mercurial accepts several notations for identifying one or more files
6059 at a time.
6060
6061 By default, Mercurial treats filenames as shell-style extended glob
6062 patterns.
6063
6064 Alternate pattern notations must be specified explicitly.
6065
6066 Note Patterns specified in .hgignore are not rooted. Please see hg
6067 help hgignore for details.
6068
6069 To use a plain path name without any pattern matching, start it with
6070 path:. These path names must completely match starting at the current
6071 repository root, and when the path points to a directory, it is matched
6072 recursively. To match all files in a directory non-recursively (not in‐
6073 cluding any files in subdirectories), rootfilesin: can be used, speci‐
6074 fying an absolute path (relative to the repository root).
6075
6076 To use an extended glob, start a name with glob:. Globs are rooted at
6077 the current directory; a glob such as *.c will only match files in the
6078 current directory ending with .c. rootglob: can be used instead of
6079 glob: for a glob that is rooted at the root of the repository.
6080
6081 The supported glob syntax extensions are ** to match any string across
6082 path separators and {a,b} to mean "a or b".
6083
6084 To use a Perl/Python regular expression, start a name with re:. Regexp
6085 pattern matching is anchored at the root of the repository.
6086
6087 To read name patterns from a file, use listfile: or listfile0:. The
6088 latter expects null delimited patterns while the former expects line
6089 feeds. Each string read from the file is itself treated as a file pat‐
6090 tern.
6091
6092 To read a set of patterns from a file, use include: or subinclude:.
6093 include: will use all the patterns from the given file and treat them
6094 as if they had been passed in manually. subinclude: will only apply
6095 the patterns against files that are under the subinclude file's direc‐
6096 tory. See hg help hgignore for details on the format of these files.
6097
6098 All patterns, except for glob: specified in command line (not for -I or
6099 -X options), can match also against directories: files under matched
6100 directories are treated as matched. For -I and -X options, glob: will
6101 match directories recursively.
6102
6103 Plain examples:
6104
6105 path:foo/bar a name bar in a directory named foo in the root
6106 of the repository
6107 path:path:name a file or directory named "path:name"
6108 rootfilesin:foo/bar the files in a directory called foo/bar, but not any files
6109 in its subdirectories and not a file bar in directory foo
6110
6111 Glob examples:
6112
6113 glob:*.c any name ending in ".c" in the current directory
6114 *.c any name ending in ".c" in the current directory
6115 **.c any name ending in ".c" in any subdirectory of the
6116 current directory including itself.
6117 foo/* any file in directory foo
6118 foo/** any file in directory foo plus all its subdirectories,
6119 recursively
6120 foo/*.c any name ending in ".c" in the directory foo
6121 foo/**.c any name ending in ".c" in any subdirectory of foo
6122 including itself.
6123 rootglob:*.c any name ending in ".c" in the root of the repository
6124
6125 Regexp examples:
6126
6127 re:.*\.c$ any name ending in ".c", anywhere in the repository
6128
6129 File examples:
6130
6131 listfile:list.txt read list from list.txt with one file pattern per line
6132 listfile0:list.txt read list from list.txt with null byte delimiters
6133
6134 See also hg help filesets.
6135
6136 Include examples:
6137
6138 include:path/to/mypatternfile reads patterns to be applied to all paths
6139 subinclude:path/to/subignorefile reads patterns specifically for paths in the
6140 subdirectory
6141
6143 What are phases?
6144 Phases are a system for tracking which changesets have been or should
6145 be shared. This helps prevent common mistakes when modifying history
6146 (for instance, with the mq or rebase extensions).
6147
6148 Each changeset in a repository is in one of the following phases:
6149
6150 • public : changeset is visible on a public server
6151
6152 • draft : changeset is not yet published
6153
6154 • secret : changeset should not be pushed, pulled, or cloned
6155
6156 These phases are ordered (public < draft < secret) and no changeset can
6157 be in a lower phase than its ancestors. For instance, if a changeset is
6158 public, all its ancestors are also public. Lastly, changeset phases
6159 should only be changed towards the public phase.
6160
6161 How are phases managed?
6162 For the most part, phases should work transparently. By default, a
6163 changeset is created in the draft phase and is moved into the public
6164 phase when it is pushed to another repository.
6165
6166 Once changesets become public, extensions like mq and rebase will
6167 refuse to operate on them to prevent creating duplicate changesets.
6168 Phases can also be manually manipulated with the hg phase command if
6169 needed. See hg help -v phase for examples.
6170
6171 To make your commits secret by default, put this in your configuration
6172 file:
6173
6174 [phases]
6175 new-commit = secret
6176
6177 Phases and servers
6178 Normally, all servers are publishing by default. This means:
6179
6180 - all draft changesets that are pulled or cloned appear in phase
6181 public on the client
6182
6183 - all draft changesets that are pushed appear as public on both
6184 client and server
6185
6186 - secret changesets are neither pushed, pulled, or cloned
6187
6188 Note Pulling a draft changeset from a publishing server does not mark
6189 it as public on the server side due to the read-only nature of
6190 pull.
6191
6192 Sometimes it may be desirable to push and pull changesets in the draft
6193 phase to share unfinished work. This can be done by setting a reposi‐
6194 tory to disable publishing in its configuration file:
6195
6196 [phases]
6197 publish = False
6198
6199 See hg help config for more information on configuration files.
6200
6201 Note Servers running older versions of Mercurial are treated as pub‐
6202 lishing.
6203
6204 Note Changesets in secret phase are not exchanged with the server.
6205 This applies to their content: file names, file contents, and
6206 changeset metadata. For technical reasons, the identifier (e.g.
6207 d825e4025e39) of the secret changeset may be communicated to the
6208 server.
6209
6210 Examples
6211 • list changesets in draft or secret phase:
6212
6213 hg log -r "not public()"
6214
6215 • change all secret changesets to draft:
6216
6217 hg phase --draft "secret()"
6218
6219 • forcibly move the current changeset and descendants from public to
6220 draft:
6221
6222 hg phase --force --draft .
6223
6224 • show a list of changeset revisions and each corresponding phase:
6225
6226 hg log --template "{rev} {phase}\n"
6227
6228 • resynchronize draft changesets relative to a remote repository:
6229
6230 hg phase -fd "outgoing(URL)"
6231
6232 See hg help phase for more information on manually manipulating phases.
6233
6235 Mercurial supports several ways to specify revisions.
6236
6237 Specifying single revisions
6238 A plain integer is treated as a revision number. Negative integers are
6239 treated as sequential offsets from the tip, with -1 denoting the tip,
6240 -2 denoting the revision prior to the tip, and so forth.
6241
6242 A 40-digit hexadecimal string is treated as a unique revision identi‐
6243 fier. A hexadecimal string less than 40 characters long is treated as
6244 a unique revision identifier and is referred to as a short-form identi‐
6245 fier. A short-form identifier is only valid if it is the prefix of ex‐
6246 actly one full-length identifier.
6247
6248 Any other string is treated as a bookmark, tag, or branch name. A book‐
6249 mark is a movable pointer to a revision. A tag is a permanent name as‐
6250 sociated with a revision. A branch name denotes the tipmost open branch
6251 head of that branch - or if they are all closed, the tipmost closed
6252 head of the branch. Bookmark, tag, and branch names must not contain
6253 the ":" character.
6254
6255 The reserved name "tip" always identifies the most recent revision.
6256
6257 The reserved name "null" indicates the null revision. This is the revi‐
6258 sion of an empty repository, and the parent of revision 0.
6259
6260 The reserved name "." indicates the working directory parent. If no
6261 working directory is checked out, it is equivalent to null. If an un‐
6262 committed merge is in progress, "." is the revision of the first par‐
6263 ent.
6264
6265 Finally, commands that expect a single revision (like hg update) also
6266 accept revsets (see below for details). When given a revset, they use
6267 the last revision of the revset. A few commands accept two single revi‐
6268 sions (like hg diff). When given a revset, they use the first and the
6269 last revisions of the revset.
6270
6271 Specifying multiple revisions
6272 Mercurial supports a functional language for selecting a set of revi‐
6273 sions. Expressions in this language are called revsets.
6274
6275 The language supports a number of predicates which are joined by infix
6276 operators. Parenthesis can be used for grouping.
6277
6278 Identifiers such as branch names may need quoting with single or double
6279 quotes if they contain characters like - or if they match one of the
6280 predefined predicates.
6281
6282 Special characters can be used in quoted identifiers by escaping them,
6283 e.g., \n is interpreted as a newline. To prevent them from being inter‐
6284 preted, strings can be prefixed with r, e.g. r'...'.
6285
6286 Operators
6287 There is a single prefix operator:
6288
6289 not x
6290
6291 Changesets not in x. Short form is ! x.
6292
6293 These are the supported infix operators:
6294
6295 x::y
6296
6297 A DAG range, meaning all changesets that are descendants of x
6298 and ancestors of y, including x and y themselves. If the first
6299 endpoint is left out, this is equivalent to ancestors(y), if the
6300 second is left out it is equivalent to descendants(x).
6301
6302 An alternative syntax is x..y.
6303
6304 x:y
6305
6306 All changesets with revision numbers between x and y, both in‐
6307 clusive. Either endpoint can be left out, they default to 0 and
6308 tip.
6309
6310 x and y
6311
6312 The intersection of changesets in x and y. Short form is x & y.
6313
6314 x or y
6315
6316 The union of changesets in x and y. There are two alternative
6317 short forms: x | y and x + y.
6318
6319 x - y
6320
6321 Changesets in x but not in y.
6322
6323 x % y
6324
6325 Changesets that are ancestors of x but not ancestors of y (i.e.
6326 ::x - ::y). This is shorthand notation for only(x, y) (see be‐
6327 low). The second argument is optional and, if left out, is
6328 equivalent to only(x).
6329
6330 x^n
6331
6332 The nth parent of x, n == 0, 1, or 2. For n == 0, x; for n ==
6333 1, the first parent of each changeset in x; for n == 2, the sec‐
6334 ond parent of changeset in x.
6335
6336 x~n
6337
6338 The nth first ancestor of x; x~0 is x; x~3 is x^^^. For n < 0,
6339 the nth unambiguous descendent of x.
6340
6341 x ## y
6342
6343 Concatenate strings and identifiers into one string.
6344
6345 All other prefix, infix and postfix operators have lower prior‐
6346 ity than ##. For example, a1 ## a2~2 is equivalent to (a1 ##
6347 a2)~2.
6348
6349 For example:
6350
6351 [revsetalias]
6352 issue(a1) = grep(r'\bissue[ :]?' ## a1 ## r'\b|\bbug\(' ## a1 ## r'\)')
6353
6354 issue(1234) is equivalent to grep(r'\bissue[
6355 :]?1234\b|\bbug\(1234\)') in this case. This matches against all
6356 of "issue 1234", "issue:1234", "issue1234" and "bug(1234)".
6357
6358 There is a single postfix operator:
6359
6360 x^
6361
6362 Equivalent to x^1, the first parent of each changeset in x.
6363
6364 Patterns
6365 Where noted, predicates that perform string matching can accept a pat‐
6366 tern string. The pattern may be either a literal, or a regular expres‐
6367 sion. If the pattern starts with re:, the remainder of the pattern is
6368 treated as a regular expression. Otherwise, it is treated as a literal.
6369 To match a pattern that actually starts with re:, use the prefix lit‐
6370 eral:.
6371
6372 Matching is case-sensitive, unless otherwise noted. To perform a case-
6373 insensitive match on a case-sensitive predicate, use a regular expres‐
6374 sion, prefixed with (?i).
6375
6376 For example, tag(r're:(?i)release') matches "release" or "RELEASE" or
6377 "Release", etc.
6378
6379 Predicates
6380 The following predicates are supported:
6381
6382 adds(pattern)
6383
6384 Changesets that add a file matching pattern.
6385
6386 The pattern without explicit kind like glob: is expected to be
6387 relative to the current directory and match against a file or a
6388 directory.
6389
6390 all()
6391
6392 All changesets, the same as 0:tip.
6393
6394 ancestor(*changeset)
6395
6396 A greatest common ancestor of the changesets.
6397
6398 Accepts 0 or more changesets. Will return empty list when
6399 passed no args. Greatest common ancestor of a single changeset
6400 is that changeset.
6401
6402 ancestors(set[, depth])
6403
6404 Changesets that are ancestors of changesets in set, including
6405 the given changesets themselves.
6406
6407 If depth is specified, the result only includes changesets up to
6408 the specified generation.
6409
6410 author(string)
6411
6412 Alias for user(string).
6413
6414 bisect(string)
6415
6416 Changesets marked in the specified bisect status:
6417
6418 • good, bad, skip: csets explicitly marked as good/bad/skip
6419
6420 • goods, bads : csets topologically good/bad
6421
6422 • range : csets taking part in the bisection
6423
6424 • pruned : csets that are goods, bads or skipped
6425
6426 • untested : csets whose fate is yet unknown
6427
6428 • ignored : csets ignored due to DAG topology
6429
6430 • current : the cset currently being bisected
6431
6432 bookmark([name])
6433
6434 The named bookmark or all bookmarks.
6435
6436 Pattern matching is supported for name. See hg help revi‐
6437 sions.patterns.
6438
6439 branch(string or set)
6440
6441 All changesets belonging to the given branch or the branches of
6442 the given changesets.
6443
6444 Pattern matching is supported for string. See hg help revi‐
6445 sions.patterns.
6446
6447 branchpoint()
6448
6449 Changesets with more than one child.
6450
6451 bundle()
6452
6453 Changesets in the bundle.
6454
6455 Bundle must be specified by the -R option.
6456
6457 children(set)
6458
6459 Child changesets of changesets in set.
6460
6461 closed()
6462
6463 Changeset is closed.
6464
6465 commonancestors(set)
6466
6467 Changesets that are ancestors of every changeset in set.
6468
6469 conflictlocal()
6470
6471 The local side of the merge, if currently in an unresolved
6472 merge.
6473
6474 "merge" here includes merge conflicts from e.g. 'hg rebase' or
6475 'hg graft'.
6476
6477 conflictother()
6478
6479 The other side of the merge, if currently in an unresolved
6480 merge.
6481
6482 "merge" here includes merge conflicts from e.g. 'hg rebase' or
6483 'hg graft'.
6484
6485 contains(pattern)
6486
6487 The revision's manifest contains a file matching pattern (but
6488 might not modify it). See hg help patterns for information about
6489 file patterns.
6490
6491 The pattern without explicit kind like glob: is expected to be
6492 relative to the current directory and match against a file ex‐
6493 actly for efficiency.
6494
6495 converted([id])
6496
6497 Changesets converted from the given identifier in the old repos‐
6498 itory if present, or all converted changesets if no identifier
6499 is specified.
6500
6501 date(interval)
6502
6503 Changesets within the interval, see hg help dates.
6504
6505 desc(string)
6506
6507 Search commit message for string. The match is case-insensitive.
6508
6509 Pattern matching is supported for string. See hg help revi‐
6510 sions.patterns.
6511
6512 descendants(set[, depth])
6513
6514 Changesets which are descendants of changesets in set, including
6515 the given changesets themselves.
6516
6517 If depth is specified, the result only includes changesets up to
6518 the specified generation.
6519
6520 destination([set])
6521
6522 Changesets that were created by a graft, transplant or rebase
6523 operation, with the given revisions specified as the source.
6524 Omitting the optional set is the same as passing all().
6525
6526 diffcontains(pattern)
6527
6528 Search revision differences for when the pattern was added or
6529 removed.
6530
6531 The pattern may be a substring literal or a regular expression.
6532 See hg help revisions.patterns.
6533
6534 draft()
6535
6536 Changeset in draft phase.
6537
6538 expectsize(set[, size])
6539
6540 Return the given revset if size matches the revset size. Abort
6541 if the revset doesn't expect given size. size can either be an
6542 integer range or an integer.
6543
6544 For example, expectsize(0:1, 3:5) will abort as revset size is 2
6545 and 2 is not between 3 and 5 inclusive.
6546
6547 extra(label, [value])
6548
6549 Changesets with the given label in the extra metadata, with the
6550 given optional value.
6551
6552 Pattern matching is supported for value. See hg help revi‐
6553 sions.patterns.
6554
6555 file(pattern)
6556
6557 Changesets affecting files matched by pattern.
6558
6559 For a faster but less accurate result, consider using filelog()
6560 instead.
6561
6562 This predicate uses glob: as the default kind of pattern.
6563
6564 filelog(pattern)
6565
6566 Changesets connected to the specified filelog.
6567
6568 For performance reasons, visits only revisions mentioned in the
6569 file-level filelog, rather than filtering through all changesets
6570 (much faster, but doesn't include deletes or duplicate changes).
6571 For a slower, more accurate result, use file().
6572
6573 The pattern without explicit kind like glob: is expected to be
6574 relative to the current directory and match against a file ex‐
6575 actly for efficiency.
6576
6577 first(set, [n])
6578
6579 An alias for limit().
6580
6581 follow([file[, startrev]])
6582
6583 An alias for ::. (ancestors of the working directory's first
6584 parent). If file pattern is specified, the histories of files
6585 matching given pattern in the revision given by startrev are
6586 followed, including copies.
6587
6588 followlines(file, fromline:toline[, startrev=., descend=False])
6589
6590 Changesets modifying file in line range ('fromline', 'toline').
6591
6592 Line range corresponds to 'file' content at 'startrev' and
6593 should hence be consistent with file size. If startrev is not
6594 specified, working directory's parent is used.
6595
6596 By default, ancestors of 'startrev' are returned. If 'descend'
6597 is True, descendants of 'startrev' are returned though renames
6598 are (currently) not followed in this direction.
6599
6600 grep(regex)
6601
6602 Like keyword(string) but accepts a regex. Use grep(r'...') to
6603 ensure special escape characters are handled correctly. Unlike
6604 keyword(string), the match is case-sensitive.
6605
6606 head()
6607
6608 Changeset is a named branch head.
6609
6610 heads(set)
6611
6612 Members of set with no children in set.
6613
6614 hidden()
6615
6616 Hidden changesets.
6617
6618 id(string)
6619
6620 Revision non-ambiguously specified by the given hex string pre‐
6621 fix.
6622
6623 keyword(string)
6624
6625 Search commit message, user name, and names of changed files for
6626 string. The match is case-insensitive.
6627
6628 For a regular expression or case sensitive search of these
6629 fields, use grep(regex).
6630
6631 last(set, [n])
6632
6633 Last n members of set, defaulting to 1.
6634
6635 limit(set[, n[, offset]])
6636
6637 First n members of set, defaulting to 1, starting from offset.
6638
6639 matching(revision [, field])
6640
6641 Changesets in which a given set of fields match the set of
6642 fields in the selected revision or set.
6643
6644 To match more than one field pass the list of fields to match
6645 separated by spaces (e.g. author description).
6646
6647 Valid fields are most regular revision fields and some special
6648 fields.
6649
6650 Regular revision fields are description, author, branch, date,
6651 files, phase, parents, substate, user and diff. Note that au‐
6652 thor and user are synonyms. diff refers to the contents of the
6653 revision. Two revisions matching their diff will also match
6654 their files.
6655
6656 Special fields are summary and metadata: summary matches the
6657 first line of the description. metadata is equivalent to match‐
6658 ing description user date (i.e. it matches the main metadata
6659 fields).
6660
6661 metadata is the default field which is used when no fields are
6662 specified. You can match more than one field at a time.
6663
6664 max(set)
6665
6666 Changeset with highest revision number in set.
6667
6668 merge()
6669
6670 Changeset is a merge changeset.
6671
6672 min(set)
6673
6674 Changeset with lowest revision number in set.
6675
6676 modifies(pattern)
6677
6678 Changesets modifying files matched by pattern.
6679
6680 The pattern without explicit kind like glob: is expected to be
6681 relative to the current directory and match against a file or a
6682 directory.
6683
6684 named(namespace)
6685
6686 The changesets in a given namespace.
6687
6688 Pattern matching is supported for namespace. See hg help revi‐
6689 sions.patterns.
6690
6691 none()
6692
6693 No changesets.
6694
6695 only(set, [set])
6696
6697 Changesets that are ancestors of the first set that are not an‐
6698 cestors of any other head in the repo. If a second set is speci‐
6699 fied, the result is ancestors of the first set that are not an‐
6700 cestors of the second set (i.e. ::<set1> - ::<set2>).
6701
6702 origin([set])
6703
6704 Changesets that were specified as a source for the grafts,
6705 transplants or rebases that created the given revisions. Omit‐
6706 ting the optional set is the same as passing all(). If a
6707 changeset created by these operations is itself specified as a
6708 source for one of these operations, only the source changeset
6709 for the first operation is selected.
6710
6711 outgoing([path])
6712
6713 Changesets not found in the specified destination repository, or
6714 the default push location.
6715
6716 p1([set])
6717
6718 First parent of changesets in set, or the working directory.
6719
6720 p2([set])
6721
6722 Second parent of changesets in set, or the working directory.
6723
6724 parents([set])
6725
6726 The set of all parents for all changesets in set, or the working
6727 directory.
6728
6729 present(set)
6730
6731 An empty set, if any revision in set isn't found; otherwise, all
6732 revisions in set.
6733
6734 If any of specified revisions is not present in the local repos‐
6735 itory, the query is normally aborted. But this predicate allows
6736 the query to continue even in such cases.
6737
6738 public()
6739
6740 Changeset in public phase.
6741
6742 remote([id [,path]])
6743
6744 Local revision that corresponds to the given identifier in a re‐
6745 mote repository, if present. Here, the '.' identifier is a syn‐
6746 onym for the current local branch.
6747
6748 removes(pattern)
6749
6750 Changesets which remove files matching pattern.
6751
6752 The pattern without explicit kind like glob: is expected to be
6753 relative to the current directory and match against a file or a
6754 directory.
6755
6756 rev(number)
6757
6758 Revision with the given numeric identifier.
6759
6760 reverse(set)
6761
6762 Reverse order of set.
6763
6764 revset(set)
6765
6766 Strictly interpret the content as a revset.
6767
6768 The content of this special predicate will be strictly inter‐
6769 preted as a revset. For example, revset(id(0)) will be inter‐
6770 preted as "id(0)" without possible ambiguity with a "id(0)"
6771 bookmark or tag.
6772
6773 roots(set)
6774
6775 Changesets in set with no parent changeset in set.
6776
6777 secret()
6778
6779 Changeset in secret phase.
6780
6781 sort(set[, [-]key... [, ...]])
6782
6783 Sort set by keys. The default sort order is ascending, specify a
6784 key as -key to sort in descending order.
6785
6786 The keys can be:
6787
6788 • rev for the revision number,
6789
6790 • branch for the branch name,
6791
6792 • desc for the commit message (description),
6793
6794 • user for user name (author can be used as an alias),
6795
6796 • date for the commit date
6797
6798 • topo for a reverse topographical sort
6799
6800 • node the nodeid of the revision
6801
6802 The topo sort order cannot be combined with other sort keys.
6803 This sort takes one optional argument, topo.firstbranch, which
6804 takes a revset that specifies what topographical branches to
6805 prioritize in the sort.
6806
6807 subrepo([pattern])
6808
6809 Changesets that add, modify or remove the given subrepo. If no
6810 subrepo pattern is named, any subrepo changes are returned.
6811
6812 tag([name])
6813
6814 The specified tag by name, or all tagged revisions if no name is
6815 given.
6816
6817 Pattern matching is supported for name. See hg help revi‐
6818 sions.patterns.
6819
6820 user(string)
6821
6822 User name contains string. The match is case-insensitive.
6823
6824 Pattern matching is supported for string. See hg help revi‐
6825 sions.patterns.
6826
6827 Aliases
6828 New predicates (known as "aliases") can be defined, using any combina‐
6829 tion of existing predicates or other aliases. An alias definition looks
6830 like:
6831
6832 <alias> = <definition>
6833
6834 in the revsetalias section of a Mercurial configuration file. Arguments
6835 of the form a1, a2, etc. are substituted from the alias into the defi‐
6836 nition.
6837
6838 For example,
6839
6840 [revsetalias]
6841 h = heads()
6842 d(s) = sort(s, date)
6843 rs(s, k) = reverse(sort(s, k))
6844
6845 defines three aliases, h, d, and rs. rs(0:tip, author) is exactly
6846 equivalent to reverse(sort(0:tip, author)).
6847
6848 Equivalents
6849 Command line equivalents for hg log:
6850
6851 -f -> ::.
6852 -d x -> date(x)
6853 -k x -> keyword(x)
6854 -m -> merge()
6855 -u x -> user(x)
6856 -b x -> branch(x)
6857 -P x -> !::x
6858 -l x -> limit(expr, x)
6859
6860 Examples
6861 Some sample queries:
6862
6863 • Changesets on the default branch:
6864
6865 hg log -r "branch(default)"
6866
6867 • Changesets on the default branch since tag 1.5 (excluding merges):
6868
6869 hg log -r "branch(default) and 1.5:: and not merge()"
6870
6871 • Open branch heads:
6872
6873 hg log -r "head() and not closed()"
6874
6875 • Changesets between tags 1.3 and 1.5 mentioning "bug" that affect
6876 hgext/*:
6877
6878 hg log -r "1.3::1.5 and keyword(bug) and file('hgext/*')"
6879
6880 • Changesets committed in May 2008, sorted by user:
6881
6882 hg log -r "sort(date('May 2008'), user)"
6883
6884 • Changesets mentioning "bug" or "issue" that are not in a tagged re‐
6885 lease:
6886
6887 hg log -r "(keyword(bug) or keyword(issue)) and not ancestors(tag())"
6888
6889 • Update to the commit that bookmark @ is pointing to, without activat‐
6890 ing the bookmark (this works because the last revision of the revset
6891 is used):
6892
6893 hg update :@
6894
6895 • Show diff between tags 1.3 and 1.5 (this works because the first and
6896 the last revisions of the revset are used):
6897
6898 hg diff -r 1.3::1.5
6899
6901 It is common for machines (as opposed to humans) to consume Mercurial.
6902 This help topic describes some of the considerations for interfacing
6903 machines with Mercurial.
6904
6905 Choosing an Interface
6906 Machines have a choice of several methods to interface with Mercurial.
6907 These include:
6908
6909 • Executing the hg process
6910
6911 • Querying a HTTP server
6912
6913 • Calling out to a command server
6914
6915 Executing hg processes is very similar to how humans interact with Mer‐
6916 curial in the shell. It should already be familiar to you.
6917
6918 hg serve can be used to start a server. By default, this will start a
6919 "hgweb" HTTP server. This HTTP server has support for machine-readable
6920 output, such as JSON. For more, see hg help hgweb.
6921
6922 hg serve can also start a "command server." Clients can connect to this
6923 server and issue Mercurial commands over a special protocol. For more
6924 details on the command server, including links to client libraries, see
6925 https://www.mercurial-scm.org/wiki/CommandServer.
6926
6927 hg serve based interfaces (the hgweb and command servers) have the ad‐
6928 vantage over simple hg process invocations in that they are likely more
6929 efficient. This is because there is significant overhead to spawn new
6930 Python processes.
6931
6932 Tip If you need to invoke several hg processes in short order and/or
6933 performance is important to you, use of a server-based interface
6934 is highly recommended.
6935
6936 Environment Variables
6937 As documented in hg help environment, various environment variables in‐
6938 fluence the operation of Mercurial. The following are particularly rel‐
6939 evant for machines consuming Mercurial:
6940
6941 HGPLAIN
6942 If not set, Mercurial's output could be influenced by configura‐
6943 tion settings that impact its encoding, verbose mode, localiza‐
6944 tion, etc.
6945
6946 It is highly recommended for machines to set this variable when
6947 invoking hg processes.
6948
6949 HGENCODING
6950 If not set, the locale used by Mercurial will be detected from
6951 the environment. If the determined locale does not support dis‐
6952 play of certain characters, Mercurial may render these character
6953 sequences incorrectly (often by using "?" as a placeholder for
6954 invalid characters in the current locale).
6955
6956 Explicitly setting this environment variable is a good practice
6957 to guarantee consistent results. "utf-8" is a good choice on
6958 UNIX-like environments.
6959
6960 HGRCPATH
6961 If not set, Mercurial will inherit config options from config
6962 files using the process described in hg help config. This in‐
6963 cludes inheriting user or system-wide config files.
6964
6965 When utmost control over the Mercurial configuration is desired,
6966 the value of HGRCPATH can be set to an explicit file with known
6967 good configs. In rare cases, the value can be set to an empty
6968 file or the null device (often /dev/null) to bypass loading of
6969 any user or system config files. Note that these approaches can
6970 have unintended consequences, as the user and system config
6971 files often define things like the username and extensions that
6972 may be required to interface with a repository.
6973
6974 HGRCSKIPREPO
6975 When set, the .hg/hgrc from repositories are not read.
6976
6977 Note that not reading the repository's configuration can have
6978 unintended consequences, as the repository config files can de‐
6979 fine things like extensions that are required for access to the
6980 repository.
6981
6982 Command-line Flags
6983 Mercurial's default command-line parser is designed for humans, and is
6984 not robust against malicious input. For instance, you can start a de‐
6985 bugger by passing --debugger as an option value:
6986
6987 $ REV=--debugger sh -c 'hg log -r "$REV"'
6988
6989 This happens because several command-line flags need to be scanned
6990 without using a concrete command table, which may be modified while
6991 loading repository settings and extensions.
6992
6993 Since Mercurial 4.4.2, the parsing of such flags may be restricted by
6994 setting HGPLAIN=+strictflags. When this feature is enabled, all early
6995 options (e.g. -R/--repository, --cwd, --config) must be specified first
6996 amongst the other global options, and cannot be injected to an arbi‐
6997 trary location:
6998
6999 $ HGPLAIN=+strictflags hg -R "$REPO" log -r "$REV"
7000
7001 In earlier Mercurial versions where +strictflags isn't available, you
7002 can mitigate the issue by concatenating an option value with its flag:
7003
7004 $ hg log -r"$REV" --keyword="$KEYWORD"
7005
7006 Consuming Command Output
7007 It is common for machines to need to parse the output of Mercurial com‐
7008 mands for relevant data. This section describes the various techniques
7009 for doing so.
7010
7011 Parsing Raw Command Output
7012 Likely the simplest and most effective solution for consuming command
7013 output is to simply invoke hg commands as you would as a user and parse
7014 their output.
7015
7016 The output of many commands can easily be parsed with tools like grep,
7017 sed, and awk.
7018
7019 A potential downside with parsing command output is that the output of
7020 commands can change when Mercurial is upgraded. While Mercurial does
7021 generally strive for strong backwards compatibility, command output
7022 does occasionally change. Having tests for your automated interactions
7023 with hg commands is generally recommended, but is even more important
7024 when raw command output parsing is involved.
7025
7026 Using Templates to Control Output
7027 Many hg commands support templatized output via the -T/--template argu‐
7028 ment. For more, see hg help templates.
7029
7030 Templates are useful for explicitly controlling output so that you get
7031 exactly the data you want formatted how you want it. For example, log
7032 -T {node}\n can be used to print a newline delimited list of changeset
7033 nodes instead of a human-tailored output containing authors, dates, de‐
7034 scriptions, etc.
7035
7036 Tip If parsing raw command output is too complicated, consider using
7037 templates to make your life easier.
7038
7039 The -T/--template argument allows specifying pre-defined styles. Mer‐
7040 curial ships with the machine-readable styles cbor, json, and xml,
7041 which provide CBOR, JSON, and XML output, respectively. These are use‐
7042 ful for producing output that is machine readable as-is.
7043
7044 (Mercurial 5.0 is required for CBOR style.)
7045
7046 Important
7047 The json and xml styles are considered experimental. While they
7048 may be attractive to use for easily obtaining machine-readable
7049 output, their behavior may change in subsequent versions.
7050
7051 These styles may also exhibit unexpected results when dealing
7052 with certain encodings. Mercurial treats things like filenames
7053 as a series of bytes and normalizing certain byte sequences to
7054 JSON or XML with certain encoding settings can lead to sur‐
7055 prises.
7056
7057 Command Server Output
7058 If using the command server to interact with Mercurial, you are likely
7059 using an existing library/API that abstracts implementation details of
7060 the command server. If so, this interface layer may perform parsing for
7061 you, saving you the work of implementing it yourself.
7062
7063 Output Verbosity
7064 Commands often have varying output verbosity, even when machine read‐
7065 able styles are being used (e.g. -T json). Adding -v/--verbose and
7066 --debug to the command's arguments can increase the amount of data ex‐
7067 posed by Mercurial.
7068
7069 An alternate way to get the data you need is by explicitly specifying a
7070 template.
7071
7072 Other Topics
7073 revsets
7074 Revisions sets is a functional query language for selecting a
7075 set of revisions. Think of it as SQL for Mercurial repositories.
7076 Revsets are useful for querying repositories for specific data.
7077
7078 See hg help revsets for more.
7079
7080 share extension
7081 The share extension provides functionality for sharing reposi‐
7082 tory data across several working copies. It can even automati‐
7083 cally "pool" storage for logically related repositories when
7084 cloning.
7085
7086 Configuring the share extension can lead to significant resource
7087 utilization reduction, particularly around disk space and the
7088 network. This is especially true for continuous integration (CI)
7089 environments.
7090
7091 See hg help -e share for more.
7092
7094 Subrepositories let you nest external repositories or projects into a
7095 parent Mercurial repository, and make commands operate on them as a
7096 group.
7097
7098 Mercurial currently supports Mercurial, Git, and Subversion subreposi‐
7099 tories.
7100
7101 Subrepositories are made of three components:
7102
7103 1. Nested repository checkouts. They can appear anywhere in the parent
7104 working directory.
7105
7106 2. Nested repository references. They are defined in .hgsub, which
7107 should be placed in the root of working directory, and tell where
7108 the subrepository checkouts come from. Mercurial subrepositories are
7109 referenced like:
7110
7111 path/to/nested = https://example.com/nested/repo/path
7112
7113 Git and Subversion subrepos are also supported:
7114
7115 path/to/nested = [git]git://example.com/nested/repo/path
7116 path/to/nested = [svn]https://example.com/nested/trunk/path
7117
7118 where path/to/nested is the checkout location relatively to the par‐
7119 ent Mercurial root, and https://example.com/nested/repo/path is the
7120 source repository path. The source can also reference a filesystem
7121 path.
7122
7123 Note that .hgsub does not exist by default in Mercurial reposito‐
7124 ries, you have to create and add it to the parent repository before
7125 using subrepositories.
7126
7127 3. Nested repository states. They are defined in .hgsubstate, which is
7128 placed in the root of working directory, and capture whatever infor‐
7129 mation is required to restore the subrepositories to the state they
7130 were committed in a parent repository changeset. Mercurial automati‐
7131 cally record the nested repositories states when committing in the
7132 parent repository.
7133
7134 Note
7135 The .hgsubstate file should not be edited manually.
7136
7137 Adding a Subrepository
7138 If .hgsub does not exist, create it and add it to the parent reposi‐
7139 tory. Clone or checkout the external projects where you want it to live
7140 in the parent repository. Edit .hgsub and add the subrepository entry
7141 as described above. At this point, the subrepository is tracked and the
7142 next commit will record its state in .hgsubstate and bind it to the
7143 committed changeset.
7144
7145 Synchronizing a Subrepository
7146 Subrepos do not automatically track the latest changeset of their
7147 sources. Instead, they are updated to the changeset that corresponds
7148 with the changeset checked out in the top-level changeset. This is so
7149 developers always get a consistent set of compatible code and libraries
7150 when they update.
7151
7152 Thus, updating subrepos is a manual process. Simply check out target
7153 subrepo at the desired revision, test in the top-level repo, then com‐
7154 mit in the parent repository to record the new combination.
7155
7156 Deleting a Subrepository
7157 To remove a subrepository from the parent repository, delete its refer‐
7158 ence from .hgsub, then remove its files.
7159
7160 Interaction with Mercurial Commands
7161 add add does not recurse in subrepos unless -S/--subrepos is speci‐
7162 fied. However, if you specify the full path of a file in a sub‐
7163 repo, it will be added even without -S/--subrepos specified.
7164 Subversion subrepositories are currently silently ignored.
7165
7166 addremove
7167 addremove does not recurse into subrepos unless -S/--subrepos is
7168 specified. However, if you specify the full path of a directory
7169 in a subrepo, addremove will be performed on it even without
7170 -S/--subrepos being specified. Git and Subversion subreposito‐
7171 ries will print a warning and continue.
7172
7173 archive
7174 archive does not recurse in subrepositories unless -S/--subrepos
7175 is specified.
7176
7177 cat Git subrepositories only support exact file matches. Subversion
7178 subrepositories are currently ignored.
7179
7180 commit commit creates a consistent snapshot of the state of the entire
7181 project and its subrepositories. If any subrepositories have
7182 been modified, Mercurial will abort. Mercurial can be made to
7183 instead commit all modified subrepositories by specifying
7184 -S/--subrepos, or setting "ui.commitsubrepos=True" in a configu‐
7185 ration file (see hg help config). After there are no longer any
7186 modified subrepositories, it records their state and finally
7187 commits it in the parent repository. The --addremove option
7188 also honors the -S/--subrepos option. However, Git and Subver‐
7189 sion subrepositories will print a warning and abort.
7190
7191 diff diff does not recurse in subrepos unless -S/--subrepos is speci‐
7192 fied. However, if you specify the full path of a file or direc‐
7193 tory in a subrepo, it will be diffed even without -S/--subrepos
7194 being specified. Subversion subrepositories are currently
7195 silently ignored.
7196
7197 files files does not recurse into subrepos unless -S/--subrepos is
7198 specified. However, if you specify the full path of a file or
7199 directory in a subrepo, it will be displayed even without
7200 -S/--subrepos being specified. Git and Subversion subreposito‐
7201 ries are currently silently ignored.
7202
7203 forget forget currently only handles exact file matches in subrepos.
7204 Git and Subversion subrepositories are currently silently ig‐
7205 nored.
7206
7207 incoming
7208 incoming does not recurse in subrepos unless -S/--subrepos is
7209 specified. Git and Subversion subrepositories are currently
7210 silently ignored.
7211
7212 outgoing
7213 outgoing does not recurse in subrepos unless -S/--subrepos is
7214 specified. Git and Subversion subrepositories are currently
7215 silently ignored.
7216
7217 pull pull is not recursive since it is not clear what to pull prior
7218 to running hg update. Listing and retrieving all subrepositories
7219 changes referenced by the parent repository pulled changesets is
7220 expensive at best, impossible in the Subversion case.
7221
7222 push Mercurial will automatically push all subrepositories first when
7223 the parent repository is being pushed. This ensures new sub‐
7224 repository changes are available when referenced by top-level
7225 repositories. Push is a no-op for Subversion subrepositories.
7226
7227 serve serve does not recurse into subrepositories unless -S/--subrepos
7228 is specified. Git and Subversion subrepositories are currently
7229 silently ignored.
7230
7231 status status does not recurse into subrepositories unless -S/--subre‐
7232 pos is specified. Subrepository changes are displayed as regular
7233 Mercurial changes on the subrepository elements. Subversion sub‐
7234 repositories are currently silently ignored.
7235
7236 remove remove does not recurse into subrepositories unless -S/--subre‐
7237 pos is specified. However, if you specify a file or directory
7238 path in a subrepo, it will be removed even without -S/--subre‐
7239 pos. Git and Subversion subrepositories are currently silently
7240 ignored.
7241
7242 update update restores the subrepos in the state they were originally
7243 committed in target changeset. If the recorded changeset is not
7244 available in the current subrepository, Mercurial will pull it
7245 in first before updating. This means that updating can require
7246 network access when using subrepositories.
7247
7248 Remapping Subrepositories Sources
7249 A subrepository source location may change during a project life, in‐
7250 validating references stored in the parent repository history. To fix
7251 this, rewriting rules can be defined in parent repository hgrc file or
7252 in Mercurial configuration. See the [subpaths] section in hgrc(5) for
7253 more details.
7254
7256 Mercurial allows you to customize output of commands through templates.
7257 You can either pass in a template or select an existing template-style
7258 from the command line, via the --template option.
7259
7260 You can customize output for any "log-like" command: log, outgoing, in‐
7261 coming, tip, parents, and heads.
7262
7263 Some built-in styles are packaged with Mercurial. These can be listed
7264 with hg log --template list. Example usage:
7265
7266 $ hg log -r1.0::1.1 --template changelog
7267
7268 A template is a piece of text, with markup to invoke variable expan‐
7269 sion:
7270
7271 $ hg log -r1 --template "{node}\n"
7272 b56ce7b07c52de7d5fd79fb89701ea538af65746
7273
7274 Keywords
7275 Strings in curly braces are called keywords. The availability of key‐
7276 words depends on the exact context of the templater. These keywords are
7277 usually available for templating a log-like command:
7278
7279 activebookmark
7280 String. The active bookmark, if it is associated with the
7281 changeset.
7282
7283 author Alias for {user}
7284
7285 bisect String. The changeset bisection status.
7286
7287 bookmarks
7288 List of strings. Any bookmarks associated with the changeset.
7289 Also sets 'active', the name of the active bookmark.
7290
7291 branch String. The name of the branch on which the changeset was com‐
7292 mitted.
7293
7294 changessincelatesttag
7295 Integer. All ancestors not in the latest tag.
7296
7297 children
7298 List of strings. The children of the changeset.
7299
7300 date Date information. The date when the changeset was committed.
7301
7302 desc String. The text of the changeset description.
7303
7304 diffstat
7305 String. Statistics of changes with the following format: "modi‐
7306 fied files: +added/-removed lines"
7307
7308 extras List of dicts with key, value entries of the 'extras' field of
7309 this changeset.
7310
7311 file_adds
7312 List of strings. Files added by this changeset.
7313
7314 file_copies
7315 List of strings. Files copied in this changeset with their
7316 sources.
7317
7318 file_copies_switch
7319 List of strings. Like "file_copies" but displayed only if the
7320 --copied switch is set.
7321
7322 file_dels
7323 List of strings. Files removed by this changeset.
7324
7325 file_mods
7326 List of strings. Files modified by this changeset.
7327
7328 files List of strings. All files modified, added, or removed by this
7329 changeset.
7330
7331 graphnode
7332 String. The character representing the changeset node in an
7333 ASCII revision graph.
7334
7335 graphwidth
7336 Integer. The width of the graph drawn by 'log --graph' or zero.
7337
7338 index Integer. The current iteration of the loop. (0 indexed)
7339
7340 latesttag
7341 List of strings. The global tags on the most recent globally
7342 tagged ancestor of this changeset. If no such tags exist, the
7343 list consists of the single string "null".
7344
7345 latesttagdistance
7346 Integer. Longest path to the latest tag.
7347
7348 namespaces
7349 Dict of lists. Names attached to this changeset per namespace.
7350
7351 negrev Integer. The repository-local changeset negative revision num‐
7352 ber, which counts in the opposite direction.
7353
7354 node String. The changeset identification hash, as a 40 hexadecimal
7355 digit string.
7356
7357 onelinesummary
7358 String. A one-line summary for the ctx (not including trailing
7359 newline). The default template be overridden in command-tem‐
7360 plates.oneline-summary.
7361
7362 p1 Changeset. The changeset's first parent. {p1.rev} for the revi‐
7363 sion number, and {p1.node} for the identification hash.
7364
7365 p2 Changeset. The changeset's second parent. {p2.rev} for the revi‐
7366 sion number, and {p2.node} for the identification hash.
7367
7368 parents
7369 List of strings. The parents of the changeset in "rev:node" for‐
7370 mat. If the changeset has only one "natural" parent (the prede‐
7371 cessor revision) nothing is shown.
7372
7373 peerurls
7374 A dictionary of repository locations defined in the [paths] sec‐
7375 tion of your configuration file.
7376
7377 phase String. The changeset phase name.
7378
7379 reporoot
7380 String. The root directory of the current repository.
7381
7382 rev Integer. The repository-local changeset revision number.
7383
7384 subrepos
7385 List of strings. Updated subrepositories in the changeset.
7386
7387 tags List of strings. Any tags associated with the changeset.
7388
7389 termwidth
7390 Integer. The width of the current terminal.
7391
7392 user String. The unmodified author of the changeset.
7393
7394 verbosity
7395 String. The current output verbosity in 'debug', 'quiet', 'ver‐
7396 bose', or ''.
7397
7398 The "date" keyword does not produce human-readable output. If you want
7399 to use a date in your output, you can use a filter to process it. Fil‐
7400 ters are functions which return a string based on the input variable.
7401 Be sure to use the stringify filter first when you're applying a
7402 string-input filter to a list-like input variable. You can also use a
7403 chain of filters to get the desired output:
7404
7405 $ hg tip --template "{date|isodate}\n"
7406 2008-08-21 18:22 +0000
7407
7408 Filters
7409 List of filters:
7410
7411 addbreaks
7412 Any text. Add an XHTML "<br />" tag before the end of every line
7413 except the last.
7414
7415 age Date. Returns a human-readable date/time difference between the
7416 given date/time and the current date/time.
7417
7418 basename
7419 Any text. Treats the text as a path, and returns the last compo‐
7420 nent of the path after splitting by the path separator. For ex‐
7421 ample, "foo/bar/baz" becomes "baz" and "foo/bar//" becomes "".
7422
7423 cbor Any object. Serializes the object to CBOR bytes.
7424
7425 commondir
7426 List of text. Treats each list item as file name with / as path
7427 separator and returns the longest common directory prefix shared
7428 by all list items. Returns the empty string if no common prefix
7429 exists.
7430
7431 The list items are not normalized, i.e. "foo/../bar" is handled
7432 as file "bar" in the directory "foo/..". Leading slashes are ig‐
7433 nored.
7434
7435 For example, ["foo/bar/baz", "foo/baz/bar"] becomes "foo" and
7436 ["foo/bar", "baz"] becomes "".
7437
7438 count List or text. Returns the length as an integer.
7439
7440 dirname
7441 Any text. Treats the text as a path, and strips the last compo‐
7442 nent of the path after splitting by the path separator.
7443
7444 domain Any text. Finds the first string that looks like an email ad‐
7445 dress, and extracts just the domain component. Example: User
7446 <user@example.com> becomes example.com.
7447
7448 email Any text. Extracts the first string that looks like an email ad‐
7449 dress. Example: User <user@example.com> becomes user@exam‐
7450 ple.com.
7451
7452 emailuser
7453 Any text. Returns the user portion of an email address.
7454
7455 escape Any text. Replaces the special XML/XHTML characters "&", "<" and
7456 ">" with XML entities, and filters out NUL characters.
7457
7458 fill68 Any text. Wraps the text to fit in 68 columns.
7459
7460 fill76 Any text. Wraps the text to fit in 76 columns.
7461
7462 firstline
7463 Any text. Returns the first line of text.
7464
7465 hex Any text. Convert a binary Mercurial node identifier into its
7466 long hexadecimal representation.
7467
7468 hgdate Date. Returns the date as a pair of numbers: "1157407993 25200"
7469 (Unix timestamp, timezone offset).
7470
7471 isodate
7472 Date. Returns the date in ISO 8601 format: "2009-08-18 13:00
7473 +0200".
7474
7475 isodatesec
7476 Date. Returns the date in ISO 8601 format, including seconds:
7477 "2009-08-18 13:00:13 +0200". See also the rfc3339date filter.
7478
7479 json Any object. Serializes the object to a JSON formatted text.
7480
7481 lower Any text. Converts the text to lowercase.
7482
7483 nonempty
7484 Any text. Returns '(none)' if the string is empty.
7485
7486 obfuscate
7487 Any text. Returns the input text rendered as a sequence of XML
7488 entities.
7489
7490 person Any text. Returns the name before an email address, interpreting
7491 it as per RFC 5322.
7492
7493 revescape
7494 Any text. Escapes all "special" characters, except @. Forward
7495 slashes are escaped twice to prevent web servers from prema‐
7496 turely unescaping them. For example, "@foo bar/baz" becomes
7497 "@foo%20bar%252Fbaz".
7498
7499 rfc3339date
7500 Date. Returns a date using the Internet date format specified in
7501 RFC 3339: "2009-08-18T13:00:13+02:00".
7502
7503 rfc822date
7504 Date. Returns a date using the same format used in email head‐
7505 ers: "Tue, 18 Aug 2009 13:00:13 +0200".
7506
7507 short Changeset hash. Returns the short form of a changeset hash, i.e.
7508 a 12 hexadecimal digit string.
7509
7510 shortbisect
7511 Any text. Treats label as a bisection status, and returns a sin‐
7512 gle-character representing the status (G: good, B: bad, S:
7513 skipped, U: untested, I: ignored). Returns single space if text
7514 is not a valid bisection status.
7515
7516 shortdate
7517 Date. Returns a date like "2006-09-18".
7518
7519 slashpath
7520 Any text. Replaces the native path separator with slash.
7521
7522 splitlines
7523 Any text. Split text into a list of lines.
7524
7525 stringify
7526 Any type. Turns the value into text by converting values into
7527 text and concatenating them.
7528
7529 stripdir
7530 Treat the text as path and strip a directory level, if possible.
7531 For example, "foo" and "foo/bar" becomes "foo".
7532
7533 tabindent
7534 Any text. Returns the text, with every non-empty line except the
7535 first starting with a tab character.
7536
7537 upper Any text. Converts the text to uppercase.
7538
7539 urlescape
7540 Any text. Escapes all "special" characters. For example, "foo
7541 bar" becomes "foo%20bar".
7542
7543 user Any text. Returns a short representation of a user name or email
7544 address.
7545
7546 utf8 Any text. Converts from the local character encoding to UTF-8.
7547
7548 Note that a filter is nothing more than a function call, i.e.
7549 expr|filter is equivalent to filter(expr).
7550
7551 Functions
7552 In addition to filters, there are some basic built-in functions:
7553
7554 config(section, name[, default])
7555 Returns the requested hgrc config option as a string.
7556
7557 configbool(section, name[, default])
7558 Returns the requested hgrc config option as a boolean.
7559
7560 configint(section, name[, default])
7561 Returns the requested hgrc config option as an integer.
7562
7563 date(date[, fmt])
7564 Format a date. See hg help dates for formatting strings. The de‐
7565 fault is a Unix date format, including the timezone: "Mon Sep 04
7566 15:13:13 2006 0700".
7567
7568 dict([[key=]value...])
7569 Construct a dict from key-value pairs. A key may be omitted if a
7570 value expression can provide an unambiguous name.
7571
7572 diff([includepattern [, excludepattern]])
7573 Show a diff, optionally specifying files to include or exclude.
7574
7575 files(pattern)
7576 All files of the current changeset matching the pattern. See hg
7577 help patterns.
7578
7579 fill(text[, width[, initialident[, hangindent]]])
7580 Fill many paragraphs with optional indentation. See the "fill"
7581 filter.
7582
7583 filter(iterable[, expr])
7584 Remove empty elements from a list or a dict. If expr specified,
7585 it's applied to each element to test emptiness.
7586
7587 get(dict, key)
7588 Get an attribute/key from an object. Some keywords are complex
7589 types. This function allows you to obtain the value of an attri‐
7590 bute on these types.
7591
7592 if(expr, then[, else])
7593 Conditionally execute based on the result of an expression.
7594
7595 ifcontains(needle, haystack, then[, else])
7596 Conditionally execute based on whether the item "needle" is in
7597 "haystack".
7598
7599 ifeq(expr1, expr2, then[, else])
7600 Conditionally execute based on whether 2 items are equivalent.
7601
7602 indent(text, indentchars[, firstline])
7603 Indents all non-empty lines with the characters given in the in‐
7604 dentchars string. An optional third parameter will override the
7605 indent for the first line only if present.
7606
7607 join(list, sep)
7608 Join items in a list with a delimiter.
7609
7610 label(label, expr)
7611 Apply a label to generated content. Content with a label applied
7612 can result in additional post-processing, such as automatic col‐
7613 orization.
7614
7615 latesttag([pattern])
7616 The global tags matching the given pattern on the most recent
7617 globally tagged ancestor of this changeset. If no such tags ex‐
7618 ist, the "{tag}" template resolves to the string "null". See hg
7619 help revisions.patterns for the pattern syntax.
7620
7621 localdate(date[, tz])
7622 Converts a date to the specified timezone. The default is local
7623 date.
7624
7625 mailmap(author)
7626 Return the author, updated according to the value set in the
7627 .mailmap file
7628
7629 max(iterable)
7630 Return the max of an iterable
7631
7632 min(iterable)
7633 Return the min of an iterable
7634
7635 mod(a, b)
7636 Calculate a mod b such that a / b + a mod b == a
7637
7638 pad(text, width[, fillchar=' '[, left=False[, truncate=False]]])
7639 Pad text with a fill character.
7640
7641 relpath(path)
7642 Convert a repository-absolute path into a filesystem path rela‐
7643 tive to the current working directory.
7644
7645 revset(query[, formatargs...])
7646 Execute a revision set query. See hg help revset.
7647
7648 rstdoc(text, style)
7649 Format reStructuredText.
7650
7651 search(pattern, text)
7652 Look for the first text matching the regular expression pattern.
7653 Groups are accessible as {1}, {2}, ... in %-mapped template.
7654
7655 separate(sep, args...)
7656 Add a separator between non-empty arguments.
7657
7658 shortest(node, minlength=4)
7659 Obtain the shortest representation of a node.
7660
7661 startswith(pattern, text)
7662 Returns the value from the "text" argument if it begins with the
7663 content from the "pattern" argument.
7664
7665 strip(text[, chars])
7666 Strip characters from a string. By default, strips all leading
7667 and trailing whitespace.
7668
7669 sub(pattern, replacement, expression)
7670 Perform text substitution using regular expressions.
7671
7672 subsetparents(rev, revset)
7673 Look up parents of the rev in the sub graph given by the revset.
7674
7675 word(number, text[, separator])
7676 Return the nth word from a string.
7677
7678 Operators
7679 We provide a limited set of infix arithmetic operations on integers:
7680
7681 + for addition
7682 - for subtraction
7683 * for multiplication
7684 / for floor division (division rounded to integer nearest -infinity)
7685
7686 Division fulfills the law x = x / y + mod(x, y).
7687
7688 Also, for any expression that returns a list, there is a list operator:
7689
7690 expr % "{template}"
7691
7692 As seen in the above example, {template} is interpreted as a template.
7693 To prevent it from being interpreted, you can use an escape character
7694 \{ or a raw string prefix, r'...'.
7695
7696 The dot operator can be used as a shorthand for accessing a sub item:
7697
7698 • expr.member is roughly equivalent to expr % '{member}' if expr re‐
7699 turns a non-list/dict. The returned value is not stringified.
7700
7701 • dict.key is identical to get(dict, 'key').
7702
7703 Aliases
7704 New keywords and functions can be defined in the templatealias section
7705 of a Mercurial configuration file:
7706
7707 <alias> = <definition>
7708
7709 Arguments of the form a1, a2, etc. are substituted from the alias into
7710 the definition.
7711
7712 For example,
7713
7714 [templatealias]
7715 r = rev
7716 rn = "{r}:{node|short}"
7717 leftpad(s, w) = pad(s, w, ' ', True)
7718
7719 defines two symbol aliases, r and rn, and a function alias leftpad().
7720
7721 It's also possible to specify complete template strings, using the tem‐
7722 plates section. The syntax used is the general template string syntax.
7723
7724 For example,
7725
7726 [templates]
7727 nodedate = "{node|short}: {date(date, "%Y-%m-%d")}\n"
7728
7729 defines a template, nodedate, which can be called like:
7730
7731 $ hg log -r . -Tnodedate
7732
7733 A template defined in templates section can also be referenced from an‐
7734 other template:
7735
7736 $ hg log -r . -T "{rev} {nodedate}"
7737
7738 but be aware that the keywords cannot be overridden by templates. For
7739 example, a template defined as templates.rev cannot be referenced as
7740 {rev}.
7741
7742 A template defined in templates section may have sub templates which
7743 are inserted before/after/between items:
7744
7745 [templates]
7746 myjson = ' {dict(rev, node|short)|json}'
7747 myjson:docheader = '\{\n'
7748 myjson:docfooter = '\n}\n'
7749 myjson:separator = ',\n'
7750
7751 Examples
7752 Some sample command line templates:
7753
7754 • Format lists, e.g. files:
7755
7756 $ hg log -r 0 --template "files:\n{files % ' {file}\n'}"
7757
7758 • Join the list of files with a ", ":
7759
7760 $ hg log -r 0 --template "files: {join(files, ', ')}\n"
7761
7762 • Join the list of files ending with ".py" with a ", ":
7763
7764 $ hg log -r 0 --template "pythonfiles: {join(files('**.py'), ', ')}\n"
7765
7766 • Separate non-empty arguments by a " ":
7767
7768 $ hg log -r 0 --template "{separate(' ', node, bookmarks, tags}\n"
7769
7770 • Modify each line of a commit description:
7771
7772 $ hg log --template "{splitlines(desc) % '**** {line}\n'}"
7773
7774 • Format date:
7775
7776 $ hg log -r 0 --template "{date(date, '%Y')}\n"
7777
7778 • Display date in UTC:
7779
7780 $ hg log -r 0 --template "{localdate(date, 'UTC')|date}\n"
7781
7782 • Output the description set to a fill-width of 30:
7783
7784 $ hg log -r 0 --template "{fill(desc, 30)}"
7785
7786 • Use a conditional to test for the default branch:
7787
7788 $ hg log -r 0 --template "{ifeq(branch, 'default', 'on the main branch',
7789 'on branch {branch}')}\n"
7790
7791 • Append a newline if not empty:
7792
7793 $ hg tip --template "{if(author, '{author}\n')}"
7794
7795 • Label the output for use with the color extension:
7796
7797 $ hg log -r 0 --template "{label('changeset.{phase}', node|short)}\n"
7798
7799 • Invert the firstline filter, i.e. everything but the first line:
7800
7801 $ hg log -r 0 --template "{sub(r'^.*\n?\n?', '', desc)}\n"
7802
7803 • Display the contents of the 'extra' field, one per line:
7804
7805 $ hg log -r 0 --template "{join(extras, '\n')}\n"
7806
7807 • Mark the active bookmark with '*':
7808
7809 $ hg log --template "{bookmarks % '{bookmark}{ifeq(bookmark, active, '*')} '}\n"
7810
7811 • Find the previous release candidate tag, the distance and changes
7812 since the tag:
7813
7814 $ hg log -r . --template "{latesttag('re:^.*-rc$') % '{tag}, {changes}, {distance}'}\n"
7815
7816 • Mark the working copy parent with '@':
7817
7818 $ hg log --template "{ifcontains(rev, revset('.'), '@')}\n"
7819
7820 • Show details of parent revisions:
7821
7822 $ hg log --template "{revset('parents(%d)', rev) % '{desc|firstline}\n'}"
7823
7824 • Show only commit descriptions that start with "template":
7825
7826 $ hg log --template "{startswith('template', firstline(desc))}\n"
7827
7828 • Print the first word of each line of a commit message:
7829
7830 $ hg log --template "{word(0, desc)}\n"
7831
7833 Valid URLs are of the form:
7834
7835 local/filesystem/path[#revision]
7836 file://local/filesystem/path[#revision]
7837 http://[user[:pass]@]host[:port]/[path][#revision]
7838 https://[user[:pass]@]host[:port]/[path][#revision]
7839 ssh://[user@]host[:port]/[path][#revision]
7840
7841 Paths in the local filesystem can either point to Mercurial reposito‐
7842 ries or to bundle files (as created by hg bundle or hg incoming --bun‐
7843 dle). See also hg help paths.
7844
7845 An optional identifier after # indicates a particular branch, tag, or
7846 changeset to use from the remote repository. See also hg help revisions
7847 .
7848
7849 Some features, such as pushing to http:// and https:// URLs are only
7850 possible if the feature is explicitly enabled on the remote Mercurial
7851 server.
7852
7853 Note that the security of HTTPS URLs depends on proper configuration of
7854 web.cacerts.
7855
7856 Some notes about using SSH with Mercurial:
7857
7858 • SSH requires an accessible shell account on the destination machine
7859 and a copy of hg in the remote path or specified with remotecmd.
7860
7861 • path is relative to the remote user's home directory by default. Use
7862 an extra slash at the start of a path to specify an absolute path:
7863
7864 ssh://example.com//tmp/repository
7865
7866 • Mercurial doesn't use its own compression via SSH; the right thing to
7867 do is to configure it in your ~/.ssh/config, e.g.:
7868
7869 Host *.mylocalnetwork.example.com
7870 Compression no
7871 Host *
7872 Compression yes
7873
7874 Alternatively specify "ssh -C" as your ssh command in your configura‐
7875 tion file or with the --ssh command line option.
7876
7877 These URLs can all be stored in your configuration file with path
7878 aliases under the [paths] section like so:
7879
7880 [paths]
7881 alias1 = URL1
7882 alias2 = URL2
7883 ...
7884
7885 You can then use the alias for any command that uses a URL (for example
7886 hg pull alias1 will be treated as hg pull URL1).
7887
7888 Two path aliases are special because they are used as defaults when you
7889 do not provide the URL to a command:
7890
7891 default:
7892 When you create a repository with hg clone, the clone command
7893 saves the location of the source repository as the new reposi‐
7894 tory's 'default' path. This is then used when you omit path from
7895 push- and pull-like commands (including incoming and outgoing).
7896
7897 default-push:
7898 The push command will look for a path named 'default-push', and
7899 prefer it over 'default' if both are defined.
7900
7902 This section contains help for extensions that are distributed together
7903 with Mercurial. Help for other extensions is available in the help sys‐
7904 tem.
7905
7906 absorb
7907 apply working directory changes to changesets (EXPERIMENTAL)
7908
7909 The absorb extension provides a command to use annotate information to
7910 amend modified chunks into the corresponding non-public changesets.
7911
7912 [absorb]
7913 # only check 50 recent non-public changesets at most
7914 max-stack-size = 50
7915 # whether to add noise to new commits to avoid obsolescence cycle
7916 add-noise = 1
7917 # make `amend --correlated` a shortcut to the main command
7918 amend-flag = correlated
7919
7920 [color]
7921 absorb.description = yellow
7922 absorb.node = blue bold
7923 absorb.path = bold
7924
7925 Commands
7926 Change creation
7927 absorb
7928 incorporate corrections into the stack of draft changesets:
7929
7930 hg absorb [OPTION] [FILE]...
7931
7932 absorb analyzes each change in your working directory and attempts to
7933 amend the changed lines into the changesets in your stack that first
7934 introduced those lines.
7935
7936 If absorb cannot find an unambiguous changeset to amend for a change,
7937 that change will be left in the working directory, untouched. They can
7938 be observed by hg status or hg diff afterwards. In other words, absorb
7939 does not write to the working directory.
7940
7941 Changesets outside the revset ::. and not public() and not merge() will
7942 not be changed.
7943
7944 Changesets that become empty after applying the changes will be
7945 deleted.
7946
7947 By default, absorb will show what it plans to do and prompt for confir‐
7948 mation. If you are confident that the changes will be absorbed to the
7949 correct place, run hg absorb -a to apply the changes immediately.
7950
7951 Returns 0 on success, 1 if all chunks were ignored and nothing amended.
7952
7953 Options:
7954
7955 -a, --apply-changes
7956 apply changes without prompting for confirmation
7957
7958 -p, --print-changes
7959 always print which changesets are modified by which changes
7960
7961 -i, --interactive
7962 interactively select which chunks to apply
7963
7964 -e, --edit-lines
7965 edit what lines belong to which changesets before commit (EXPER‐
7966 IMENTAL)
7967
7968 -n, --dry-run
7969 do not perform actions, just print output
7970
7971 --style <STYLE>
7972 display using template map file (DEPRECATED)
7973
7974 -T,--template <TEMPLATE>
7975 display with template
7976
7977 -I,--include <PATTERN[+]>
7978 include names matching the given patterns
7979
7980 -X,--exclude <PATTERN[+]>
7981 exclude names matching the given patterns
7982
7983 [+] marked option can be specified multiple times
7984
7985 acl
7986 hooks for controlling repository access
7987
7988 This hook makes it possible to allow or deny write access to given
7989 branches and paths of a repository when receiving incoming changesets
7990 via pretxnchangegroup and pretxncommit.
7991
7992 The authorization is matched based on the local user name on the system
7993 where the hook runs, and not the committer of the original changeset
7994 (since the latter is merely informative).
7995
7996 The acl hook is best used along with a restricted shell like hgsh, pre‐
7997 venting authenticating users from doing anything other than pushing or
7998 pulling. The hook is not safe to use if users have interactive shell
7999 access, as they can then disable the hook. Nor is it safe if remote
8000 users share an account, because then there is no way to distinguish
8001 them.
8002
8003 The order in which access checks are performed is:
8004
8005 1. Deny list for branches (section acl.deny.branches)
8006
8007 2. Allow list for branches (section acl.allow.branches)
8008
8009 3. Deny list for paths (section acl.deny)
8010
8011 4. Allow list for paths (section acl.allow)
8012
8013 The allow and deny sections take key-value pairs.
8014
8015 Branch-based Access Control
8016 Use the acl.deny.branches and acl.allow.branches sections to have
8017 branch-based access control. Keys in these sections can be either:
8018
8019 • a branch name, or
8020
8021 • an asterisk, to match any branch;
8022
8023 The corresponding values can be either:
8024
8025 • a comma-separated list containing users and groups, or
8026
8027 • an asterisk, to match anyone;
8028
8029 You can add the "!" prefix to a user or group name to invert the sense
8030 of the match.
8031
8032 Path-based Access Control
8033 Use the acl.deny and acl.allow sections to have path-based access con‐
8034 trol. Keys in these sections accept a subtree pattern (with a glob syn‐
8035 tax by default). The corresponding values follow the same syntax as the
8036 other sections above.
8037
8038 Bookmark-based Access Control
8039 Use the acl.deny.bookmarks and acl.allow.bookmarks sections to have
8040 bookmark-based access control. Keys in these sections can be either:
8041
8042 • a bookmark name, or
8043
8044 • an asterisk, to match any bookmark;
8045
8046 The corresponding values can be either:
8047
8048 • a comma-separated list containing users and groups, or
8049
8050 • an asterisk, to match anyone;
8051
8052 You can add the "!" prefix to a user or group name to invert the sense
8053 of the match.
8054
8055 Note: for interactions between clients and servers using Mercurial 3.6+
8056 a rejection will generally reject the entire push, for interactions in‐
8057 volving older clients, the commit transactions will already be ac‐
8058 cepted, and only the bookmark movement will be rejected.
8059
8060 Groups
8061 Group names must be prefixed with an @ symbol. Specifying a group name
8062 has the same effect as specifying all the users in that group.
8063
8064 You can define group members in the acl.groups section. If a group
8065 name is not defined there, and Mercurial is running under a Unix-like
8066 system, the list of users will be taken from the OS. Otherwise, an ex‐
8067 ception will be raised.
8068
8069 Example Configuration
8070 [hooks]
8071
8072 # Use this if you want to check access restrictions at commit time
8073 pretxncommit.acl = python:hgext.acl.hook
8074
8075 # Use this if you want to check access restrictions for pull, push,
8076 # bundle and serve.
8077 pretxnchangegroup.acl = python:hgext.acl.hook
8078
8079 [acl]
8080 # Allow or deny access for incoming changes only if their source is
8081 # listed here, let them pass otherwise. Source is "serve" for all
8082 # remote access (http or ssh), "push", "pull" or "bundle" when the
8083 # related commands are run locally.
8084 # Default: serve
8085 sources = serve
8086
8087 [acl.deny.branches]
8088
8089 # Everyone is denied to the frozen branch:
8090 frozen-branch = *
8091
8092 # A bad user is denied on all branches:
8093 * = bad-user
8094
8095 [acl.allow.branches]
8096
8097 # A few users are allowed on branch-a:
8098 branch-a = user-1, user-2, user-3
8099
8100 # Only one user is allowed on branch-b:
8101 branch-b = user-1
8102
8103 # The super user is allowed on any branch:
8104 * = super-user
8105
8106 # Everyone is allowed on branch-for-tests:
8107 branch-for-tests = *
8108
8109 [acl.deny]
8110 # This list is checked first. If a match is found, acl.allow is not
8111 # checked. All users are granted access if acl.deny is not present.
8112 # Format for both lists: glob pattern = user, ..., @group, ...
8113
8114 # To match everyone, use an asterisk for the user:
8115 # my/glob/pattern = *
8116
8117 # user6 will not have write access to any file:
8118 ** = user6
8119
8120 # Group "hg-denied" will not have write access to any file:
8121 ** = @hg-denied
8122
8123 # Nobody will be able to change "DONT-TOUCH-THIS.txt", despite
8124 # everyone being able to change all other files. See below.
8125 src/main/resources/DONT-TOUCH-THIS.txt = *
8126
8127 [acl.allow]
8128 # if acl.allow is not present, all users are allowed by default
8129 # empty acl.allow = no users allowed
8130
8131 # User "doc_writer" has write access to any file under the "docs"
8132 # folder:
8133 docs/** = doc_writer
8134
8135 # User "jack" and group "designers" have write access to any file
8136 # under the "images" folder:
8137 images/** = jack, @designers
8138
8139 # Everyone (except for "user6" and "@hg-denied" - see acl.deny above)
8140 # will have write access to any file under the "resources" folder
8141 # (except for 1 file. See acl.deny):
8142 src/main/resources/** = *
8143
8144 .hgtags = release_engineer
8145
8146 Examples using the ! prefix
8147 Suppose there's a branch that only a given user (or group) should be
8148 able to push to, and you don't want to restrict access to any other
8149 branch that may be created.
8150
8151 The "!" prefix allows you to prevent anyone except a given user or
8152 group to push changesets in a given branch or path.
8153
8154 In the examples below, we will: 1) Deny access to branch "ring" to any‐
8155 one but user "gollum" 2) Deny access to branch "lake" to anyone but
8156 members of the group "hobbit" 3) Deny access to a file to anyone but
8157 user "gollum"
8158
8159 [acl.allow.branches]
8160 # Empty
8161
8162 [acl.deny.branches]
8163
8164 # 1) only 'gollum' can commit to branch 'ring';
8165 # 'gollum' and anyone else can still commit to any other branch.
8166 ring = !gollum
8167
8168 # 2) only members of the group 'hobbit' can commit to branch 'lake';
8169 # 'hobbit' members and anyone else can still commit to any other branch.
8170 lake = !@hobbit
8171
8172 # You can also deny access based on file paths:
8173
8174 [acl.allow]
8175 # Empty
8176
8177 [acl.deny]
8178 # 3) only 'gollum' can change the file below;
8179 # 'gollum' and anyone else can still change any other file.
8180 /misty/mountains/cave/ring = !gollum
8181
8182 amend
8183 provide the amend command (EXPERIMENTAL)
8184
8185 This extension provides an amend command that is similar to commit
8186 --amend but does not prompt an editor.
8187
8188 Commands
8189 Change creation
8190 amend
8191 amend the working copy parent with all or specified outstanding
8192 changes:
8193
8194 hg amend [OPTION]... [FILE]...
8195
8196 Similar to hg commit --amend, but reuse the commit message without in‐
8197 voking editor, unless --edit was set.
8198
8199 See hg help commit for more details.
8200
8201 Options:
8202
8203 -A, --addremove
8204 mark new/missing files as added/removed before committing
8205
8206 -e, --edit
8207 invoke editor on commit messages
8208
8209 -i, --interactive
8210 use interactive mode
8211
8212 --close-branch
8213 mark a branch as closed, hiding it from the branch list
8214
8215 -s, --secret
8216 use the secret phase for committing
8217
8218 -n,--note <VALUE>
8219 store a note on the amend
8220
8221 -I,--include <PATTERN[+]>
8222 include names matching the given patterns
8223
8224 -X,--exclude <PATTERN[+]>
8225 exclude names matching the given patterns
8226
8227 -m,--message <TEXT>
8228 use text as commit message
8229
8230 -l,--logfile <FILE>
8231 read commit message from file
8232
8233 -d,--date <DATE>
8234 record the specified date as commit date
8235
8236 -u,--user <USER>
8237 record the specified user as committer
8238
8239 -D, --currentdate
8240 record the current date as commit date
8241
8242 -U, --currentuser
8243 record the current user as committer
8244
8245 [+] marked option can be specified multiple times
8246
8247 automv
8248 check for unrecorded moves at commit time (EXPERIMENTAL)
8249
8250 This extension checks at commit/amend time if any of the committed
8251 files comes from an unrecorded mv.
8252
8253 The threshold at which a file is considered a move can be set with the
8254 automv.similarity config option. This option takes a percentage between
8255 0 (disabled) and 100 (files must be identical), the default is 95.
8256
8257 beautifygraph
8258 beautify log -G output by using Unicode characters (EXPERIMENTAL)
8259
8260 A terminal with UTF-8 support and monospace narrow text are re‐
8261 quired.
8262
8263 blackbox
8264 log repository events to a blackbox for debugging
8265
8266 Logs event information to .hg/blackbox.log to help debug and diagnose
8267 problems. The events that get logged can be configured via the black‐
8268 box.track and blackbox.ignore config keys.
8269
8270 Examples:
8271
8272 [blackbox]
8273 track = *
8274 ignore = pythonhook
8275 # dirty is *EXPENSIVE* (slow);
8276 # each log entry indicates `+` if the repository is dirty, like :hg:`id`.
8277 dirty = True
8278 # record the source of log messages
8279 logsource = True
8280
8281 [blackbox]
8282 track = command, commandfinish, commandexception, exthook, pythonhook
8283
8284 [blackbox]
8285 track = incoming
8286
8287 [blackbox]
8288 # limit the size of a log file
8289 maxsize = 1.5 MB
8290 # rotate up to N log files when the current one gets too big
8291 maxfiles = 3
8292
8293 [blackbox]
8294 # Include nanoseconds in log entries with %f (see Python function
8295 # datetime.datetime.strftime)
8296 date-format = '%Y-%m-%d @ %H:%M:%S.%f'
8297
8298 Commands
8299 Repository maintenance
8300 blackbox
8301 view the recent repository events:
8302
8303 hg blackbox [OPTION]...
8304
8305 view the recent repository events
8306
8307 Options:
8308
8309 -l,--limit <VALUE>
8310 the number of events to show (default: 10)
8311
8312 bookflow
8313 implements bookmark-based branching (EXPERIMENTAL)
8314
8315 • Disables creation of new branches (config: enable_branches=False).
8316
8317 • Requires an active bookmark on commit (config: require_book‐
8318 mark=True).
8319
8320 • Doesn't move the active bookmark on update, only on commit.
8321
8322 • Requires '--rev' for moving an existing bookmark.
8323
8324 • Protects special bookmarks (config: protect=@).
8325
8326 flow related commands
8327
8328 hg book NAME
8329 create a new bookmark
8330
8331 hg book NAME -r REV
8332 move bookmark to revision (fast-forward)
8333
8334 hg up|co NAME
8335 switch to bookmark
8336
8337 hg push -B .
8338 push active bookmark
8339
8340 bugzilla
8341 hooks for integrating with the Bugzilla bug tracker
8342
8343 This hook extension adds comments on bugs in Bugzilla when changesets
8344 that refer to bugs by Bugzilla ID are seen. The comment is formatted
8345 using the Mercurial template mechanism.
8346
8347 The bug references can optionally include an update for Bugzilla of the
8348 hours spent working on the bug. Bugs can also be marked fixed.
8349
8350 Four basic modes of access to Bugzilla are provided:
8351
8352 1. Access via the Bugzilla REST-API. Requires bugzilla 5.0 or later.
8353
8354 2. Access via the Bugzilla XMLRPC interface. Requires Bugzilla 3.4 or
8355 later.
8356
8357 3. Check data via the Bugzilla XMLRPC interface and submit bug change
8358 via email to Bugzilla email interface. Requires Bugzilla 3.4 or
8359 later.
8360
8361 4. Writing directly to the Bugzilla database. Only Bugzilla installa‐
8362 tions using MySQL are supported. Requires Python MySQLdb.
8363
8364 Writing directly to the database is susceptible to schema changes, and
8365 relies on a Bugzilla contrib script to send out bug change notification
8366 emails. This script runs as the user running Mercurial, must be run on
8367 the host with the Bugzilla install, and requires permission to read
8368 Bugzilla configuration details and the necessary MySQL user and pass‐
8369 word to have full access rights to the Bugzilla database. For these
8370 reasons this access mode is now considered deprecated, and will not be
8371 updated for new Bugzilla versions going forward. Only adding comments
8372 is supported in this access mode.
8373
8374 Access via XMLRPC needs a Bugzilla username and password to be speci‐
8375 fied in the configuration. Comments are added under that username.
8376 Since the configuration must be readable by all Mercurial users, it is
8377 recommended that the rights of that user are restricted in Bugzilla to
8378 the minimum necessary to add comments. Marking bugs fixed requires
8379 Bugzilla 4.0 and later.
8380
8381 Access via XMLRPC/email uses XMLRPC to query Bugzilla, but sends email
8382 to the Bugzilla email interface to submit comments to bugs. The From:
8383 address in the email is set to the email address of the Mercurial user,
8384 so the comment appears to come from the Mercurial user. In the event
8385 that the Mercurial user email is not recognized by Bugzilla as a
8386 Bugzilla user, the email associated with the Bugzilla username used to
8387 log into Bugzilla is used instead as the source of the comment. Marking
8388 bugs fixed works on all supported Bugzilla versions.
8389
8390 Access via the REST-API needs either a Bugzilla username and password
8391 or an apikey specified in the configuration. Comments are made under
8392 the given username or the user associated with the apikey in Bugzilla.
8393
8394 Configuration items common to all access modes:
8395
8396 bugzilla.version
8397 The access type to use. Values recognized are:
8398
8399 restapi
8400
8401 Bugzilla REST-API, Bugzilla 5.0 and later.
8402
8403 xmlrpc
8404
8405 Bugzilla XMLRPC interface.
8406
8407 xmlrpc+email
8408
8409 Bugzilla XMLRPC and email interfaces.
8410
8411 3.0
8412
8413 MySQL access, Bugzilla 3.0 and later.
8414
8415 2.18
8416
8417 MySQL access, Bugzilla 2.18 and up to but not including
8418 3.0.
8419
8420 2.16
8421
8422 MySQL access, Bugzilla 2.16 and up to but not including
8423 2.18.
8424
8425 bugzilla.regexp
8426 Regular expression to match bug IDs for update in changeset com‐
8427 mit message. It must contain one "()" named group <ids> con‐
8428 taining the bug IDs separated by non-digit characters. It may
8429 also contain a named group <hours> with a floating-point number
8430 giving the hours worked on the bug. If no named groups are
8431 present, the first "()" group is assumed to contain the bug IDs,
8432 and work time is not updated. The default expression matches Bug
8433 1234, Bug no. 1234, Bug number 1234, Bugs 1234,5678, Bug 1234
8434 and 5678 and variations thereof, followed by an hours number
8435 prefixed by h or hours, e.g. hours 1.5. Matching is case insen‐
8436 sitive.
8437
8438 bugzilla.fixregexp
8439 Regular expression to match bug IDs for marking fixed in change‐
8440 set commit message. This must contain a "()" named group <ids>`
8441 containing the bug IDs separated by non-digit characters. It may
8442 also contain a named group ``<hours> with a floating-point num‐
8443 ber giving the hours worked on the bug. If no named groups are
8444 present, the first "()" group is assumed to contain the bug IDs,
8445 and work time is not updated. The default expression matches
8446 Fixes 1234, Fixes bug 1234, Fixes bugs 1234,5678, Fixes 1234 and
8447 5678 and variations thereof, followed by an hours number pre‐
8448 fixed by h or hours, e.g. hours 1.5. Matching is case insensi‐
8449 tive.
8450
8451 bugzilla.fixstatus
8452 The status to set a bug to when marking fixed. Default RESOLVED.
8453
8454 bugzilla.fixresolution
8455 The resolution to set a bug to when marking fixed. Default
8456 FIXED.
8457
8458 bugzilla.style
8459 The style file to use when formatting comments.
8460
8461 bugzilla.template
8462 Template to use when formatting comments. Overrides style if
8463 specified. In addition to the usual Mercurial keywords, the ex‐
8464 tension specifies:
8465
8466 {bug}
8467
8468 The Bugzilla bug ID.
8469
8470 {root}
8471
8472 The full pathname of the Mercurial repository.
8473
8474 {webroot}
8475
8476 Stripped pathname of the Mercurial repository.
8477
8478 {hgweb}
8479
8480 Base URL for browsing Mercurial repositories.
8481
8482 Default changeset {node|short} in repo {root} refers to bug
8483 {bug}.\ndetails:\n\t{desc|tabindent}
8484
8485 bugzilla.strip
8486 The number of path separator characters to strip from the front
8487 of the Mercurial repository path ({root} in templates) to pro‐
8488 duce {webroot}. For example, a repository with {root} /var/lo‐
8489 cal/my-project with a strip of 2 gives a value for {webroot} of
8490 my-project. Default 0.
8491
8492 web.baseurl
8493 Base URL for browsing Mercurial repositories. Referenced from
8494 templates as {hgweb}.
8495
8496 Configuration items common to XMLRPC+email and MySQL access modes:
8497
8498 bugzilla.usermap
8499 Path of file containing Mercurial committer email to Bugzilla
8500 user email mappings. If specified, the file should contain one
8501 mapping per line:
8502
8503 committer = Bugzilla user
8504
8505 See also the [usermap] section.
8506
8507 The [usermap] section is used to specify mappings of Mercurial commit‐
8508 ter email to Bugzilla user email. See also bugzilla.usermap. Contains
8509 entries of the form committer = Bugzilla user.
8510
8511 XMLRPC and REST-API access mode configuration:
8512
8513 bugzilla.bzurl
8514 The base URL for the Bugzilla installation. Default http://lo‐
8515 calhost/bugzilla.
8516
8517 bugzilla.user
8518 The username to use to log into Bugzilla via XMLRPC. Default
8519 bugs.
8520
8521 bugzilla.password
8522 The password for Bugzilla login.
8523
8524 REST-API access mode uses the options listed above as well as:
8525
8526 bugzilla.apikey
8527 An apikey generated on the Bugzilla instance for api access.
8528 Using an apikey removes the need to store the user and password
8529 options.
8530
8531 XMLRPC+email access mode uses the XMLRPC access mode configuration
8532 items, and also:
8533
8534 bugzilla.bzemail
8535 The Bugzilla email address.
8536
8537 In addition, the Mercurial email settings must be configured. See the
8538 documentation in hgrc(5), sections [email] and [smtp].
8539
8540 MySQL access mode configuration:
8541
8542 bugzilla.host
8543 Hostname of the MySQL server holding the Bugzilla database. De‐
8544 fault localhost.
8545
8546 bugzilla.db
8547 Name of the Bugzilla database in MySQL. Default bugs.
8548
8549 bugzilla.user
8550 Username to use to access MySQL server. Default bugs.
8551
8552 bugzilla.password
8553 Password to use to access MySQL server.
8554
8555 bugzilla.timeout
8556 Database connection timeout (seconds). Default 5.
8557
8558 bugzilla.bzuser
8559 Fallback Bugzilla user name to record comments with, if change‐
8560 set committer cannot be found as a Bugzilla user.
8561
8562 bugzilla.bzdir
8563 Bugzilla install directory. Used by default notify. Default
8564 /var/www/html/bugzilla.
8565
8566 bugzilla.notify
8567 The command to run to get Bugzilla to send bug change notifica‐
8568 tion emails. Substitutes from a map with 3 keys, bzdir, id (bug
8569 id) and user (committer bugzilla email). Default depends on ver‐
8570 sion; from 2.18 it is "cd %(bzdir)s && perl -T contrib/sendbug‐
8571 mail.pl %(id)s %(user)s".
8572
8573 Activating the extension:
8574
8575 [extensions]
8576 bugzilla =
8577
8578 [hooks]
8579 # run bugzilla hook on every change pulled or pushed in here
8580 incoming.bugzilla = python:hgext.bugzilla.hook
8581
8582 Example configurations:
8583
8584 XMLRPC example configuration. This uses the Bugzilla at
8585 http://my-project.org/bugzilla, logging in as user bug‐
8586 mail@my-project.org with password plugh. It is used with a collection
8587 of Mercurial repositories in /var/local/hg/repos/, with a web interface
8588 at http://my-project.org/hg.
8589
8590 [bugzilla]
8591 bzurl=http://my-project.org/bugzilla
8592 user=bugmail@my-project.org
8593 password=plugh
8594 version=xmlrpc
8595 template=Changeset {node|short} in {root|basename}.
8596 {hgweb}/{webroot}/rev/{node|short}\n
8597 {desc}\n
8598 strip=5
8599
8600 [web]
8601 baseurl=http://my-project.org/hg
8602
8603 XMLRPC+email example configuration. This uses the Bugzilla at
8604 http://my-project.org/bugzilla, logging in as user bug‐
8605 mail@my-project.org with password plugh. It is used with a collection
8606 of Mercurial repositories in /var/local/hg/repos/, with a web interface
8607 at http://my-project.org/hg. Bug comments are sent to the Bugzilla
8608 email address bugzilla@my-project.org.
8609
8610 [bugzilla]
8611 bzurl=http://my-project.org/bugzilla
8612 user=bugmail@my-project.org
8613 password=plugh
8614 version=xmlrpc+email
8615 bzemail=bugzilla@my-project.org
8616 template=Changeset {node|short} in {root|basename}.
8617 {hgweb}/{webroot}/rev/{node|short}\n
8618 {desc}\n
8619 strip=5
8620
8621 [web]
8622 baseurl=http://my-project.org/hg
8623
8624 [usermap]
8625 user@emaildomain.com=user.name@bugzilladomain.com
8626
8627 MySQL example configuration. This has a local Bugzilla 3.2 installation
8628 in /opt/bugzilla-3.2. The MySQL database is on localhost, the Bugzilla
8629 database name is bugs and MySQL is accessed with MySQL username bugs
8630 password XYZZY. It is used with a collection of Mercurial repositories
8631 in /var/local/hg/repos/, with a web interface at
8632 http://my-project.org/hg.
8633
8634 [bugzilla]
8635 host=localhost
8636 password=XYZZY
8637 version=3.0
8638 bzuser=unknown@domain.com
8639 bzdir=/opt/bugzilla-3.2
8640 template=Changeset {node|short} in {root|basename}.
8641 {hgweb}/{webroot}/rev/{node|short}\n
8642 {desc}\n
8643 strip=5
8644
8645 [web]
8646 baseurl=http://my-project.org/hg
8647
8648 [usermap]
8649 user@emaildomain.com=user.name@bugzilladomain.com
8650
8651 All the above add a comment to the Bugzilla bug record of the form:
8652
8653 Changeset 3b16791d6642 in repository-name.
8654 http://my-project.org/hg/repository-name/rev/3b16791d6642
8655
8656 Changeset commit comment. Bug 1234.
8657
8658 censor
8659 erase file content at a given revision
8660
8661 The censor command instructs Mercurial to erase all content of a file
8662 at a given revision without updating the changeset hash. This allows
8663 existing history to remain valid while preventing future clones/pulls
8664 from receiving the erased data.
8665
8666 Typical uses for censor are due to security or legal requirements, in‐
8667 cluding:
8668
8669 * Passwords, private keys, cryptographic material
8670 * Licensed data/code/libraries for which the license has expired
8671 * Personally Identifiable Information or other private data
8672
8673 Censored nodes can interrupt mercurial's typical operation whenever the
8674 excised data needs to be materialized. Some commands, like hg cat/hg
8675 revert, simply fail when asked to produce censored data. Others, like
8676 hg verify and hg update, must be capable of tolerating censored data to
8677 continue to function in a meaningful way. Such commands only tolerate
8678 censored file revisions if they are allowed by the "censor.policy=ig‐
8679 nore" config option.
8680
8681 A few informative commands such as hg grep will unconditionally ignore
8682 censored data and merely report that it was encountered.
8683
8684 Commands
8685 Repository maintenance
8686 censor
8687 hg censor -r REV [-t TEXT] [FILE]
8688
8689 Options:
8690
8691 -r,--rev <REV>
8692 censor file from specified revision
8693
8694 -t,--tombstone <TEXT>
8695 replacement tombstone data
8696
8697 children
8698 command to display child changesets (DEPRECATED)
8699
8700 This extension is deprecated. You should use hg log -r "children(REV)"
8701 instead.
8702
8703 Commands
8704 Change navigation
8705 children
8706 show the children of the given or working directory revision:
8707
8708 hg children [-r REV] [FILE]
8709
8710 Print the children of the working directory's revisions. If a revision
8711 is given via -r/--rev, the children of that revision will be printed.
8712 If a file argument is given, revision in which the file was last
8713 changed (after the working directory revision or the argument to --rev
8714 if given) is printed.
8715
8716 Please use hg log instead:
8717
8718 hg children => hg log -r "children(.)"
8719 hg children -r REV => hg log -r "children(REV)"
8720
8721 See hg help log and hg help revsets.children.
8722
8723 Options:
8724
8725 -r,--rev <REV>
8726 show children of the specified revision (default: .)
8727
8728 --style <STYLE>
8729 display using template map file (DEPRECATED)
8730
8731 -T,--template <TEMPLATE>
8732 display with template
8733
8734 churn
8735 command to display statistics about repository history
8736
8737 Commands
8738 Repository maintenance
8739 churn
8740 histogram of changes to the repository:
8741
8742 hg churn [-d DATE] [-r REV] [--aliases FILE] [FILE]
8743
8744 This command will display a histogram representing the number of
8745 changed lines or revisions, grouped according to the given template.
8746 The default template will group changes by author. The --dateformat
8747 option may be used to group the results by date instead.
8748
8749 Statistics are based on the number of changed lines, or alternatively
8750 the number of matching revisions if the --changesets option is speci‐
8751 fied.
8752
8753 Examples:
8754
8755 # display count of changed lines for every committer
8756 hg churn -T "{author|email}"
8757
8758 # display daily activity graph
8759 hg churn -f "%H" -s -c
8760
8761 # display activity of developers by month
8762 hg churn -f "%Y-%m" -s -c
8763
8764 # display count of lines changed in every year
8765 hg churn -f "%Y" -s
8766
8767 # display count of lines changed in a time range
8768 hg churn -d "2020-04 to 2020-09"
8769
8770 It is possible to map alternate email addresses to a main address by
8771 providing a file using the following format:
8772
8773 <alias email> = <actual email>
8774
8775 Such a file may be specified with the --aliases option, otherwise a
8776 .hgchurn file will be looked for in the working directory root.
8777 Aliases will be split from the rightmost "=".
8778
8779 Options:
8780
8781 -r,--rev <REV[+]>
8782 count rate for the specified revision or revset
8783
8784 -d,--date <DATE>
8785 count rate for revisions matching date spec
8786
8787 -t,--oldtemplate <TEMPLATE>
8788 template to group changesets (DEPRECATED)
8789
8790 -T,--template <TEMPLATE>
8791 template to group changesets (default: {author|email})
8792
8793 -f,--dateformat <FORMAT>
8794 strftime-compatible format for grouping by date
8795
8796 -c, --changesets
8797 count rate by number of changesets
8798
8799 -s, --sort
8800 sort by key (default: sort by count)
8801
8802 --diffstat
8803 display added/removed lines separately
8804
8805 --aliases <FILE>
8806 file with email aliases
8807
8808 -I,--include <PATTERN[+]>
8809 include names matching the given patterns
8810
8811 -X,--exclude <PATTERN[+]>
8812 exclude names matching the given patterns
8813
8814 [+] marked option can be specified multiple times
8815
8816 clonebundles
8817 advertise pre-generated bundles to seed clones
8818
8819 "clonebundles" is a server-side extension used to advertise the exis‐
8820 tence of pre-generated, externally hosted bundle files to clients that
8821 are cloning so that cloning can be faster, more reliable, and require
8822 less resources on the server. "pullbundles" is a related feature for
8823 sending pre-generated bundle files to clients as part of pull opera‐
8824 tions.
8825
8826 Cloning can be a CPU and I/O intensive operation on servers. Tradition‐
8827 ally, the server, in response to a client's request to clone, dynami‐
8828 cally generates a bundle containing the entire repository content and
8829 sends it to the client. There is no caching on the server and the
8830 server will have to redundantly generate the same outgoing bundle in
8831 response to each clone request. For servers with large repositories or
8832 with high clone volume, the load from clones can make scaling the
8833 server challenging and costly.
8834
8835 This extension provides server operators the ability to offload poten‐
8836 tially expensive clone load to an external service. Pre-generated bun‐
8837 dles also allow using more CPU intensive compression, reducing the ef‐
8838 fective bandwidth requirements.
8839
8840 Here's how clone bundles work:
8841
8842 1. A server operator establishes a mechanism for making bundle files
8843 available on a hosting service where Mercurial clients can fetch
8844 them.
8845
8846 2. A manifest file listing available bundle URLs and some optional
8847 metadata is added to the Mercurial repository on the server.
8848
8849 3. A client initiates a clone against a clone bundles aware server.
8850
8851 4. The client sees the server is advertising clone bundles and fetches
8852 the manifest listing available bundles.
8853
8854 5. The client filters and sorts the available bundles based on what it
8855 supports and prefers.
8856
8857 6. The client downloads and applies an available bundle from the
8858 server-specified URL.
8859
8860 7. The client reconnects to the original server and performs the equiv‐
8861 alent of hg pull to retrieve all repository data not in the bundle.
8862 (The repository could have been updated between when the bundle was
8863 created and when the client started the clone.) This may use "pull‐
8864 bundles".
8865
8866 Instead of the server generating full repository bundles for every
8867 clone request, it generates full bundles once and they are subsequently
8868 reused to bootstrap new clones. The server may still transfer data at
8869 clone time. However, this is only data that has been added/changed
8870 since the bundle was created. For large, established repositories, this
8871 can reduce server load for clones to less than 1% of original.
8872
8873 Here's how pullbundles work:
8874
8875 1. A manifest file listing available bundles and describing the revi‐
8876 sions is added to the Mercurial repository on the server.
8877
8878 2. A new-enough client informs the server that it supports partial
8879 pulls and initiates a pull.
8880
8881 3. If the server has pull bundles enabled and sees the client advertis‐
8882 ing partial pulls, it checks for a matching pull bundle in the mani‐
8883 fest. A bundle matches if the format is supported by the client,
8884 the client has the required revisions already and needs something
8885 from the bundle.
8886
8887 4. If there is at least one matching bundle, the server sends it to the
8888 client.
8889
8890 5. The client applies the bundle and notices that the server reply was
8891 incomplete. It initiates another pull.
8892
8893 To work, this extension requires the following of server operators:
8894
8895 • Generating bundle files of repository content (typically periodi‐
8896 cally, such as once per day).
8897
8898 • Clone bundles: A file server that clients have network access to and
8899 that Python knows how to talk to through its normal URL handling fa‐
8900 cility (typically an HTTP/HTTPS server).
8901
8902 • A process for keeping the bundles manifest in sync with available
8903 bundle files.
8904
8905 Strictly speaking, using a static file hosting server isn't required: a
8906 server operator could use a dynamic service for retrieving bundle data.
8907 However, static file hosting services are simple and scalable and
8908 should be sufficient for most needs.
8909
8910 Bundle files can be generated with the hg bundle command. Typically hg
8911 bundle --all is used to produce a bundle of the entire repository.
8912
8913 hg debugcreatestreamclonebundle can be used to produce a special
8914 streaming clonebundle. These are bundle files that are extremely effi‐
8915 cient to produce and consume (read: fast). However, they are larger
8916 than traditional bundle formats and require that clients support the
8917 exact set of repository data store formats in use by the repository
8918 that created them. Typically, a newer server can serve data that is
8919 compatible with older clients. However, streaming clone bundles don't
8920 have this guarantee. Server operators need to be aware that newer ver‐
8921 sions of Mercurial may produce streaming clone bundles incompatible
8922 with older Mercurial versions.
8923
8924 A server operator is responsible for creating a .hg/clonebundles.mani‐
8925 fest file containing the list of available bundle files suitable for
8926 seeding clones. If this file does not exist, the repository will not
8927 advertise the existence of clone bundles when clients connect. For pull
8928 bundles, .hg/pullbundles.manifest is used.
8929
8930 The manifest file contains a newline (n) delimited list of entries.
8931
8932 Each line in this file defines an available bundle. Lines have the for‐
8933 mat:
8934
8935 <URL> [<key>=<value>[ <key>=<value>]]
8936
8937 That is, a URL followed by an optional, space-delimited list of
8938 key=value pairs describing additional properties of this bundle. Both
8939 keys and values are URI encoded.
8940
8941 For pull bundles, the URL is a path under the .hg directory of the
8942 repository.
8943
8944 Keys in UPPERCASE are reserved for use by Mercurial and are defined be‐
8945 low. All non-uppercase keys can be used by site installations. An ex‐
8946 ample use for custom properties is to use the datacenter attribute to
8947 define which data center a file is hosted in. Clients could then prefer
8948 a server in the data center closest to them.
8949
8950 The following reserved keys are currently defined:
8951
8952 BUNDLESPEC
8953 A "bundle specification" string that describes the type of the
8954 bundle.
8955
8956 These are string values that are accepted by the "--type" argu‐
8957 ment of hg bundle.
8958
8959 The values are parsed in strict mode, which means they must be
8960 of the "<compression>-<type>" form. See mercurial.ex‐
8961 change.parsebundlespec() for more details.
8962
8963 hg debugbundle --spec can be used to print the bundle specifica‐
8964 tion string for a bundle file. The output of this command can be
8965 used verbatim for the value of BUNDLESPEC (it is already es‐
8966 caped).
8967
8968 Clients will automatically filter out specifications that are
8969 unknown or unsupported so they won't attempt to download some‐
8970 thing that likely won't apply.
8971
8972 The actual value doesn't impact client behavior beyond filter‐
8973 ing: clients will still sniff the bundle type from the header of
8974 downloaded files.
8975
8976 Use of this key is highly recommended, as it allows clients to
8977 easily skip unsupported bundles. If this key is not defined, an
8978 old client may attempt to apply a bundle that it is incapable of
8979 reading.
8980
8981 REQUIRESNI
8982 Whether Server Name Indication (SNI) is required to connect to
8983 the URL. SNI allows servers to use multiple certificates on the
8984 same IP. It is somewhat common in CDNs and other hosting
8985 providers. Older Python versions do not support SNI. Defining
8986 this attribute enables clients with older Python versions to
8987 filter this entry without experiencing an opaque SSL failure at
8988 connection time.
8989
8990 If this is defined, it is important to advertise a non-SNI fall‐
8991 back URL or clients running old Python releases may not be able
8992 to clone with the clonebundles facility.
8993
8994 Value should be "true".
8995
8996 REQUIREDRAM
8997 Value specifies expected memory requirements to decode the pay‐
8998 load. Values can have suffixes for common bytes sizes. e.g.
8999 "64MB".
9000
9001 This key is often used with zstd-compressed bundles using a high
9002 compression level / window size, which can require 100+ MB of
9003 memory to decode.
9004
9005 heads Used for pull bundles. This contains the ; separated changeset
9006 hashes of the heads of the bundle content.
9007
9008 bases Used for pull bundles. This contains the ; separated changeset
9009 hashes of the roots of the bundle content. This can be skipped
9010 if the bundle was created without --base.
9011
9012 Manifests can contain multiple entries. Assuming metadata is defined,
9013 clients will filter entries from the manifest that they don't support.
9014 The remaining entries are optionally sorted by client preferences
9015 (ui.clonebundleprefers config option). The client then attempts to
9016 fetch the bundle at the first URL in the remaining list.
9017
9018 Errors when downloading a bundle will fail the entire clone operation:
9019 clients do not automatically fall back to a traditional clone. The rea‐
9020 son for this is that if a server is using clone bundles, it is probably
9021 doing so because the feature is necessary to help it scale. In other
9022 words, there is an assumption that clone load will be offloaded to an‐
9023 other service and that the Mercurial server isn't responsible for serv‐
9024 ing this clone load. If that other service experiences issues and
9025 clients start mass falling back to the original Mercurial server, the
9026 added clone load could overwhelm the server due to unexpected load and
9027 effectively take it offline. Not having clients automatically fall back
9028 to cloning from the original server mitigates this scenario.
9029
9030 Because there is no automatic Mercurial server fallback on failure of
9031 the bundle hosting service, it is important for server operators to
9032 view the bundle hosting service as an extension of the Mercurial server
9033 in terms of availability and service level agreements: if the bundle
9034 hosting service goes down, so does the ability for clients to clone.
9035 Note: clients will see a message informing them how to bypass the clone
9036 bundles facility when a failure occurs. So server operators should pre‐
9037 pare for some people to follow these instructions when a failure oc‐
9038 curs, thus driving more load to the original Mercurial server when the
9039 bundle hosting service fails.
9040
9041 closehead
9042 close arbitrary heads without checking them out first
9043
9044 Commands
9045 Change manipulation
9046 close-head
9047 close the given head revisions:
9048
9049 hg close-head [OPTION]... [REV]...
9050
9051 This is equivalent to checking out each revision in a clean tree and
9052 running hg commit --close-branch, except that it doesn't change the
9053 working directory.
9054
9055 The commit message must be specified with -l or -m.
9056
9057 Options:
9058
9059 -m,--message <TEXT>
9060 use text as commit message
9061
9062 -l,--logfile <FILE>
9063 read commit message from file
9064
9065 -d,--date <DATE>
9066 record the specified date as commit date
9067
9068 -u,--user <USER>
9069 record the specified user as committer
9070
9071 -r,--rev <REV[+]>
9072 revision to check
9073
9074 [+] marked option can be specified multiple times
9075
9076 aliases: close-heads
9077
9078 commitextras
9079 adds a new flag extras to commit (ADVANCED)
9080
9081 convert
9082 import revisions from foreign VCS repositories into Mercurial
9083
9084 Commands
9085 Uncategorized commands
9086 convert
9087 convert a foreign SCM repository to a Mercurial one.:
9088
9089 hg convert [OPTION]... SOURCE [DEST [REVMAP]]
9090
9091 Accepted source formats [identifiers]:
9092
9093 • Mercurial [hg]
9094
9095 • CVS [cvs]
9096
9097 • Darcs [darcs]
9098
9099 • git [git]
9100
9101 • Subversion [svn]
9102
9103 • Monotone [mtn]
9104
9105 • GNU Arch [gnuarch]
9106
9107 • Bazaar [bzr]
9108
9109 • Perforce [p4]
9110
9111 Accepted destination formats [identifiers]:
9112
9113 • Mercurial [hg]
9114
9115 • Subversion [svn] (history on branches is not preserved)
9116
9117 If no revision is given, all revisions will be converted. Otherwise,
9118 convert will only import up to the named revision (given in a format
9119 understood by the source).
9120
9121 If no destination directory name is specified, it defaults to the base‐
9122 name of the source with -hg appended. If the destination repository
9123 doesn't exist, it will be created.
9124
9125 By default, all sources except Mercurial will use --branchsort. Mercu‐
9126 rial uses --sourcesort to preserve original revision numbers order.
9127 Sort modes have the following effects:
9128
9129 --branchsort
9130 convert from parent to child revision when possible, which means
9131 branches are usually converted one after the other. It generates
9132 more compact repositories.
9133
9134 --datesort
9135 sort revisions by date. Converted repositories have good-looking
9136 changelogs but are often an order of magnitude larger than the
9137 same ones generated by --branchsort.
9138
9139 --sourcesort
9140 try to preserve source revisions order, only supported by Mercu‐
9141 rial sources.
9142
9143 --closesort
9144 try to move closed revisions as close as possible to parent
9145 branches, only supported by Mercurial sources.
9146
9147 If REVMAP isn't given, it will be put in a default location
9148 (<dest>/.hg/shamap by default). The REVMAP is a simple text file that
9149 maps each source commit ID to the destination ID for that revision,
9150 like so:
9151
9152 <source ID> <destination ID>
9153
9154 If the file doesn't exist, it's automatically created. It's updated on
9155 each commit copied, so hg convert can be interrupted and can be run re‐
9156 peatedly to copy new commits.
9157
9158 The authormap is a simple text file that maps each source commit author
9159 to a destination commit author. It is handy for source SCMs that use
9160 unix logins to identify authors (e.g.: CVS). One line per author map‐
9161 ping and the line format is:
9162
9163 source author = destination author
9164
9165 Empty lines and lines starting with a # are ignored.
9166
9167 The filemap is a file that allows filtering and remapping of files and
9168 directories. Each line can contain one of the following directives:
9169
9170 include path/to/file-or-dir
9171
9172 exclude path/to/file-or-dir
9173
9174 rename path/to/source path/to/destination
9175
9176 Comment lines start with #. A specified path matches if it equals the
9177 full relative name of a file or one of its parent directories. The in‐
9178 clude or exclude directive with the longest matching path applies, so
9179 line order does not matter.
9180
9181 The include directive causes a file, or all files under a directory, to
9182 be included in the destination repository. The default if there are no
9183 include statements is to include everything. If there are any include
9184 statements, nothing else is included. The exclude directive causes
9185 files or directories to be omitted. The rename directive renames a file
9186 or directory if it is converted. To rename from a subdirectory into the
9187 root of the repository, use . as the path to rename to.
9188
9189 --full will make sure the converted changesets contain exactly the
9190 right files with the right content. It will make a full conversion of
9191 all files, not just the ones that have changed. Files that already are
9192 correct will not be changed. This can be used to apply filemap changes
9193 when converting incrementally. This is currently only supported for
9194 Mercurial and Subversion.
9195
9196 The splicemap is a file that allows insertion of synthetic history,
9197 letting you specify the parents of a revision. This is useful if you
9198 want to e.g. give a Subversion merge two parents, or graft two discon‐
9199 nected series of history together. Each entry contains a key, followed
9200 by a space, followed by one or two comma-separated values:
9201
9202 key parent1, parent2
9203
9204 The key is the revision ID in the source revision control system whose
9205 parents should be modified (same format as a key in .hg/shamap). The
9206 values are the revision IDs (in either the source or destination revi‐
9207 sion control system) that should be used as the new parents for that
9208 node. For example, if you have merged "release-1.0" into "trunk", then
9209 you should specify the revision on "trunk" as the first parent and the
9210 one on the "release-1.0" branch as the second.
9211
9212 The branchmap is a file that allows you to rename a branch when it is
9213 being brought in from whatever external repository. When used in con‐
9214 junction with a splicemap, it allows for a powerful combination to help
9215 fix even the most badly mismanaged repositories and turn them into
9216 nicely structured Mercurial repositories. The branchmap contains lines
9217 of the form:
9218
9219 original_branch_name new_branch_name
9220
9221 where "original_branch_name" is the name of the branch in the source
9222 repository, and "new_branch_name" is the name of the branch is the des‐
9223 tination repository. No whitespace is allowed in the new branch name.
9224 This can be used to (for instance) move code in one repository from
9225 "default" to a named branch.
9226
9227 Mercurial Source
9228 The Mercurial source recognizes the following configuration options,
9229 which you can set on the command line with --config:
9230
9231 convert.hg.ignoreerrors
9232 ignore integrity errors when reading. Use it to fix Mercurial
9233 repositories with missing revlogs, by converting from and to
9234 Mercurial. Default is False.
9235
9236 convert.hg.saverev
9237 store original revision ID in changeset (forces target IDs to
9238 change). It takes a boolean argument and defaults to False.
9239
9240 convert.hg.startrev
9241 specify the initial Mercurial revision. The default is 0.
9242
9243 convert.hg.revs
9244 revset specifying the source revisions to convert.
9245
9246 Bazaar Source
9247 The following options can be used with --config:
9248
9249 convert.bzr.saverev
9250 whether to store the original Bazaar commit ID in the metadata
9251 of the destination commit. The default is True.
9252
9253 CVS Source
9254 CVS source will use a sandbox (i.e. a checked-out copy) from CVS to in‐
9255 dicate the starting point of what will be converted. Direct access to
9256 the repository files is not needed, unless of course the repository is
9257 :local:. The conversion uses the top level directory in the sandbox to
9258 find the CVS repository, and then uses CVS rlog commands to find files
9259 to convert. This means that unless a filemap is given, all files under
9260 the starting directory will be converted, and that any directory reor‐
9261 ganization in the CVS sandbox is ignored.
9262
9263 The following options can be used with --config:
9264
9265 convert.cvsps.cache
9266 Set to False to disable remote log caching, for testing and de‐
9267 bugging purposes. Default is True.
9268
9269 convert.cvsps.fuzz
9270 Specify the maximum time (in seconds) that is allowed between
9271 commits with identical user and log message in a single change‐
9272 set. When very large files were checked in as part of a change‐
9273 set then the default may not be long enough. The default is 60.
9274
9275 convert.cvsps.logencoding
9276 Specify encoding name to be used for transcoding CVS log mes‐
9277 sages. Multiple encoding names can be specified as a list (see
9278 hg help config.Syntax), but only the first acceptable encoding
9279 in the list is used per CVS log entries. This transcoding is ex‐
9280 ecuted before cvslog hook below.
9281
9282 convert.cvsps.mergeto
9283 Specify a regular expression to which commit log messages are
9284 matched. If a match occurs, then the conversion process will in‐
9285 sert a dummy revision merging the branch on which this log mes‐
9286 sage occurs to the branch indicated in the regex. Default is
9287 {{mergetobranch ([-\w]+)}}
9288
9289 convert.cvsps.mergefrom
9290 Specify a regular expression to which commit log messages are
9291 matched. If a match occurs, then the conversion process will add
9292 the most recent revision on the branch indicated in the regex as
9293 the second parent of the changeset. Default is {{mergefrombranch
9294 ([-\w]+)}}
9295
9296 convert.localtimezone
9297 use local time (as determined by the TZ environment variable)
9298 for changeset date/times. The default is False (use UTC).
9299
9300 hooks.cvslog
9301 Specify a Python function to be called at the end of gathering
9302 the CVS log. The function is passed a list with the log entries,
9303 and can modify the entries in-place, or add or delete them.
9304
9305 hooks.cvschangesets
9306 Specify a Python function to be called after the changesets are
9307 calculated from the CVS log. The function is passed a list with
9308 the changeset entries, and can modify the changesets in-place,
9309 or add or delete them.
9310
9311 An additional "debugcvsps" Mercurial command allows the builtin change‐
9312 set merging code to be run without doing a conversion. Its parameters
9313 and output are similar to that of cvsps 2.1. Please see the command
9314 help for more details.
9315
9316 Subversion Source
9317 Subversion source detects classical trunk/branches/tags layouts. By
9318 default, the supplied svn://repo/path/ source URL is converted as a
9319 single branch. If svn://repo/path/trunk exists it replaces the default
9320 branch. If svn://repo/path/branches exists, its subdirectories are
9321 listed as possible branches. If svn://repo/path/tags exists, it is
9322 looked for tags referencing converted branches. Default trunk, branches
9323 and tags values can be overridden with following options. Set them to
9324 paths relative to the source URL, or leave them blank to disable auto
9325 detection.
9326
9327 The following options can be set with --config:
9328
9329 convert.svn.branches
9330 specify the directory containing branches. The default is
9331 branches.
9332
9333 convert.svn.tags
9334 specify the directory containing tags. The default is tags.
9335
9336 convert.svn.trunk
9337 specify the name of the trunk branch. The default is trunk.
9338
9339 convert.localtimezone
9340 use local time (as determined by the TZ environment variable)
9341 for changeset date/times. The default is False (use UTC).
9342
9343 Source history can be retrieved starting at a specific revision, in‐
9344 stead of being integrally converted. Only single branch conversions are
9345 supported.
9346
9347 convert.svn.startrev
9348 specify start Subversion revision number. The default is 0.
9349
9350 Git Source
9351 The Git importer converts commits from all reachable branches (refs in
9352 refs/heads) and remotes (refs in refs/remotes) to Mercurial. Branches
9353 are converted to bookmarks with the same name, with the leading
9354 'refs/heads' stripped. Git submodules are converted to Git subrepos in
9355 Mercurial.
9356
9357 The following options can be set with --config:
9358
9359 convert.git.similarity
9360 specify how similar files modified in a commit must be to be im‐
9361 ported as renames or copies, as a percentage between 0 (dis‐
9362 abled) and 100 (files must be identical). For example, 90 means
9363 that a delete/add pair will be imported as a rename if more than
9364 90% of the file hasn't changed. The default is 50.
9365
9366 convert.git.findcopiesharder
9367 while detecting copies, look at all files in the working copy
9368 instead of just changed ones. This is very expensive for large
9369 projects, and is only effective when convert.git.similarity is
9370 greater than 0. The default is False.
9371
9372 convert.git.renamelimit
9373 perform rename and copy detection up to this many changed files
9374 in a commit. Increasing this will make rename and copy detection
9375 more accurate but will significantly slow down computation on
9376 large projects. The option is only relevant if convert.git.simi‐
9377 larity is greater than 0. The default is 400.
9378
9379 convert.git.committeractions
9380 list of actions to take when processing author and committer
9381 values.
9382
9383 Git commits have separate author (who wrote the commit) and com‐
9384 mitter (who applied the commit) fields. Not all destinations
9385 support separate author and committer fields (including Mercu‐
9386 rial). This config option controls what to do with these author
9387 and committer fields during conversion.
9388
9389 A value of messagedifferent will append a committer: ... line
9390 to the commit message if the Git committer is different from the
9391 author. The prefix of that line can be specified using the syn‐
9392 tax messagedifferent=<prefix>. e.g. messagedifferent=git-commit‐
9393 ter:. When a prefix is specified, a space will always be in‐
9394 serted between the prefix and the value.
9395
9396 messagealways behaves like messagedifferent except it will al‐
9397 ways result in a committer: ... line being appended to the com‐
9398 mit message. This value is mutually exclusive with messagedif‐
9399 ferent.
9400
9401 dropcommitter will remove references to the committer. Only ref‐
9402 erences to the author will remain. Actions that add references
9403 to the committer will have no effect when this is set.
9404
9405 replaceauthor will replace the value of the author field with
9406 the committer. Other actions that add references to the commit‐
9407 ter will still take effect when this is set.
9408
9409 The default is messagedifferent.
9410
9411 convert.git.extrakeys
9412 list of extra keys from commit metadata to copy to the destina‐
9413 tion. Some Git repositories store extra metadata in commits. By
9414 default, this non-default metadata will be lost during conver‐
9415 sion. Setting this config option can retain that metadata. Some
9416 built-in keys such as parent and branch are not allowed to be
9417 copied.
9418
9419 convert.git.remoteprefix
9420 remote refs are converted as bookmarks with convert.git.re‐
9421 moteprefix as a prefix followed by a /. The default is 'remote'.
9422
9423 convert.git.saverev
9424 whether to store the original Git commit ID in the metadata of
9425 the destination commit. The default is True.
9426
9427 convert.git.skipsubmodules
9428 does not convert root level .gitmodules files or files with
9429 160000 mode indicating a submodule. Default is False.
9430
9431 Perforce Source
9432 The Perforce (P4) importer can be given a p4 depot path or a client
9433 specification as source. It will convert all files in the source to a
9434 flat Mercurial repository, ignoring labels, branches and integrations.
9435 Note that when a depot path is given you then usually should specify a
9436 target directory, because otherwise the target may be named ...-hg.
9437
9438 The following options can be set with --config:
9439
9440 convert.p4.encoding
9441 specify the encoding to use when decoding standard output of the
9442 Perforce command line tool. The default is default system encod‐
9443 ing.
9444
9445 convert.p4.startrev
9446 specify initial Perforce revision (a Perforce changelist num‐
9447 ber).
9448
9449 Mercurial Destination
9450 The Mercurial destination will recognize Mercurial subrepositories in
9451 the destination directory, and update the .hgsubstate file automati‐
9452 cally if the destination subrepositories contain the
9453 <dest>/<sub>/.hg/shamap file. Converting a repository with subreposi‐
9454 tories requires converting a single repository at a time, from the bot‐
9455 tom up.
9456
9457 An example showing how to convert a repository with subrepositories:
9458
9459 # so convert knows the type when it sees a non empty destination
9460 $ hg init converted
9461
9462 $ hg convert orig/sub1 converted/sub1
9463 $ hg convert orig/sub2 converted/sub2
9464 $ hg convert orig converted
9465
9466 The following options are supported:
9467
9468 convert.hg.clonebranches
9469 dispatch source branches in separate clones. The default is
9470 False.
9471
9472 convert.hg.tagsbranch
9473 branch name for tag revisions, defaults to default.
9474
9475 convert.hg.usebranchnames
9476 preserve branch names. The default is True.
9477
9478 convert.hg.sourcename
9479 records the given string as a 'convert_source' extra value on
9480 each commit made in the target repository. The default is None.
9481
9482 convert.hg.preserve-hash
9483 only works with mercurial sources. Make convert prevent perfor‐
9484 mance improvement to the list of modified files in commits when
9485 such an improvement would cause the hash of a commit to change.
9486 The default is False.
9487
9488 All Destinations
9489 All destination types accept the following options:
9490
9491 convert.skiptags
9492 does not convert tags from the source repo to the target repo.
9493 The default is False.
9494
9495 Options:
9496
9497 --authors <FILE>
9498 username mapping filename (DEPRECATED) (use --authormap instead)
9499
9500 -s,--source-type <TYPE>
9501 source repository type
9502
9503 -d,--dest-type <TYPE>
9504 destination repository type
9505
9506 -r,--rev <REV[+]>
9507 import up to source revision REV
9508
9509 -A,--authormap <FILE>
9510 remap usernames using this file
9511
9512 --filemap <FILE>
9513 remap file names using contents of file
9514
9515 --full apply filemap changes by converting all files again
9516
9517 --splicemap <FILE>
9518 splice synthesized history into place
9519
9520 --branchmap <FILE>
9521 change branch names while converting
9522
9523 --branchsort
9524 try to sort changesets by branches
9525
9526 --datesort
9527 try to sort changesets by date
9528
9529 --sourcesort
9530 preserve source changesets order
9531
9532 --closesort
9533 try to reorder closed revisions
9534
9535 [+] marked option can be specified multiple times
9536
9537 eol
9538 automatically manage newlines in repository files
9539
9540 This extension allows you to manage the type of line endings (CRLF or
9541 LF) that are used in the repository and in the local working directory.
9542 That way you can get CRLF line endings on Windows and LF on Unix/Mac,
9543 thereby letting everybody use their OS native line endings.
9544
9545 The extension reads its configuration from a versioned .hgeol configu‐
9546 ration file found in the root of the working directory. The .hgeol file
9547 use the same syntax as all other Mercurial configuration files. It uses
9548 two sections, [patterns] and [repository].
9549
9550 The [patterns] section specifies how line endings should be converted
9551 between the working directory and the repository. The format is speci‐
9552 fied by a file pattern. The first match is used, so put more specific
9553 patterns first. The available line endings are LF, CRLF, and BIN.
9554
9555 Files with the declared format of CRLF or LF are always checked out and
9556 stored in the repository in that format and files declared to be binary
9557 (BIN) are left unchanged. Additionally, native is an alias for checking
9558 out in the platform's default line ending: LF on Unix (including Mac OS
9559 X) and CRLF on Windows. Note that BIN (do nothing to line endings) is
9560 Mercurial's default behavior; it is only needed if you need to override
9561 a later, more general pattern.
9562
9563 The optional [repository] section specifies the line endings to use for
9564 files stored in the repository. It has a single setting, native, which
9565 determines the storage line endings for files declared as native in the
9566 [patterns] section. It can be set to LF or CRLF. The default is LF. For
9567 example, this means that on Windows, files configured as native (CRLF
9568 by default) will be converted to LF when stored in the repository.
9569 Files declared as LF, CRLF, or BIN in the [patterns] section are always
9570 stored as-is in the repository.
9571
9572 Example versioned .hgeol file:
9573
9574 [patterns]
9575 **.py = native
9576 **.vcproj = CRLF
9577 **.txt = native
9578 Makefile = LF
9579 **.jpg = BIN
9580
9581 [repository]
9582 native = LF
9583
9584 Note The rules will first apply when files are touched in the working
9585 directory, e.g. by updating to null and back to tip to touch all
9586 files.
9587
9588 The extension uses an optional [eol] section read from both the normal
9589 Mercurial configuration files and the .hgeol file, with the latter
9590 overriding the former. You can use that section to control the overall
9591 behavior. There are three settings:
9592
9593 • eol.native (default os.linesep) can be set to LF or CRLF to override
9594 the default interpretation of native for checkout. This can be used
9595 with hg archive on Unix, say, to generate an archive where files have
9596 line endings for Windows.
9597
9598 • eol.only-consistent (default True) can be set to False to make the
9599 extension convert files with inconsistent EOLs. Inconsistent means
9600 that there is both CRLF and LF present in the file. Such files are
9601 normally not touched under the assumption that they have mixed EOLs
9602 on purpose.
9603
9604 • eol.fix-trailing-newline (default False) can be set to True to ensure
9605 that converted files end with a EOL character (either \n or \r\n as
9606 per the configured patterns).
9607
9608 The extension provides cleverencode: and cleverdecode: filters like the
9609 deprecated win32text extension does. This means that you can disable
9610 win32text and enable eol and your filters will still work. You only
9611 need to these filters until you have prepared a .hgeol file.
9612
9613 The win32text.forbid* hooks provided by the win32text extension have
9614 been unified into a single hook named eol.checkheadshook. The hook will
9615 lookup the expected line endings from the .hgeol file, which means you
9616 must migrate to a .hgeol file first before using the hook. eol.check‐
9617 headshook only checks heads, intermediate invalid revisions will be
9618 pushed. To forbid them completely, use the eol.checkallhook hook. These
9619 hooks are best used as pretxnchangegroup hooks.
9620
9621 See hg help patterns for more information about the glob patterns used.
9622
9623 extdiff
9624 command to allow external programs to compare revisions
9625
9626 The extdiff Mercurial extension allows you to use external programs to
9627 compare revisions, or revision with working directory. The external
9628 diff programs are called with a configurable set of options and two
9629 non-option arguments: paths to directories containing snapshots of
9630 files to compare.
9631
9632 If there is more than one file being compared and the "child" revision
9633 is the working directory, any modifications made in the external diff
9634 program will be copied back to the working directory from the temporary
9635 directory.
9636
9637 The extdiff extension also allows you to configure new diff commands,
9638 so you do not need to type hg extdiff -p kdiff3 always.
9639
9640 [extdiff]
9641 # add new command that runs GNU diff(1) in 'context diff' mode
9642 cdiff = gdiff -Nprc5
9643 ## or the old way:
9644 #cmd.cdiff = gdiff
9645 #opts.cdiff = -Nprc5
9646
9647 # add new command called meld, runs meld (no need to name twice). If
9648 # the meld executable is not available, the meld tool in [merge-tools]
9649 # will be used, if available
9650 meld =
9651
9652 # add new command called vimdiff, runs gvimdiff with DirDiff plugin
9653 # (see http://www.vim.org/scripts/script.php?script_id=102) Non
9654 # English user, be sure to put "let g:DirDiffDynamicDiffText = 1" in
9655 # your .vimrc
9656 vimdiff = gvim -f "+next" \
9657 "+execute 'DirDiff' fnameescape(argv(0)) fnameescape(argv(1))"
9658
9659 Tool arguments can include variables that are expanded at runtime:
9660
9661 $parent1, $plabel1 - filename, descriptive label of first parent
9662 $child, $clabel - filename, descriptive label of child revision
9663 $parent2, $plabel2 - filename, descriptive label of second parent
9664 $root - repository root
9665 $parent is an alias for $parent1.
9666
9667 The extdiff extension will look in your [diff-tools] and [merge-tools]
9668 sections for diff tool arguments, when none are specified in [extdiff].
9669
9670 [extdiff]
9671 kdiff3 =
9672
9673 [diff-tools]
9674 kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child
9675
9676 If a program has a graphical interface, it might be interesting to tell
9677 Mercurial about it. It will prevent the program from being mistakenly
9678 used in a terminal-only environment (such as an SSH terminal session),
9679 and will make hg extdiff --per-file open multiple file diffs at once
9680 instead of one by one (if you still want to open file diffs one by one,
9681 you can use the --confirm option).
9682
9683 Declaring that a tool has a graphical interface can be done with the
9684 gui flag next to where diffargs are specified:
9685
9686 [diff-tools]
9687 kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child
9688 kdiff3.gui = true
9689
9690 You can use -I/-X and list of file or directory names like normal hg
9691 diff command. The extdiff extension makes snapshots of only needed
9692 files, so running the external diff program will actually be pretty
9693 fast (at least faster than having to compare the entire tree).
9694
9695 Commands
9696 File content management
9697 extdiff
9698 use external program to diff repository (or selected files):
9699
9700 hg extdiff [OPT]... [FILE]...
9701
9702 Show differences between revisions for the specified files, using an
9703 external program. The default program used is diff, with default op‐
9704 tions "-Npru".
9705
9706 To select a different program, use the -p/--program option. The program
9707 will be passed the names of two directories to compare, unless the
9708 --per-file option is specified (see below). To pass additional options
9709 to the program, use -o/--option. These will be passed before the names
9710 of the directories or files to compare.
9711
9712 The --from, --to, and --change options work the same way they do for hg
9713 diff.
9714
9715 The --per-file option runs the external program repeatedly on each file
9716 to diff, instead of once on two directories. By default, this happens
9717 one by one, where the next file diff is open in the external program
9718 only once the previous external program (for the previous file diff)
9719 has exited. If the external program has a graphical interface, it can
9720 open all the file diffs at once instead of one by one. See hg help -e
9721 extdiff for information about how to tell Mercurial that a given pro‐
9722 gram has a graphical interface.
9723
9724 The --confirm option will prompt the user before each invocation of the
9725 external program. It is ignored if --per-file isn't specified.
9726
9727 Options:
9728
9729 -p,--program <CMD>
9730 comparison program to run
9731
9732 -o,--option <OPT[+]>
9733 pass option to comparison program
9734
9735 -r,--rev <REV[+]>
9736 revision (DEPRECATED)
9737
9738 --from <REV1>
9739 revision to diff from
9740
9741 --to <REV2>
9742 revision to diff to
9743
9744 -c,--change <REV>
9745 change made by revision
9746
9747 --per-file
9748 compare each file instead of revision snapshots
9749
9750 --confirm
9751 prompt user before each external program invocation
9752
9753 --patch
9754 compare patches for two revisions
9755
9756 -I,--include <PATTERN[+]>
9757 include names matching the given patterns
9758
9759 -X,--exclude <PATTERN[+]>
9760 exclude names matching the given patterns
9761
9762 -S, --subrepos
9763 recurse into subrepositories
9764
9765 [+] marked option can be specified multiple times
9766
9767 factotum
9768 http authentication with factotum
9769
9770 This extension allows the factotum(4) facility on Plan 9 from Bell Labs
9771 platforms to provide authentication information for HTTP access. Con‐
9772 figuration entries specified in the auth section as well as authentica‐
9773 tion information provided in the repository URL are fully supported. If
9774 no prefix is specified, a value of "*" will be assumed.
9775
9776 By default, keys are specified as:
9777
9778 proto=pass service=hg prefix=<prefix> user=<username> !password=<password>
9779
9780 If the factotum extension is unable to read the required key, one will
9781 be requested interactively.
9782
9783 A configuration section is available to customize runtime behavior. By
9784 default, these entries are:
9785
9786 [factotum]
9787 executable = /bin/auth/factotum
9788 mountpoint = /mnt/factotum
9789 service = hg
9790
9791 The executable entry defines the full path to the factotum binary. The
9792 mountpoint entry defines the path to the factotum file service. Lastly,
9793 the service entry controls the service name used when reading keys.
9794
9795 fastannotate
9796 yet another annotate implementation that might be faster (EXPERIMENTAL)
9797
9798 The fastannotate extension provides a 'fastannotate' command that makes
9799 use of the linelog data structure as a cache layer and is expected to
9800 be faster than the vanilla 'annotate' if the cache is present.
9801
9802 In most cases, fastannotate requires a setup that mainbranch is some
9803 pointer that always moves forward, to be most efficient.
9804
9805 Using fastannotate together with linkrevcache would speed up building
9806 the annotate cache greatly. Run "debugbuildlinkrevcache" before "debug‐
9807 buildannotatecache".
9808
9809 [fastannotate]
9810 # specify the main branch head. the internal linelog will only contain
9811 # the linear (ignoring p2) "mainbranch". since linelog cannot move
9812 # backwards without a rebuild, this should be something that always moves
9813 # forward, usually it is "master" or "@".
9814 mainbranch = master
9815
9816 # fastannotate supports different modes to expose its feature.
9817 # a list of combination:
9818 # - fastannotate: expose the feature via the "fastannotate" command which
9819 # deals with everything in a most efficient way, and provides extra
9820 # features like --deleted etc.
9821 # - fctx: replace fctx.annotate implementation. note:
9822 # a. it is less efficient than the "fastannotate" command
9823 # b. it will make it practically impossible to access the old (disk
9824 # side-effect free) annotate implementation
9825 # c. it implies "hgweb".
9826 # - hgweb: replace hgweb's annotate implementation. conflict with "fctx".
9827 # (default: fastannotate)
9828 modes = fastannotate
9829
9830 # default format when no format flags are used (default: number)
9831 defaultformat = changeset, user, date
9832
9833 # serve the annotate cache via wire protocol (default: False)
9834 # tip: the .hg/fastannotate directory is portable - can be rsynced
9835 server = True
9836
9837 # build annotate cache on demand for every client request (default: True)
9838 # disabling it could make server response faster, useful when there is a
9839 # cronjob building the cache.
9840 serverbuildondemand = True
9841
9842 # update local annotate cache from remote on demand
9843 client = False
9844
9845 # path to use when connecting to the remote server (default: default)
9846 remotepath = default
9847
9848 # minimal length of the history of a file required to fetch linelog from
9849 # the server. (default: 10)
9850 clientfetchthreshold = 10
9851
9852 # for "fctx" mode, always follow renames regardless of command line option.
9853 # this is a BC with the original command but will reduced the space needed
9854 # for annotate cache, and is useful for client-server setup since the
9855 # server will only provide annotate cache with default options (i.e. with
9856 # follow). do not affect "fastannotate" mode. (default: True)
9857 forcefollow = True
9858
9859 # for "fctx" mode, always treat file as text files, to skip the "isbinary"
9860 # check. this is consistent with the "fastannotate" command and could help
9861 # to avoid a file fetch if remotefilelog is used. (default: True)
9862 forcetext = True
9863
9864 # use unfiltered repo for better performance.
9865 unfilteredrepo = True
9866
9867 # sacrifice correctness in some corner cases for performance. it does not
9868 # affect the correctness of the annotate cache being built. the option
9869 # is experimental and may disappear in the future (default: False)
9870 perfhack = True
9871
9872 Commands
9873 Uncategorized commands
9874 fastexport
9875 export repositories as git fast-import stream
9876
9877 Commands
9878 Change import/export
9879 fastexport
9880 export repository as git fast-import stream:
9881
9882 hg fastexport [OPTION]... [REV]...
9883
9884 This command lets you dump a repository as a human-readable text
9885 stream. It can be piped into corresponding import routines like "git
9886 fast-import". Incremental dumps can be created by using marks files.
9887
9888 Options:
9889
9890 -r,--rev <REV[+]>
9891 revisions to export
9892
9893 -i,--import-marks <FILE>
9894 old marks file to read
9895
9896 -e,--export-marks <FILE>
9897 new marks file to write
9898
9899 -A,--authormap <FILE>
9900 remap usernames using this file
9901
9902 [+] marked option can be specified multiple times
9903
9904 fetch
9905 pull, update and merge in one command (DEPRECATED)
9906
9907 Commands
9908 Remote repository management
9909 fetch
9910 pull changes from a remote repository, merge new changes if needed.:
9911
9912 hg fetch [SOURCE]
9913
9914 This finds all changes from the repository at the specified path or URL
9915 and adds them to the local repository.
9916
9917 If the pulled changes add a new branch head, the head is automatically
9918 merged, and the result of the merge is committed. Otherwise, the work‐
9919 ing directory is updated to include the new changes.
9920
9921 When a merge is needed, the working directory is first updated to the
9922 newly pulled changes. Local changes are then merged into the pulled
9923 changes. To switch the merge order, use --switch-parent.
9924
9925 See hg help dates for a list of formats valid for -d/--date.
9926
9927 Returns 0 on success.
9928
9929 Options:
9930
9931 -r,--rev <REV[+]>
9932 a specific revision you would like to pull
9933
9934 --edit invoke editor on commit messages
9935
9936 --force-editor
9937 edit commit message (DEPRECATED)
9938
9939 --switch-parent
9940 switch parents when merging
9941
9942 -m,--message <TEXT>
9943 use text as commit message
9944
9945 -l,--logfile <FILE>
9946 read commit message from file
9947
9948 -d,--date <DATE>
9949 record the specified date as commit date
9950
9951 -u,--user <USER>
9952 record the specified user as committer
9953
9954 -e,--ssh <CMD>
9955 specify ssh command to use
9956
9957 --remotecmd <CMD>
9958 specify hg command to run on the remote side
9959
9960 --insecure
9961 do not verify server certificate (ignoring web.cacerts config)
9962
9963 [+] marked option can be specified multiple times
9964
9965 fix
9966 rewrite file content in changesets or working copy (EXPERIMENTAL)
9967
9968 Provides a command that runs configured tools on the contents of modi‐
9969 fied files, writing back any fixes to the working copy or replacing
9970 changesets.
9971
9972 Here is an example configuration that causes hg fix to apply automatic
9973 formatting fixes to modified lines in C++ code:
9974
9975 [fix]
9976 clang-format:command=clang-format --assume-filename={rootpath}
9977 clang-format:linerange=--lines={first}:{last}
9978 clang-format:pattern=set:**.cpp or **.hpp
9979
9980 The :command suboption forms the first part of the shell command that
9981 will be used to fix a file. The content of the file is passed on stan‐
9982 dard input, and the fixed file content is expected on standard output.
9983 Any output on standard error will be displayed as a warning. If the
9984 exit status is not zero, the file will not be affected. A placeholder
9985 warning is displayed if there is a non-zero exit status but no standard
9986 error output. Some values may be substituted into the command:
9987
9988 {rootpath} The path of the file being fixed, relative to the repo root
9989 {basename} The name of the file being fixed, without the directory path
9990
9991 If the :linerange suboption is set, the tool will only be run if there
9992 are changed lines in a file. The value of this suboption is appended to
9993 the shell command once for every range of changed lines in the file.
9994 Some values may be substituted into the command:
9995
9996 {first} The 1-based line number of the first line in the modified range
9997 {last} The 1-based line number of the last line in the modified range
9998
9999 Deleted sections of a file will be ignored by :linerange, because there
10000 is no corresponding line range in the version being fixed.
10001
10002 By default, tools that set :linerange will only be executed if there is
10003 at least one changed line range. This is meant to prevent accidents
10004 like running a code formatter in such a way that it unexpectedly refor‐
10005 mats the whole file. If such a tool needs to operate on unchanged
10006 files, it should set the :skipclean suboption to false.
10007
10008 The :pattern suboption determines which files will be passed through
10009 each configured tool. See hg help patterns for possible values. How‐
10010 ever, all patterns are relative to the repo root, even if that text
10011 says they are relative to the current working directory. If there are
10012 file arguments to hg fix, the intersection of these patterns is used.
10013
10014 There is also a configurable limit for the maximum size of file that
10015 will be processed by hg fix:
10016
10017 [fix]
10018 maxfilesize = 2MB
10019
10020 Normally, execution of configured tools will continue after a failure
10021 (indicated by a non-zero exit status). It can also be configured to
10022 abort after the first such failure, so that no files will be affected
10023 if any tool fails. This abort will also cause hg fix to exit with a
10024 non-zero status:
10025
10026 [fix]
10027 failure = abort
10028
10029 When multiple tools are configured to affect a file, they execute in an
10030 order defined by the :priority suboption. The priority suboption has a
10031 default value of zero for each tool. Tools are executed in order of de‐
10032 scending priority. The execution order of tools with equal priority is
10033 unspecified. For example, you could use the 'sort' and 'head' utilities
10034 to keep only the 10 smallest numbers in a text file by ensuring that
10035 'sort' runs before 'head':
10036
10037 [fix]
10038 sort:command = sort -n
10039 head:command = head -n 10
10040 sort:pattern = numbers.txt
10041 head:pattern = numbers.txt
10042 sort:priority = 2
10043 head:priority = 1
10044
10045 To account for changes made by each tool, the line numbers used for in‐
10046 cremental formatting are recomputed before executing the next tool. So,
10047 each tool may see different values for the arguments added by the :lin‐
10048 erange suboption.
10049
10050 Each fixer tool is allowed to return some metadata in addition to the
10051 fixed file content. The metadata must be placed before the file content
10052 on stdout, separated from the file content by a zero byte. The metadata
10053 is parsed as a JSON value (so, it should be UTF-8 encoded and contain
10054 no zero bytes). A fixer tool is expected to produce this metadata en‐
10055 coding if and only if the :metadata suboption is true:
10056
10057 [fix]
10058 tool:command = tool --prepend-json-metadata
10059 tool:metadata = true
10060
10061 The metadata values are passed to hooks, which can be used to print
10062 summaries or perform other post-fixing work. The supported hooks are:
10063
10064 "postfixfile"
10065 Run once for each file in each revision where any fixer tools made changes
10066 to the file content. Provides "$HG_REV" and "$HG_PATH" to identify the file,
10067 and "$HG_METADATA" with a map of fixer names to metadata values from fixer
10068 tools that affected the file. Fixer tools that didn't affect the file have a
10069 value of None. Only fixer tools that executed are present in the metadata.
10070
10071 "postfix"
10072 Run once after all files and revisions have been handled. Provides
10073 "$HG_REPLACEMENTS" with information about what revisions were created and
10074 made obsolete. Provides a boolean "$HG_WDIRWRITTEN" to indicate whether any
10075 files in the working copy were updated. Provides a list "$HG_METADATA"
10076 mapping fixer tool names to lists of metadata values returned from
10077 executions that modified a file. This aggregates the same metadata
10078 previously passed to the "postfixfile" hook.
10079
10080 Fixer tools are run in the repository's root directory. This allows
10081 them to read configuration files from the working copy, or even write
10082 to the working copy. The working copy is not updated to match the re‐
10083 vision being fixed. In fact, several revisions may be fixed in paral‐
10084 lel. Writes to the working copy are not amended into the revision being
10085 fixed; fixer tools should always write fixed file content back to std‐
10086 out as documented above.
10087
10088 Commands
10089 File content management
10090 fix
10091 rewrite file content in changesets or working directory:
10092
10093 hg fix [OPTION]... [FILE]...
10094
10095 Runs any configured tools to fix the content of files. Only affects
10096 files with changes, unless file arguments are provided. Only affects
10097 changed lines of files, unless the --whole flag is used. Some tools may
10098 always affect the whole file regardless of --whole.
10099
10100 If --working-dir is used, files with uncommitted changes in the working
10101 copy will be fixed. Note that no backup are made.
10102
10103 If revisions are specified with --source, those revisions and their de‐
10104 scendants will be checked, and they may be replaced with new revisions
10105 that have fixed file content. By automatically including the descen‐
10106 dants, no merging, rebasing, or evolution will be required. If an an‐
10107 cestor of the working copy is included, then the working copy itself
10108 will also be fixed, and the working copy will be updated to the fixed
10109 parent.
10110
10111 When determining what lines of each file to fix at each revision, the
10112 whole set of revisions being fixed is considered, so that fixes to ear‐
10113 lier revisions are not forgotten in later ones. The --base flag can be
10114 used to override this default behavior, though it is not usually desir‐
10115 able to do so.
10116
10117 Options:
10118
10119 --all fix all non-public non-obsolete revisions
10120
10121 --base <REV[+]>
10122 revisions to diff against (overrides automatic selection, and
10123 applies to every revision being fixed)
10124
10125 -r,--rev <REV[+]>
10126 revisions to fix (ADVANCED)
10127
10128 -s,--source <REV[+]>
10129 fix the specified revisions and their descendants
10130
10131 -w, --working-dir
10132 fix the working directory
10133
10134 --whole
10135 always fix every line of a file
10136
10137 [+] marked option can be specified multiple times
10138
10139 fsmonitor
10140 Faster status operations with the Watchman file monitor (EXPERIMENTAL)
10141
10142 Integrates the file-watching program Watchman with Mercurial to produce
10143 faster status results.
10144
10145 On a particular Linux system, for a real-world repository with over
10146 400,000 files hosted on ext4, vanilla hg status takes 1.3 seconds. On
10147 the same system, with fsmonitor it takes about 0.3 seconds.
10148
10149 fsmonitor requires no configuration -- it will tell Watchman about your
10150 repository as necessary. You'll need to install Watchman from
10151 https://facebook.github.io/watchman/ and make sure it is in your PATH.
10152
10153 fsmonitor is incompatible with the largefiles and eol extensions, and
10154 will disable itself if any of those are active.
10155
10156 The following configuration options exist:
10157
10158 [fsmonitor]
10159 mode = {off, on, paranoid}
10160
10161 When mode = off, fsmonitor will disable itself (similar to not loading
10162 the extension at all). When mode = on, fsmonitor will be enabled (the
10163 default). When mode = paranoid, fsmonitor will query both Watchman and
10164 the filesystem, and ensure that the results are consistent.
10165
10166 [fsmonitor]
10167 timeout = (float)
10168
10169 A value, in seconds, that determines how long fsmonitor will wait for
10170 Watchman to return results. Defaults to 2.0.
10171
10172 [fsmonitor]
10173 blacklistusers = (list of userids)
10174
10175 A list of usernames for which fsmonitor will disable itself altogether.
10176
10177 [fsmonitor]
10178 walk_on_invalidate = (boolean)
10179
10180 Whether or not to walk the whole repo ourselves when our cached state
10181 has been invalidated, for example when Watchman has been restarted or
10182 .hgignore rules have been changed. Walking the repo in that case can
10183 result in competing for I/O with Watchman. For large repos it is recom‐
10184 mended to set this value to false. You may wish to set this to true if
10185 you have a very fast filesystem that can outpace the IPC overhead of
10186 getting the result data for the full repo from Watchman. Defaults to
10187 false.
10188
10189 [fsmonitor]
10190 warn_when_unused = (boolean)
10191
10192 Whether to print a warning during certain operations when fsmonitor
10193 would be beneficial to performance but isn't enabled.
10194
10195 [fsmonitor]
10196 warn_update_file_count = (integer)
10197 # or when mercurial is built with rust support
10198 warn_update_file_count_rust = (integer)
10199
10200 If warn_when_unused is set and fsmonitor isn't enabled, a warning will
10201 be printed during working directory updates if this many files will be
10202 created.
10203
10204 git
10205 grant Mercurial the ability to operate on Git repositories. (EXPERIMEN‐
10206 TAL)
10207
10208 This is currently super experimental. It probably will consume your
10209 firstborn a la Rumpelstiltskin, etc.
10210
10211 githelp
10212 try mapping git commands to Mercurial commands
10213
10214 Tries to map a given git command to a Mercurial command:
10215
10216 $ hg githelp -- git checkout master hg update master
10217
10218 If an unknown command or parameter combination is detected, an error is
10219 produced.
10220
10221 Commands
10222 Help
10223 githelp
10224 suggests the Mercurial equivalent of the given git command:
10225
10226 hg githelp
10227
10228 Usage: hg githelp -- <git command>
10229
10230 aliases: git
10231
10232 gpg
10233 commands to sign and verify changesets
10234
10235 Commands
10236 Signing changes (GPG)
10237 sigcheck
10238 verify all the signatures there may be for a particular revision:
10239
10240 hg sigcheck REV
10241
10242 verify all the signatures there may be for a particular revision
10243
10244 sign
10245 add a signature for the current or given revision:
10246
10247 hg sign [OPTION]... [REV]...
10248
10249 If no revision is given, the parent of the working directory is used,
10250 or tip if no revision is checked out.
10251
10252 The gpg.cmd config setting can be used to specify the command to run. A
10253 default key can be specified with gpg.key.
10254
10255 See hg help dates for a list of formats valid for -d/--date.
10256
10257 Options:
10258
10259 -l, --local
10260 make the signature local
10261
10262 -f, --force
10263 sign even if the sigfile is modified
10264
10265 --no-commit
10266 do not commit the sigfile after signing
10267
10268 -k,--key <ID>
10269 the key id to sign with
10270
10271 -m,--message <TEXT>
10272 use text as commit message
10273
10274 -e, --edit
10275 invoke editor on commit messages
10276
10277 -d,--date <DATE>
10278 record the specified date as commit date
10279
10280 -u,--user <USER>
10281 record the specified user as committer
10282
10283 sigs
10284 list signed changesets:
10285
10286 hg sigs
10287
10288 list signed changesets
10289
10290 graphlog
10291 command to view revision graphs from a shell (DEPRECATED)
10292
10293 The functionality of this extension has been include in core Mercurial
10294 since version 2.3. Please use hg log -G ... instead.
10295
10296 This extension adds a --graph option to the incoming, outgoing and log
10297 commands. When this options is given, an ASCII representation of the
10298 revision graph is also shown.
10299
10300 Commands
10301 Change navigation
10302 glog
10303 show revision history alongside an ASCII revision graph:
10304
10305 hg glog [OPTION]... [FILE]
10306
10307 Print a revision history alongside a revision graph drawn with ASCII
10308 characters.
10309
10310 Nodes printed as an @ character are parents of the working directory.
10311
10312 This is an alias to hg log -G.
10313
10314 Options:
10315
10316 -f, --follow
10317 follow changeset history, or file history across copies and re‐
10318 names
10319
10320 --follow-first
10321 only follow the first parent of merge changesets (DEPRECATED)
10322
10323 -d,--date <DATE>
10324 show revisions matching date spec
10325
10326 -C, --copies
10327 show copied files
10328
10329 -k,--keyword <TEXT[+]>
10330 do case-insensitive search for a given text
10331
10332 -r,--rev <REV[+]>
10333 show the specified revision or revset
10334
10335 --removed
10336 include revisions where files were removed
10337
10338 -m, --only-merges
10339 show only merges (DEPRECATED)
10340
10341 -u,--user <USER[+]>
10342 revisions committed by user
10343
10344 --only-branch <BRANCH[+]>
10345 show only changesets within the given named branch (DEPRECATED)
10346
10347 -b,--branch <BRANCH[+]>
10348 show changesets within the given named branch
10349
10350 -P,--prune <REV[+]>
10351 do not display revision or any of its ancestors
10352
10353 -p, --patch
10354 show patch
10355
10356 -g, --git
10357 use git extended diff format
10358
10359 -l,--limit <NUM>
10360 limit number of changes displayed
10361
10362 -M, --no-merges
10363 do not show merges
10364
10365 --stat output diffstat-style summary of changes
10366
10367 -G, --graph
10368 show the revision DAG
10369
10370 --style <STYLE>
10371 display using template map file (DEPRECATED)
10372
10373 -T,--template <TEMPLATE>
10374 display with template
10375
10376 -I,--include <PATTERN[+]>
10377 include names matching the given patterns
10378
10379 -X,--exclude <PATTERN[+]>
10380 exclude names matching the given patterns
10381
10382 [+] marked option can be specified multiple times
10383
10384 hgk
10385 browse the repository in a graphical way
10386
10387 The hgk extension allows browsing the history of a repository in a
10388 graphical way. It requires Tcl/Tk version 8.4 or later. (Tcl/Tk is not
10389 distributed with Mercurial.)
10390
10391 hgk consists of two parts: a Tcl script that does the displaying and
10392 querying of information, and an extension to Mercurial named hgk.py,
10393 which provides hooks for hgk to get information. hgk can be found in
10394 the contrib directory, and the extension is shipped in the hgext repos‐
10395 itory, and needs to be enabled.
10396
10397 The hg view command will launch the hgk Tcl script. For this command to
10398 work, hgk must be in your search path. Alternately, you can specify the
10399 path to hgk in your configuration file:
10400
10401 [hgk]
10402 path = /location/of/hgk
10403
10404 hgk can make use of the extdiff extension to visualize revisions. As‐
10405 suming you had already configured extdiff vdiff command, just add:
10406
10407 [hgk]
10408 vdiff=vdiff
10409
10410 Revisions context menu will now display additional entries to fire vd‐
10411 iff on hovered and selected revisions.
10412
10413 Commands
10414 Change navigation
10415 view
10416 start interactive history viewer:
10417
10418 hg view [-l LIMIT] [REVRANGE]
10419
10420 start interactive history viewer
10421
10422 Options:
10423
10424 -l,--limit <NUM>
10425 limit number of changes displayed
10426
10427 Uncategorized commands
10428 highlight
10429 syntax highlighting for hgweb (requires Pygments)
10430
10431 It depends on the Pygments syntax highlighting library:
10432 http://pygments.org/
10433
10434 There are the following configuration options:
10435
10436 [web]
10437 pygments_style = <style> (default: colorful)
10438 highlightfiles = <fileset> (default: size('<5M'))
10439 highlightonlymatchfilename = <bool> (default False)
10440
10441 highlightonlymatchfilename will only highlight files if their type
10442 could be identified by their filename. When this is not enabled (the
10443 default), Pygments will try very hard to identify the file type from
10444 content and any match (even matches with a low confidence score) will
10445 be used.
10446
10447 histedit
10448 interactive history editing
10449
10450 With this extension installed, Mercurial gains one new command: histe‐
10451 dit. Usage is as follows, assuming the following history:
10452
10453 @ 3[tip] 7c2fd3b9020c 2009-04-27 18:04 -0500 durin42
10454 | Add delta
10455 |
10456 o 2 030b686bedc4 2009-04-27 18:04 -0500 durin42
10457 | Add gamma
10458 |
10459 o 1 c561b4e977df 2009-04-27 18:04 -0500 durin42
10460 | Add beta
10461 |
10462 o 0 d8d2fcd0e319 2009-04-27 18:04 -0500 durin42
10463 Add alpha
10464
10465 If you were to run hg histedit c561b4e977df, you would see the follow‐
10466 ing file open in your editor:
10467
10468 pick c561b4e977df Add beta
10469 pick 030b686bedc4 Add gamma
10470 pick 7c2fd3b9020c Add delta
10471
10472 # Edit history between c561b4e977df and 7c2fd3b9020c
10473 #
10474 # Commits are listed from least to most recent
10475 #
10476 # Commands:
10477 # p, pick = use commit
10478 # e, edit = use commit, but allow edits before making new commit
10479 # f, fold = use commit, but combine it with the one above
10480 # r, roll = like fold, but discard this commit's description and date
10481 # d, drop = remove commit from history
10482 # m, mess = edit commit message without changing commit content
10483 # b, base = checkout changeset and apply further changesets from there
10484 #
10485
10486 In this file, lines beginning with # are ignored. You must specify a
10487 rule for each revision in your history. For example, if you had meant
10488 to add gamma before beta, and then wanted to add delta in the same re‐
10489 vision as beta, you would reorganize the file to look like this:
10490
10491 pick 030b686bedc4 Add gamma
10492 pick c561b4e977df Add beta
10493 fold 7c2fd3b9020c Add delta
10494
10495 # Edit history between c561b4e977df and 7c2fd3b9020c
10496 #
10497 # Commits are listed from least to most recent
10498 #
10499 # Commands:
10500 # p, pick = use commit
10501 # e, edit = use commit, but allow edits before making new commit
10502 # f, fold = use commit, but combine it with the one above
10503 # r, roll = like fold, but discard this commit's description and date
10504 # d, drop = remove commit from history
10505 # m, mess = edit commit message without changing commit content
10506 # b, base = checkout changeset and apply further changesets from there
10507 #
10508
10509 At which point you close the editor and histedit starts working. When
10510 you specify a fold operation, histedit will open an editor when it
10511 folds those revisions together, offering you a chance to clean up the
10512 commit message:
10513
10514 Add beta
10515 ***
10516 Add delta
10517
10518 Edit the commit message to your liking, then close the editor. The date
10519 used for the commit will be the later of the two commits' dates. For
10520 this example, let's assume that the commit message was changed to Add
10521 beta and delta. After histedit has run and had a chance to remove any
10522 old or temporary revisions it needed, the history looks like this:
10523
10524 @ 2[tip] 989b4d060121 2009-04-27 18:04 -0500 durin42
10525 | Add beta and delta.
10526 |
10527 o 1 081603921c3f 2009-04-27 18:04 -0500 durin42
10528 | Add gamma
10529 |
10530 o 0 d8d2fcd0e319 2009-04-27 18:04 -0500 durin42
10531 Add alpha
10532
10533 Note that histedit does not remove any revisions (even its own tempo‐
10534 rary ones) until after it has completed all the editing operations, so
10535 it will probably perform several strip operations when it's done. For
10536 the above example, it had to run strip twice. Strip can be slow depend‐
10537 ing on a variety of factors, so you might need to be a little patient.
10538 You can choose to keep the original revisions by passing the --keep
10539 flag.
10540
10541 The edit operation will drop you back to a command prompt, allowing you
10542 to edit files freely, or even use hg record to commit some changes as a
10543 separate commit. When you're done, any remaining uncommitted changes
10544 will be committed as well. When done, run hg histedit --continue to
10545 finish this step. If there are uncommitted changes, you'll be prompted
10546 for a new commit message, but the default commit message will be the
10547 original message for the edit ed revision, and the date of the original
10548 commit will be preserved.
10549
10550 The message operation will give you a chance to revise a commit message
10551 without changing the contents. It's a shortcut for doing edit immedi‐
10552 ately followed by hg histedit --continue`.
10553
10554 If histedit encounters a conflict when moving a revision (while han‐
10555 dling pick or fold), it'll stop in a similar manner to edit with the
10556 difference that it won't prompt you for a commit message when done. If
10557 you decide at this point that you don't like how much work it will be
10558 to rearrange history, or that you made a mistake, you can use hg histe‐
10559 dit --abort to abandon the new changes you have made and return to the
10560 state before you attempted to edit your history.
10561
10562 If we clone the histedit-ed example repository above and add four more
10563 changes, such that we have the following history:
10564
10565 @ 6[tip] 038383181893 2009-04-27 18:04 -0500 stefan
10566 | Add theta
10567 |
10568 o 5 140988835471 2009-04-27 18:04 -0500 stefan
10569 | Add eta
10570 |
10571 o 4 122930637314 2009-04-27 18:04 -0500 stefan
10572 | Add zeta
10573 |
10574 o 3 836302820282 2009-04-27 18:04 -0500 stefan
10575 | Add epsilon
10576 |
10577 o 2 989b4d060121 2009-04-27 18:04 -0500 durin42
10578 | Add beta and delta.
10579 |
10580 o 1 081603921c3f 2009-04-27 18:04 -0500 durin42
10581 | Add gamma
10582 |
10583 o 0 d8d2fcd0e319 2009-04-27 18:04 -0500 durin42
10584 Add alpha
10585
10586 If you run hg histedit --outgoing on the clone then it is the same as
10587 running hg histedit 836302820282. If you need plan to push to a reposi‐
10588 tory that Mercurial does not detect to be related to the source repo,
10589 you can add a --force option.
10590
10591 Config
10592 Histedit rule lines are truncated to 80 characters by default. You can
10593 customize this behavior by setting a different length in your configu‐
10594 ration file:
10595
10596 [histedit]
10597 linelen = 120 # truncate rule lines at 120 characters
10598
10599 The summary of a change can be customized as well:
10600
10601 [histedit]
10602 summary-template = '{rev} {bookmarks} {desc|firstline}'
10603
10604 The customized summary should be kept short enough that rule lines will
10605 fit in the configured line length. See above if that requires cus‐
10606 tomization.
10607
10608 hg histedit attempts to automatically choose an appropriate base revi‐
10609 sion to use. To change which base revision is used, define a revset in
10610 your configuration file:
10611
10612 [histedit]
10613 defaultrev = only(.) & draft()
10614
10615 By default each edited revision needs to be present in histedit com‐
10616 mands. To remove revision you need to use drop operation. You can con‐
10617 figure the drop to be implicit for missing commits by adding:
10618
10619 [histedit]
10620 dropmissing = True
10621
10622 By default, histedit will close the transaction after each action. For
10623 performance purposes, you can configure histedit to use a single trans‐
10624 action across the entire histedit. WARNING: This setting introduces a
10625 significant risk of losing the work you've done in a histedit if the
10626 histedit aborts unexpectedly:
10627
10628 [histedit]
10629 singletransaction = True
10630
10631 Commands
10632 Change manipulation
10633 histedit
10634 interactively edit changeset history:
10635
10636 hg histedit [OPTIONS] ([ANCESTOR] | --outgoing [URL])
10637
10638 This command lets you edit a linear series of changesets (up to and in‐
10639 cluding the working directory, which should be clean). You can:
10640
10641 • pick to [re]order a changeset
10642
10643 • drop to omit changeset
10644
10645 • mess to reword the changeset commit message
10646
10647 • fold to combine it with the preceding changeset (using the later
10648 date)
10649
10650 • roll like fold, but discarding this commit's description and date
10651
10652 • edit to edit this changeset (preserving date)
10653
10654 • base to checkout changeset and apply further changesets from there
10655
10656 There are a number of ways to select the root changeset:
10657
10658 • Specify ANCESTOR directly
10659
10660 • Use --outgoing -- it will be the first linear changeset not included
10661 in destination. (See hg help config.paths.default-push)
10662
10663 • Otherwise, the value from the "histedit.defaultrev" config option is
10664 used as a revset to select the base revision when ANCESTOR is not
10665 specified. The first revision returned by the revset is used. By de‐
10666 fault, this selects the editable history that is unique to the ances‐
10667 try of the working directory.
10668
10669 If you use --outgoing, this command will abort if there are ambiguous
10670 outgoing revisions. For example, if there are multiple branches con‐
10671 taining outgoing revisions.
10672
10673 Use "min(outgoing() and ::.)" or similar revset specification instead
10674 of --outgoing to specify edit target revision exactly in such ambiguous
10675 situation. See hg help revsets for detail about selecting revisions.
10676
10677 Examples:
10678
10679 • A number of changes have been made. Revision 3 is no longer
10680 needed.
10681
10682 Start history editing from revision 3:
10683
10684 hg histedit -r 3
10685
10686 An editor opens, containing the list of revisions, with specific
10687 actions specified:
10688
10689 pick 5339bf82f0ca 3 Zworgle the foobar
10690 pick 8ef592ce7cc4 4 Bedazzle the zerlog
10691 pick 0a9639fcda9d 5 Morgify the cromulancy
10692
10693 Additional information about the possible actions to take appears
10694 below the list of revisions.
10695
10696 To remove revision 3 from the history, its action (at the begin‐
10697 ning of the relevant line) is changed to 'drop':
10698
10699 drop 5339bf82f0ca 3 Zworgle the foobar
10700 pick 8ef592ce7cc4 4 Bedazzle the zerlog
10701 pick 0a9639fcda9d 5 Morgify the cromulancy
10702
10703 • A number of changes have been made. Revision 2 and 4 need to be
10704 swapped.
10705
10706 Start history editing from revision 2:
10707
10708 hg histedit -r 2
10709
10710 An editor opens, containing the list of revisions, with specific
10711 actions specified:
10712
10713 pick 252a1af424ad 2 Blorb a morgwazzle
10714 pick 5339bf82f0ca 3 Zworgle the foobar
10715 pick 8ef592ce7cc4 4 Bedazzle the zerlog
10716
10717 To swap revision 2 and 4, its lines are swapped in the editor:
10718
10719 pick 8ef592ce7cc4 4 Bedazzle the zerlog
10720 pick 5339bf82f0ca 3 Zworgle the foobar
10721 pick 252a1af424ad 2 Blorb a morgwazzle
10722
10723 Returns 0 on success, 1 if user intervention is required (not only for
10724 intentional "edit" command, but also for resolving unexpected con‐
10725 flicts).
10726
10727 Options:
10728
10729 --commands <FILE>
10730 read history edits from the specified file
10731
10732 -c, --continue
10733 continue an edit already in progress
10734
10735 --edit-plan
10736 edit remaining actions list
10737
10738 -k, --keep
10739 don't strip old nodes after edit is complete
10740
10741 --abort
10742 abort an edit in progress
10743
10744 -o, --outgoing
10745 changesets not found in destination
10746
10747 -f, --force
10748 force outgoing even for unrelated repositories
10749
10750 -r,--rev <REV[+]>
10751 first revision to be edited
10752
10753 -T,--template <TEMPLATE>
10754 display with template
10755
10756 [+] marked option can be specified multiple times
10757
10758 hooklib
10759 collection of simple hooks for common tasks (EXPERIMENTAL)
10760
10761 This extension provides a number of simple hooks to handle issues com‐
10762 monly found in repositories with many contributors: - email notifica‐
10763 tion when changesets move from draft to public phase - email notifica‐
10764 tion when changesets are obsoleted - enforcement of draft phase for all
10765 incoming changesets - enforcement of a no-branch-merge policy - en‐
10766 forcement of a no-multiple-heads policy
10767
10768 The implementation of the hooks is subject to change, e.g. whether to
10769 implement them as individual hooks or merge them into the notify exten‐
10770 sion as option. The functionality itself is planned to be supported
10771 long-term.
10772
10773 infinitepush
10774 store some pushes in a remote blob store on the server (EXPERIMEN‐
10775 TAL)
10776
10777 IMPORTANT: if you use this extension, please contact
10778 mercurial-devel@mercurial-scm.org ASAP. This extension is believed to
10779 be unused and barring learning of users of this functionality, we will
10780 delete this code at the end of 2020.
10781
10782 [infinitepush] # Server-side and client-side option. Pattern of the
10783 infinitepush bookmark branchpattern = PATTERN
10784
10785 # Server or client server = False
10786
10787 # Server-side option. Possible values: 'disk' or 'sql'. Fails if not
10788 set indextype = disk
10789
10790 # Server-side option. Used only if indextype=sql. # Format:
10791 'IP:PORT:DB_NAME:USER:PASSWORD' sqlhost = IP:PORT:DB_NAME:USER:PASS‐
10792 WORD
10793
10794 # Server-side option. Used only if indextype=disk. # Filesystem
10795 path to the index store indexpath = PATH
10796
10797 # Server-side option. Possible values: 'disk' or 'external' # Fails
10798 if not set storetype = disk
10799
10800 # Server-side option. # Path to the binary that will save bundle to
10801 the bundlestore # Formatted cmd line will be passed to it (see
10802 put_args) put_binary = put
10803
10804 # Serser-side option. Used only if storetype=external. # Format
10805 cmd-line string for put binary. Placeholder: {filename} put_args =
10806 {filename}
10807
10808 # Server-side option. # Path to the binary that get bundle from the
10809 bundlestore. # Formatted cmd line will be passed to it (see
10810 get_args) get_binary = get
10811
10812 # Serser-side option. Used only if storetype=external. # Format
10813 cmd-line string for get binary. Placeholders: {filename} {handle}
10814 get_args = {filename} {handle}
10815
10816 # Server-side option logfile = FIlE
10817
10818 # Server-side option loglevel = DEBUG
10819
10820 # Server-side option. Used only if indextype=sql. # Sets mysql
10821 wait_timeout option. waittimeout = 300
10822
10823 # Server-side option. Used only if indextype=sql. # Sets mysql inn‐
10824 odb_lock_wait_timeout option. locktimeout = 120
10825
10826 # Server-side option. Used only if indextype=sql. # Name of the
10827 repository reponame = ''
10828
10829 # Client-side option. Used by --list-remote option. List of remote
10830 scratch # patterns to list if no patterns are specified. default‐
10831 remotepatterns = ['*']
10832
10833 # Instructs infinitepush to forward all received bundle2 parts to
10834 the # bundle for storage. Defaults to False. storeallparts = True
10835
10836 # routes each incoming push to the bundlestore. defaults to False
10837 pushtobundlestore = True
10838
10839 [remotenames] # Client-side option # This option should be set only
10840 if remotenames extension is enabled. # Whether remote bookmarks are
10841 tracked by remotenames extension. bookmarks = True
10842
10843 journal
10844 track previous positions of bookmarks (EXPERIMENTAL)
10845
10846 This extension adds a new command: hg journal, which shows you where
10847 bookmarks were previously located.
10848
10849 Commands
10850 Change organization
10851 journal
10852 show the previous position of bookmarks and the working copy:
10853
10854 hg journal [OPTION]... [BOOKMARKNAME]
10855
10856 The journal is used to see the previous commits that bookmarks and the
10857 working copy pointed to. By default the previous locations for the
10858 working copy. Passing a bookmark name will show all the previous posi‐
10859 tions of that bookmark. Use the --all switch to show previous locations
10860 for all bookmarks and the working copy; each line will then include the
10861 bookmark name, or '.' for the working copy, as well.
10862
10863 If name starts with re:, the remainder of the name is treated as a reg‐
10864 ular expression. To match a name that actually starts with re:, use the
10865 prefix literal:.
10866
10867 By default hg journal only shows the commit hash and the command that
10868 was running at that time. -v/--verbose will show the prior hash, the
10869 user, and the time at which it happened.
10870
10871 Use -c/--commits to output log information on each commit hash; at this
10872 point you can use the usual --patch, --git, --stat and --template
10873 switches to alter the log output for these.
10874
10875 hg journal -T json can be used to produce machine readable output.
10876
10877 Options:
10878
10879 --all show history for all names
10880
10881 -c, --commits
10882 show commit metadata
10883
10884 -p, --patch
10885 show patch
10886
10887 -g, --git
10888 use git extended diff format
10889
10890 -l,--limit <NUM>
10891 limit number of changes displayed
10892
10893 --stat output diffstat-style summary of changes
10894
10895 --style <STYLE>
10896 display using template map file (DEPRECATED)
10897
10898 -T,--template <TEMPLATE>
10899 display with template
10900
10901 keyword
10902 expand keywords in tracked files
10903
10904 This extension expands RCS/CVS-like or self-customized $Keywords$ in
10905 tracked text files selected by your configuration.
10906
10907 Keywords are only expanded in local repositories and not stored in the
10908 change history. The mechanism can be regarded as a convenience for the
10909 current user or for archive distribution.
10910
10911 Keywords expand to the changeset data pertaining to the latest change
10912 relative to the working directory parent of each file.
10913
10914 Configuration is done in the [keyword], [keywordset] and [keywordmaps]
10915 sections of hgrc files.
10916
10917 Example:
10918
10919 [keyword]
10920 # expand keywords in every python file except those matching "x*"
10921 **.py =
10922 x* = ignore
10923
10924 [keywordset]
10925 # prefer svn- over cvs-like default keywordmaps
10926 svn = True
10927
10928 Note The more specific you are in your filename patterns the less you
10929 lose speed in huge repositories.
10930
10931 For [keywordmaps] template mapping and expansion demonstration and con‐
10932 trol run hg kwdemo. See hg help templates for a list of available tem‐
10933 plates and filters.
10934
10935 Three additional date template filters are provided:
10936
10937 utcdate
10938
10939 "2006/09/18 15:13:13"
10940
10941 svnutcdate
10942
10943 "2006-09-18 15:13:13Z"
10944
10945 svnisodate
10946
10947 "2006-09-18 08:13:13 -700 (Mon, 18 Sep 2006)"
10948
10949 The default template mappings (view with hg kwdemo -d) can be replaced
10950 with customized keywords and templates. Again, run hg kwdemo to control
10951 the results of your configuration changes.
10952
10953 Before changing/disabling active keywords, you must run hg kwshrink to
10954 avoid storing expanded keywords in the change history.
10955
10956 To force expansion after enabling it, or a configuration change, run hg
10957 kwexpand.
10958
10959 Expansions spanning more than one line and incremental expansions, like
10960 CVS' $Log$, are not supported. A keyword template map "Log = {desc}"
10961 expands to the first line of the changeset description.
10962
10963 Commands
10964 Uncategorized commands
10965 kwdemo
10966 print [keywordmaps] configuration and an expansion example:
10967
10968 hg kwdemo [-d] [-f RCFILE] [TEMPLATEMAP]...
10969
10970 Show current, custom, or default keyword template maps and their expan‐
10971 sions.
10972
10973 Extend the current configuration by specifying maps as arguments and
10974 using -f/--rcfile to source an external hgrc file.
10975
10976 Use -d/--default to disable current configuration.
10977
10978 See hg help templates for information on templates and filters.
10979
10980 Options:
10981
10982 -d, --default
10983 show default keyword template maps
10984
10985 -f,--rcfile <FILE>
10986 read maps from rcfile
10987
10988 kwexpand
10989 expand keywords in the working directory:
10990
10991 hg kwexpand [OPTION]... [FILE]...
10992
10993 Run after (re)enabling keyword expansion.
10994
10995 kwexpand refuses to run if given files contain local changes.
10996
10997 Options:
10998
10999 -I,--include <PATTERN[+]>
11000 include names matching the given patterns
11001
11002 -X,--exclude <PATTERN[+]>
11003 exclude names matching the given patterns
11004
11005 [+] marked option can be specified multiple times
11006
11007 kwfiles
11008 show files configured for keyword expansion:
11009
11010 hg kwfiles [OPTION]... [FILE]...
11011
11012 List which files in the working directory are matched by the [keyword]
11013 configuration patterns.
11014
11015 Useful to prevent inadvertent keyword expansion and to speed up execu‐
11016 tion by including only files that are actual candidates for expansion.
11017
11018 See hg help keyword on how to construct patterns both for inclusion and
11019 exclusion of files.
11020
11021 With -A/--all and -v/--verbose the codes used to show the status of
11022 files are:
11023
11024 K = keyword expansion candidate
11025 k = keyword expansion candidate (not tracked)
11026 I = ignored
11027 i = ignored (not tracked)
11028
11029 Options:
11030
11031 -A, --all
11032 show keyword status flags of all files
11033
11034 -i, --ignore
11035 show files excluded from expansion
11036
11037 -u, --unknown
11038 only show unknown (not tracked) files
11039
11040 -I,--include <PATTERN[+]>
11041 include names matching the given patterns
11042
11043 -X,--exclude <PATTERN[+]>
11044 exclude names matching the given patterns
11045
11046 [+] marked option can be specified multiple times
11047
11048 kwshrink
11049 revert expanded keywords in the working directory:
11050
11051 hg kwshrink [OPTION]... [FILE]...
11052
11053 Must be run before changing/disabling active keywords.
11054
11055 kwshrink refuses to run if given files contain local changes.
11056
11057 Options:
11058
11059 -I,--include <PATTERN[+]>
11060 include names matching the given patterns
11061
11062 -X,--exclude <PATTERN[+]>
11063 exclude names matching the given patterns
11064
11065 [+] marked option can be specified multiple times
11066
11067 largefiles
11068 track large binary files
11069
11070 Large binary files tend to be not very compressible, not very diffable,
11071 and not at all mergeable. Such files are not handled efficiently by
11072 Mercurial's storage format (revlog), which is based on compressed bi‐
11073 nary deltas; storing large binary files as regular Mercurial files
11074 wastes bandwidth and disk space and increases Mercurial's memory usage.
11075 The largefiles extension addresses these problems by adding a central‐
11076 ized client-server layer on top of Mercurial: largefiles live in a cen‐
11077 tral store out on the network somewhere, and you only fetch the revi‐
11078 sions that you need when you need them.
11079
11080 largefiles works by maintaining a "standin file" in .hglf/ for each
11081 largefile. The standins are small (41 bytes: an SHA-1 hash plus new‐
11082 line) and are tracked by Mercurial. Largefile revisions are identified
11083 by the SHA-1 hash of their contents, which is written to the standin.
11084 largefiles uses that revision ID to get/put largefile revisions from/to
11085 the central store. This saves both disk space and bandwidth, since you
11086 don't need to retrieve all historical revisions of large files when you
11087 clone or pull.
11088
11089 To start a new repository or add new large binary files, just add
11090 --large to your hg add command. For example:
11091
11092 $ dd if=/dev/urandom of=randomdata count=2000
11093 $ hg add --large randomdata
11094 $ hg commit -m "add randomdata as a largefile"
11095
11096 When you push a changeset that adds/modifies largefiles to a remote
11097 repository, its largefile revisions will be uploaded along with it.
11098 Note that the remote Mercurial must also have the largefiles extension
11099 enabled for this to work.
11100
11101 When you pull a changeset that affects largefiles from a remote reposi‐
11102 tory, the largefiles for the changeset will by default not be pulled
11103 down. However, when you update to such a revision, any largefiles
11104 needed by that revision are downloaded and cached (if they have never
11105 been downloaded before). One way to pull largefiles when pulling is
11106 thus to use --update, which will update your working copy to the latest
11107 pulled revision (and thereby downloading any new largefiles).
11108
11109 If you want to pull largefiles you don't need for update yet, then you
11110 can use pull with the --lfrev option or the hg lfpull command.
11111
11112 If you know you are pulling from a non-default location and want to
11113 download all the largefiles that correspond to the new changesets at
11114 the same time, then you can pull with --lfrev "pulled()".
11115
11116 If you just want to ensure that you will have the largefiles needed to
11117 merge or rebase with new heads that you are pulling, then you can pull
11118 with --lfrev "head(pulled())" flag to pre-emptively download any large‐
11119 files that are new in the heads you are pulling.
11120
11121 Keep in mind that network access may now be required to update to
11122 changesets that you have not previously updated to. The nature of the
11123 largefiles extension means that updating is no longer guaranteed to be
11124 a local-only operation.
11125
11126 If you already have large files tracked by Mercurial without the large‐
11127 files extension, you will need to convert your repository in order to
11128 benefit from largefiles. This is done with the hg lfconvert command:
11129
11130 $ hg lfconvert --size 10 oldrepo newrepo
11131
11132 In repositories that already have largefiles in them, any new file over
11133 10MB will automatically be added as a largefile. To change this thresh‐
11134 old, set largefiles.minsize in your Mercurial config file to the mini‐
11135 mum size in megabytes to track as a largefile, or use the --lfsize op‐
11136 tion to the add command (also in megabytes):
11137
11138 [largefiles]
11139 minsize = 2
11140
11141 $ hg add --lfsize 2
11142
11143 The largefiles.patterns config option allows you to specify a list of
11144 filename patterns (see hg help patterns) that should always be tracked
11145 as largefiles:
11146
11147 [largefiles]
11148 patterns =
11149 *.jpg
11150 re:.*\.(png|bmp)$
11151 library.zip
11152 content/audio/*
11153
11154 Files that match one of these patterns will be added as largefiles re‐
11155 gardless of their size.
11156
11157 The largefiles.minsize and largefiles.patterns config options will be
11158 ignored for any repositories not already containing a largefile. To add
11159 the first largefile to a repository, you must explicitly do so with the
11160 --large flag passed to the hg add command.
11161
11162 Commands
11163 Uncategorized commands
11164 lfconvert
11165 convert a normal repository to a largefiles repository:
11166
11167 hg lfconvert SOURCE DEST [FILE ...]
11168
11169 Convert repository SOURCE to a new repository DEST, identical to SOURCE
11170 except that certain files will be converted as largefiles: specifi‐
11171 cally, any file that matches any PATTERN or whose size is above the
11172 minimum size threshold is converted as a largefile. The size used to
11173 determine whether or not to track a file as a largefile is the size of
11174 the first version of the file. The minimum size can be specified either
11175 with --size or in configuration as largefiles.size.
11176
11177 After running this command you will need to make sure that largefiles
11178 is enabled anywhere you intend to push the new repository.
11179
11180 Use --to-normal to convert largefiles back to normal files; after this,
11181 the DEST repository can be used without largefiles at all.
11182
11183 Options:
11184
11185 -s,--size <SIZE>
11186 minimum size (MB) for files to be converted as largefiles
11187
11188 --to-normal
11189 convert from a largefiles repo to a normal repo
11190
11191 lfpull
11192 pull largefiles for the specified revisions from the specified source:
11193
11194 hg lfpull -r REV... [-e CMD] [--remotecmd CMD] [SOURCE]
11195
11196 Pull largefiles that are referenced from local changesets but missing
11197 locally, pulling from a remote repository to the local cache.
11198
11199 If SOURCE is omitted, the 'default' path will be used. See hg help
11200 urls for more information.
11201
11202 Some examples:
11203
11204 • pull largefiles for all branch heads:
11205
11206 hg lfpull -r "head() and not closed()"
11207
11208 • pull largefiles on the default branch:
11209
11210 hg lfpull -r "branch(default)"
11211
11212 Options:
11213
11214 -r,--rev <VALUE[+]>
11215 pull largefiles for these revisions
11216
11217 -e,--ssh <CMD>
11218 specify ssh command to use
11219
11220 --remotecmd <CMD>
11221 specify hg command to run on the remote side
11222
11223 --insecure
11224 do not verify server certificate (ignoring web.cacerts config)
11225
11226 [+] marked option can be specified multiple times
11227
11228 lfs
11229 lfs - large file support (EXPERIMENTAL)
11230
11231 This extension allows large files to be tracked outside of the normal
11232 repository storage and stored on a centralized server, similar to the
11233 largefiles extension. The git-lfs protocol is used when communicating
11234 with the server, so existing git infrastructure can be harnessed. Even
11235 though the files are stored outside of the repository, they are still
11236 integrity checked in the same manner as normal files.
11237
11238 The files stored outside of the repository are downloaded on demand,
11239 which reduces the time to clone, and possibly the local disk usage.
11240 This changes fundamental workflows in a DVCS, so careful thought should
11241 be given before deploying it. hg convert can be used to convert LFS
11242 repositories to normal repositories that no longer require this exten‐
11243 sion, and do so without changing the commit hashes. This allows the
11244 extension to be disabled if the centralized workflow becomes burden‐
11245 some. However, the pre and post convert clones will not be able to
11246 communicate with each other unless the extension is enabled on both.
11247
11248 To start a new repository, or to add LFS files to an existing one, just
11249 create an .hglfs file as described below in the root directory of the
11250 repository. Typically, this file should be put under version control,
11251 so that the settings will propagate to other repositories with push and
11252 pull. During any commit, Mercurial will consult this file to determine
11253 if an added or modified file should be stored externally. The type of
11254 storage depends on the characteristics of the file at each commit. A
11255 file that is near a size threshold may switch back and forth between
11256 LFS and normal storage, as needed.
11257
11258 Alternately, both normal repositories and largefile controlled reposi‐
11259 tories can be converted to LFS by using hg convert and the lfs.track
11260 config option described below. The .hglfs file should then be created
11261 and added, to control subsequent LFS selection. The hashes are also
11262 unchanged in this case. The LFS and non-LFS repositories can be dis‐
11263 tinguished because the LFS repository will abort any command if this
11264 extension is disabled.
11265
11266 Committed LFS files are held locally, until the repository is pushed.
11267 Prior to pushing the normal repository data, the LFS files that are
11268 tracked by the outgoing commits are automatically uploaded to the con‐
11269 figured central server. No LFS files are transferred on hg pull or hg
11270 clone. Instead, the files are downloaded on demand as they need to be
11271 read, if a cached copy cannot be found locally. Both committing and
11272 downloading an LFS file will link the file to a usercache, to speed up
11273 future access. See the usercache config setting described below.
11274
11275 The extension reads its configuration from a versioned .hglfs configu‐
11276 ration file found in the root of the working directory. The .hglfs file
11277 uses the same syntax as all other Mercurial configuration files. It
11278 uses a single section, [track].
11279
11280 The [track] section specifies which files are stored as LFS (or not).
11281 Each line is keyed by a file pattern, with a predicate value. The
11282 first file pattern match is used, so put more specific patterns first.
11283 The available predicates are all(), none(), and size(). See "hg help
11284 filesets.size" for the latter.
11285
11286 Example versioned .hglfs file:
11287
11288 [track]
11289 # No Makefile or python file, anywhere, will be LFS
11290 **Makefile = none()
11291 **.py = none()
11292
11293 **.zip = all()
11294 **.exe = size(">1MB")
11295
11296 # Catchall for everything not matched above
11297 ** = size(">10MB")
11298
11299 Configs:
11300
11301 [lfs]
11302 # Remote endpoint. Multiple protocols are supported:
11303 # - http(s)://user:pass@example.com/path
11304 # git-lfs endpoint
11305 # - file:///tmp/path
11306 # local filesystem, usually for testing
11307 # if unset, lfs will assume the remote repository also handles blob storage
11308 # for http(s) URLs. Otherwise, lfs will prompt to set this when it must
11309 # use this value.
11310 # (default: unset)
11311 url = https://example.com/repo.git/info/lfs
11312
11313 # Which files to track in LFS. Path tests are "**.extname" for file
11314 # extensions, and "path:under/some/directory" for path prefix. Both
11315 # are relative to the repository root.
11316 # File size can be tested with the "size()" fileset, and tests can be
11317 # joined with fileset operators. (See "hg help filesets.operators".)
11318 #
11319 # Some examples:
11320 # - all() # everything
11321 # - none() # nothing
11322 # - size(">20MB") # larger than 20MB
11323 # - !**.txt # anything not a *.txt file
11324 # - **.zip | **.tar.gz | **.7z # some types of compressed files
11325 # - path:bin # files under "bin" in the project root
11326 # - (**.php & size(">2MB")) | (**.js & size(">5MB")) | **.tar.gz
11327 # | (path:bin & !path:/bin/README) | size(">1GB")
11328 # (default: none())
11329 #
11330 # This is ignored if there is a tracked '.hglfs' file, and this setting
11331 # will eventually be deprecated and removed.
11332 track = size(">10M")
11333
11334 # how many times to retry before giving up on transferring an object
11335 retry = 5
11336
11337 # the local directory to store lfs files for sharing across local clones.
11338 # If not set, the cache is located in an OS specific cache location.
11339 usercache = /path/to/global/cache
11340
11341 Commands
11342 Uncategorized commands
11343 logtoprocess
11344 send ui.log() data to a subprocess (EXPERIMENTAL)
11345
11346 This extension lets you specify a shell command per ui.log() event,
11347 sending all remaining arguments to as environment variables to that
11348 command.
11349
11350 Positional arguments construct a log message, which is passed in the
11351 MSG1 environment variables. Each keyword argument is set as a OPT_UP‐
11352 PERCASE_KEY variable (so the key is uppercased, and prefixed with
11353 OPT_). The original event name is passed in the EVENT environment vari‐
11354 able, and the process ID of mercurial is given in HGPID.
11355
11356 So given a call ui.log('foo', 'bar %s ', 'baz', spam='eggs'), a script
11357 configured for the `foo event can expect an environment with MSG1=bar
11358 baz, and OPT_SPAM=eggs.
11359
11360 Scripts are configured in the [logtoprocess] section, each key an event
11361 name. For example:
11362
11363 [logtoprocess]
11364 commandexception = echo "$MSG1" > /var/log/mercurial_exceptions.log
11365
11366 would log the warning message and traceback of any failed command dis‐
11367 patch.
11368
11369 Scripts are run asynchronously as detached daemon processes; mercurial
11370 will not ensure that they exit cleanly.
11371
11372 mq
11373 manage a stack of patches
11374
11375 This extension lets you work with a stack of patches in a Mercurial
11376 repository. It manages two stacks of patches - all known patches, and
11377 applied patches (subset of known patches).
11378
11379 Known patches are represented as patch files in the .hg/patches direc‐
11380 tory. Applied patches are both patch files and changesets.
11381
11382 Common tasks (use hg help COMMAND for more details):
11383
11384 create new patch qnew
11385 import existing patch qimport
11386
11387 print patch series qseries
11388 print applied patches qapplied
11389
11390 add known patch to applied stack qpush
11391 remove patch from applied stack qpop
11392 refresh contents of top applied patch qrefresh
11393
11394 By default, mq will automatically use git patches when required to
11395 avoid losing file mode changes, copy records, binary files or empty
11396 files creations or deletions. This behavior can be configured with:
11397
11398 [mq]
11399 git = auto/keep/yes/no
11400
11401 If set to 'keep', mq will obey the [diff] section configuration while
11402 preserving existing git patches upon qrefresh. If set to 'yes' or 'no',
11403 mq will override the [diff] section and always generate git or regular
11404 patches, possibly losing data in the second case.
11405
11406 It may be desirable for mq changesets to be kept in the secret phase
11407 (see hg help phases), which can be enabled with the following setting:
11408
11409 [mq]
11410 secret = True
11411
11412 You will by default be managing a patch queue named "patches". You can
11413 create other, independent patch queues with the hg qqueue command.
11414
11415 If the working directory contains uncommitted files, qpush, qpop and
11416 qgoto abort immediately. If -f/--force is used, the changes are dis‐
11417 carded. Setting:
11418
11419 [mq]
11420 keepchanges = True
11421
11422 make them behave as if --keep-changes were passed, and non-conflicting
11423 local changes will be tolerated and preserved. If incompatible options
11424 such as -f/--force or --exact are passed, this setting is ignored.
11425
11426 This extension used to provide a strip command. This command now lives
11427 in the strip extension.
11428
11429 Commands
11430 Repository creation
11431 qclone
11432 clone main and patch repository at same time:
11433
11434 hg qclone [OPTION]... SOURCE [DEST]
11435
11436 If source is local, destination will have no patches applied. If source
11437 is remote, this command can not check if patches are applied in source,
11438 so cannot guarantee that patches are not applied in destination. If you
11439 clone remote repository, be sure before that it has no patches applied.
11440
11441 Source patch repository is looked for in <src>/.hg/patches by default.
11442 Use -p <url> to change.
11443
11444 The patch directory must be a nested Mercurial repository, as would be
11445 created by hg init --mq.
11446
11447 Return 0 on success.
11448
11449 Options:
11450
11451 --pull use pull protocol to copy metadata
11452
11453 -U, --noupdate
11454 do not update the new working directories
11455
11456 --uncompressed
11457 use uncompressed transfer (fast over LAN)
11458
11459 -p,--patches <REPO>
11460 location of source patch repository
11461
11462 -e,--ssh <CMD>
11463 specify ssh command to use
11464
11465 --remotecmd <CMD>
11466 specify hg command to run on the remote side
11467
11468 --insecure
11469 do not verify server certificate (ignoring web.cacerts config)
11470
11471 qinit
11472 init a new queue repository (DEPRECATED):
11473
11474 hg qinit [-c]
11475
11476 The queue repository is unversioned by default. If -c/--create-repo is
11477 specified, qinit will create a separate nested repository for patches
11478 (qinit -c may also be run later to convert an unversioned patch reposi‐
11479 tory into a versioned one). You can use qcommit to commit changes to
11480 this queue repository.
11481
11482 This command is deprecated. Without -c, it's implied by other relevant
11483 commands. With -c, use hg init --mq instead.
11484
11485 Options:
11486
11487 -c, --create-repo
11488 create queue repository
11489
11490 Change creation
11491 qcommit
11492 commit changes in the queue repository (DEPRECATED):
11493
11494 hg qcommit [OPTION]... [FILE]...
11495
11496 This command is deprecated; use hg commit --mq instead.
11497
11498 Options:
11499
11500 -A, --addremove
11501 mark new/missing files as added/removed before committing
11502
11503 --close-branch
11504 mark a branch head as closed
11505
11506 --amend
11507 amend the parent of the working directory
11508
11509 -s, --secret
11510 use the secret phase for committing
11511
11512 -e, --edit
11513 invoke editor on commit messages
11514
11515 --force-close-branch
11516 forcibly close branch from a non-head changeset (ADVANCED)
11517
11518 -i, --interactive
11519 use interactive mode
11520
11521 -I,--include <PATTERN[+]>
11522 include names matching the given patterns
11523
11524 -X,--exclude <PATTERN[+]>
11525 exclude names matching the given patterns
11526
11527 -m,--message <TEXT>
11528 use text as commit message
11529
11530 -l,--logfile <FILE>
11531 read commit message from file
11532
11533 -d,--date <DATE>
11534 record the specified date as commit date
11535
11536 -u,--user <USER>
11537 record the specified user as committer
11538
11539 -S, --subrepos
11540 recurse into subrepositories
11541
11542 [+] marked option can be specified multiple times
11543
11544 aliases: qci
11545
11546 qnew
11547 create a new patch:
11548
11549 hg qnew [-e] [-m TEXT] [-l FILE] PATCH [FILE]...
11550
11551 qnew creates a new patch on top of the currently-applied patch (if
11552 any). The patch will be initialized with any outstanding changes in the
11553 working directory. You may also use -I/--include, -X/--exclude, and/or
11554 a list of files after the patch name to add only changes to matching
11555 files to the new patch, leaving the rest as uncommitted modifications.
11556
11557 -u/--user and -d/--date can be used to set the (given) user and date,
11558 respectively. -U/--currentuser and -D/--currentdate set user to current
11559 user and date to current date.
11560
11561 -e/--edit, -m/--message or -l/--logfile set the patch header as well as
11562 the commit message. If none is specified, the header is empty and the
11563 commit message is '[mq]: PATCH'.
11564
11565 Use the -g/--git option to keep the patch in the git extended diff for‐
11566 mat. Read the diffs help topic for more information on why this is im‐
11567 portant for preserving permission changes and copy/rename information.
11568
11569 Returns 0 on successful creation of a new patch.
11570
11571 Options:
11572
11573 -e, --edit
11574 invoke editor on commit messages
11575
11576 -f, --force
11577 import uncommitted changes (DEPRECATED)
11578
11579 -g, --git
11580 use git extended diff format
11581
11582 -U, --currentuser
11583 add "From: <current user>" to patch
11584
11585 -u,--user <USER>
11586 add "From: <USER>" to patch
11587
11588 -D, --currentdate
11589 add "Date: <current date>" to patch
11590
11591 -d,--date <DATE>
11592 add "Date: <DATE>" to patch
11593
11594 -I,--include <PATTERN[+]>
11595 include names matching the given patterns
11596
11597 -X,--exclude <PATTERN[+]>
11598 exclude names matching the given patterns
11599
11600 -m,--message <TEXT>
11601 use text as commit message
11602
11603 -l,--logfile <FILE>
11604 read commit message from file
11605
11606 [+] marked option can be specified multiple times
11607
11608 qrefresh
11609 update the current patch:
11610
11611 hg qrefresh [-I] [-X] [-e] [-m TEXT] [-l FILE] [-s] [FILE]...
11612
11613 If any file patterns are provided, the refreshed patch will contain
11614 only the modifications that match those patterns; the remaining modifi‐
11615 cations will remain in the working directory.
11616
11617 If -s/--short is specified, files currently included in the patch will
11618 be refreshed just like matched files and remain in the patch.
11619
11620 If -e/--edit is specified, Mercurial will start your configured editor
11621 for you to enter a message. In case qrefresh fails, you will find a
11622 backup of your message in .hg/last-message.txt.
11623
11624 hg add/remove/copy/rename work as usual, though you might want to use
11625 git-style patches (-g/--git or [diff] git=1) to track copies and re‐
11626 names. See the diffs help topic for more information on the git diff
11627 format.
11628
11629 Returns 0 on success.
11630
11631 Options:
11632
11633 -e, --edit
11634 invoke editor on commit messages
11635
11636 -g, --git
11637 use git extended diff format
11638
11639 -s, --short
11640 refresh only files already in the patch and specified files
11641
11642 -U, --currentuser
11643 add/update author field in patch with current user
11644
11645 -u,--user <USER>
11646 add/update author field in patch with given user
11647
11648 -D, --currentdate
11649 add/update date field in patch with current date
11650
11651 -d,--date <DATE>
11652 add/update date field in patch with given date
11653
11654 -I,--include <PATTERN[+]>
11655 include names matching the given patterns
11656
11657 -X,--exclude <PATTERN[+]>
11658 exclude names matching the given patterns
11659
11660 -m,--message <TEXT>
11661 use text as commit message
11662
11663 -l,--logfile <FILE>
11664 read commit message from file
11665
11666 [+] marked option can be specified multiple times
11667
11668 Change manipulation
11669 qfold
11670 fold the named patches into the current patch:
11671
11672 hg qfold [-e] [-k] [-m TEXT] [-l FILE] PATCH...
11673
11674 Patches must not yet be applied. Each patch will be successively ap‐
11675 plied to the current patch in the order given. If all the patches apply
11676 successfully, the current patch will be refreshed with the new cumula‐
11677 tive patch, and the folded patches will be deleted. With -k/--keep, the
11678 folded patch files will not be removed afterwards.
11679
11680 The header for each folded patch will be concatenated with the current
11681 patch header, separated by a line of * * *.
11682
11683 Returns 0 on success.
11684
11685 Options:
11686
11687 -e, --edit
11688 invoke editor on commit messages
11689
11690 -k, --keep
11691 keep folded patch files
11692
11693 -m,--message <TEXT>
11694 use text as commit message
11695
11696 -l,--logfile <FILE>
11697 read commit message from file
11698
11699 Change organization
11700 qapplied
11701 print the patches already applied:
11702
11703 hg qapplied [-1] [-s] [PATCH]
11704
11705 Returns 0 on success.
11706
11707 Options:
11708
11709 -1, --last
11710 show only the preceding applied patch
11711
11712 -s, --summary
11713 print first line of patch header
11714
11715 qdelete
11716 remove patches from queue:
11717
11718 hg qdelete [-k] [PATCH]...
11719
11720 The patches must not be applied, and at least one patch is required.
11721 Exact patch identifiers must be given. With -k/--keep, the patch files
11722 are preserved in the patch directory.
11723
11724 To stop managing a patch and move it into permanent history, use the hg
11725 qfinish command.
11726
11727 Options:
11728
11729 -k, --keep
11730 keep patch file
11731
11732 -r,--rev <REV[+]>
11733 stop managing a revision (DEPRECATED)
11734
11735 [+] marked option can be specified multiple times
11736
11737 aliases: qremove qrm
11738
11739 qfinish
11740 move applied patches into repository history:
11741
11742 hg qfinish [-a] [REV]...
11743
11744 Finishes the specified revisions (corresponding to applied patches) by
11745 moving them out of mq control into regular repository history.
11746
11747 Accepts a revision range or the -a/--applied option. If --applied is
11748 specified, all applied mq revisions are removed from mq control. Other‐
11749 wise, the given revisions must be at the base of the stack of applied
11750 patches.
11751
11752 This can be especially useful if your changes have been applied to an
11753 upstream repository, or if you are about to push your changes to up‐
11754 stream.
11755
11756 Returns 0 on success.
11757
11758 Options:
11759
11760 -a, --applied
11761 finish all applied changesets
11762
11763 qgoto
11764 push or pop patches until named patch is at top of stack:
11765
11766 hg qgoto [OPTION]... PATCH
11767
11768 Returns 0 on success.
11769
11770 Options:
11771
11772 --keep-changes
11773 tolerate non-conflicting local changes
11774
11775 -f, --force
11776 overwrite any local changes
11777
11778 --no-backup
11779 do not save backup copies of files
11780
11781 qguard
11782 set or print guards for a patch:
11783
11784 hg qguard [-l] [-n] [PATCH] [-- [+GUARD]... [-GUARD]...]
11785
11786 Guards control whether a patch can be pushed. A patch with no guards is
11787 always pushed. A patch with a positive guard ("+foo") is pushed only if
11788 the hg qselect command has activated it. A patch with a negative guard
11789 ("-foo") is never pushed if the hg qselect command has activated it.
11790
11791 With no arguments, print the currently active guards. With arguments,
11792 set guards for the named patch.
11793
11794 Note Specifying negative guards now requires '--'.
11795
11796 To set guards on another patch:
11797
11798 hg qguard other.patch -- +2.6.17 -stable
11799
11800 Returns 0 on success.
11801
11802 Options:
11803
11804 -l, --list
11805 list all patches and guards
11806
11807 -n, --none
11808 drop all guards
11809
11810 qheader
11811 print the header of the topmost or specified patch:
11812
11813 hg qheader [PATCH]
11814
11815 Returns 0 on success.
11816
11817 qnext
11818 print the name of the next pushable patch:
11819
11820 hg qnext [-s]
11821
11822 Returns 0 on success.
11823
11824 Options:
11825
11826 -s, --summary
11827 print first line of patch header
11828
11829 qpop
11830 pop the current patch off the stack:
11831
11832 hg qpop [-a] [-f] [PATCH | INDEX]
11833
11834 Without argument, pops off the top of the patch stack. If given a patch
11835 name, keeps popping off patches until the named patch is at the top of
11836 the stack.
11837
11838 By default, abort if the working directory contains uncommitted
11839 changes. With --keep-changes, abort only if the uncommitted files over‐
11840 lap with patched files. With -f/--force, backup and discard changes
11841 made to such files.
11842
11843 Return 0 on success.
11844
11845 Options:
11846
11847 -a, --all
11848 pop all patches
11849
11850 -n,--name <NAME>
11851 queue name to pop (DEPRECATED)
11852
11853 --keep-changes
11854 tolerate non-conflicting local changes
11855
11856 -f, --force
11857 forget any local changes to patched files
11858
11859 --no-backup
11860 do not save backup copies of files
11861
11862 qprev
11863 print the name of the preceding applied patch:
11864
11865 hg qprev [-s]
11866
11867 Returns 0 on success.
11868
11869 Options:
11870
11871 -s, --summary
11872 print first line of patch header
11873
11874 qpush
11875 push the next patch onto the stack:
11876
11877 hg qpush [-f] [-l] [-a] [--move] [PATCH | INDEX]
11878
11879 By default, abort if the working directory contains uncommitted
11880 changes. With --keep-changes, abort only if the uncommitted files over‐
11881 lap with patched files. With -f/--force, backup and patch over uncom‐
11882 mitted changes.
11883
11884 Return 0 on success.
11885
11886 Options:
11887
11888 --keep-changes
11889 tolerate non-conflicting local changes
11890
11891 -f, --force
11892 apply on top of local changes
11893
11894 -e, --exact
11895 apply the target patch to its recorded parent
11896
11897 -l, --list
11898 list patch name in commit text
11899
11900 -a, --all
11901 apply all patches
11902
11903 -m, --merge
11904 merge from another queue (DEPRECATED)
11905
11906 -n,--name <NAME>
11907 merge queue name (DEPRECATED)
11908
11909 --move reorder patch series and apply only the patch
11910
11911 --no-backup
11912 do not save backup copies of files
11913
11914 qqueue
11915 manage multiple patch queues:
11916
11917 hg qqueue [OPTION] [QUEUE]
11918
11919 Supports switching between different patch queues, as well as creating
11920 new patch queues and deleting existing ones.
11921
11922 Omitting a queue name or specifying -l/--list will show you the regis‐
11923 tered queues - by default the "normal" patches queue is registered. The
11924 currently active queue will be marked with "(active)". Specifying --ac‐
11925 tive will print only the name of the active queue.
11926
11927 To create a new queue, use -c/--create. The queue is automatically made
11928 active, except in the case where there are applied patches from the
11929 currently active queue in the repository. Then the queue will only be
11930 created and switching will fail.
11931
11932 To delete an existing queue, use --delete. You cannot delete the cur‐
11933 rently active queue.
11934
11935 Returns 0 on success.
11936
11937 Options:
11938
11939 -l, --list
11940 list all available queues
11941
11942 --active
11943 print name of active queue
11944
11945 -c, --create
11946 create new queue
11947
11948 --rename
11949 rename active queue
11950
11951 --delete
11952 delete reference to queue
11953
11954 --purge
11955 delete queue, and remove patch dir
11956
11957 qrename
11958 rename a patch:
11959
11960 hg qrename PATCH1 [PATCH2]
11961
11962 With one argument, renames the current patch to PATCH1. With two argu‐
11963 ments, renames PATCH1 to PATCH2.
11964
11965 Returns 0 on success.
11966
11967 aliases: qmv
11968
11969 qrestore
11970 restore the queue state saved by a revision (DEPRECATED):
11971
11972 hg qrestore [-d] [-u] REV
11973
11974 This command is deprecated, use hg rebase instead.
11975
11976 Options:
11977
11978 -d, --delete
11979 delete save entry
11980
11981 -u, --update
11982 update queue working directory
11983
11984 qsave
11985 save current queue state (DEPRECATED):
11986
11987 hg qsave [-m TEXT] [-l FILE] [-c] [-n NAME] [-e] [-f]
11988
11989 This command is deprecated, use hg rebase instead.
11990
11991 Options:
11992
11993 -c, --copy
11994 copy patch directory
11995
11996 -n,--name <NAME>
11997 copy directory name
11998
11999 -e, --empty
12000 clear queue status file
12001
12002 -f, --force
12003 force copy
12004
12005 -m,--message <TEXT>
12006 use text as commit message
12007
12008 -l,--logfile <FILE>
12009 read commit message from file
12010
12011 qselect
12012 set or print guarded patches to push:
12013
12014 hg qselect [OPTION]... [GUARD]...
12015
12016 Use the hg qguard command to set or print guards on patch, then use qs‐
12017 elect to tell mq which guards to use. A patch will be pushed if it has
12018 no guards or any positive guards match the currently selected guard,
12019 but will not be pushed if any negative guards match the current guard.
12020 For example:
12021
12022 qguard foo.patch -- -stable (negative guard)
12023 qguard bar.patch +stable (positive guard)
12024 qselect stable
12025
12026 This activates the "stable" guard. mq will skip foo.patch (because it
12027 has a negative match) but push bar.patch (because it has a positive
12028 match).
12029
12030 With no arguments, prints the currently active guards. With one argu‐
12031 ment, sets the active guard.
12032
12033 Use -n/--none to deactivate guards (no other arguments needed). When
12034 no guards are active, patches with positive guards are skipped and
12035 patches with negative guards are pushed.
12036
12037 qselect can change the guards on applied patches. It does not pop
12038 guarded patches by default. Use --pop to pop back to the last applied
12039 patch that is not guarded. Use --reapply (which implies --pop) to push
12040 back to the current patch afterwards, but skip guarded patches.
12041
12042 Use -s/--series to print a list of all guards in the series file (no
12043 other arguments needed). Use -v for more information.
12044
12045 Returns 0 on success.
12046
12047 Options:
12048
12049 -n, --none
12050 disable all guards
12051
12052 -s, --series
12053 list all guards in series file
12054
12055 --pop pop to before first guarded applied patch
12056
12057 --reapply
12058 pop, then reapply patches
12059
12060 qseries
12061 print the entire series file:
12062
12063 hg qseries [-ms]
12064
12065 Returns 0 on success.
12066
12067 Options:
12068
12069 -m, --missing
12070 print patches not in series
12071
12072 -s, --summary
12073 print first line of patch header
12074
12075 qtop
12076 print the name of the current patch:
12077
12078 hg qtop [-s]
12079
12080 Returns 0 on success.
12081
12082 Options:
12083
12084 -s, --summary
12085 print first line of patch header
12086
12087 qunapplied
12088 print the patches not yet applied:
12089
12090 hg qunapplied [-1] [-s] [PATCH]
12091
12092 Returns 0 on success.
12093
12094 Options:
12095
12096 -1, --first
12097 show only the first patch
12098
12099 -s, --summary
12100 print first line of patch header
12101
12102 File content management
12103 qdiff
12104 diff of the current patch and subsequent modifications:
12105
12106 hg qdiff [OPTION]... [FILE]...
12107
12108 Shows a diff which includes the current patch as well as any changes
12109 which have been made in the working directory since the last refresh
12110 (thus showing what the current patch would become after a qrefresh).
12111
12112 Use hg diff if you only want to see the changes made since the last
12113 qrefresh, or hg export qtip if you want to see changes made by the cur‐
12114 rent patch without including changes made since the qrefresh.
12115
12116 Returns 0 on success.
12117
12118 Options:
12119
12120 -a, --text
12121 treat all files as text
12122
12123 -g, --git
12124 use git extended diff format (DEFAULT: diff.git)
12125
12126 --binary
12127 generate binary diffs in git mode (default)
12128
12129 --nodates
12130 omit dates from diff headers
12131
12132 --noprefix
12133 omit a/ and b/ prefixes from filenames
12134
12135 -p, --show-function
12136 show which function each change is in (DEFAULT: diff.showfunc)
12137
12138 --reverse
12139 produce a diff that undoes the changes
12140
12141 -w, --ignore-all-space
12142 ignore white space when comparing lines
12143
12144 -b, --ignore-space-change
12145 ignore changes in the amount of white space
12146
12147 -B, --ignore-blank-lines
12148 ignore changes whose lines are all blank
12149
12150 -Z, --ignore-space-at-eol
12151 ignore changes in whitespace at EOL
12152
12153 -U,--unified <NUM>
12154 number of lines of context to show
12155
12156 --stat output diffstat-style summary of changes
12157
12158 --root <DIR>
12159 produce diffs relative to subdirectory
12160
12161 -I,--include <PATTERN[+]>
12162 include names matching the given patterns
12163
12164 -X,--exclude <PATTERN[+]>
12165 exclude names matching the given patterns
12166
12167 [+] marked option can be specified multiple times
12168
12169 Change import/export
12170 qimport
12171 import a patch or existing changeset:
12172
12173 hg qimport [-e] [-n NAME] [-f] [-g] [-P] [-r REV]... [FILE]...
12174
12175 The patch is inserted into the series after the last applied patch. If
12176 no patches have been applied, qimport prepends the patch to the series.
12177
12178 The patch will have the same name as its source file unless you give it
12179 a new one with -n/--name.
12180
12181 You can register an existing patch inside the patch directory with the
12182 -e/--existing flag.
12183
12184 With -f/--force, an existing patch of the same name will be overwrit‐
12185 ten.
12186
12187 An existing changeset may be placed under mq control with -r/--rev
12188 (e.g. qimport --rev . -n patch will place the current revision under mq
12189 control). With -g/--git, patches imported with --rev will use the git
12190 diff format. See the diffs help topic for information on why this is
12191 important for preserving rename/copy information and permission
12192 changes. Use hg qfinish to remove changesets from mq control.
12193
12194 To import a patch from standard input, pass - as the patch file. When
12195 importing from standard input, a patch name must be specified using the
12196 --name flag.
12197
12198 To import an existing patch while renaming it:
12199
12200 hg qimport -e existing-patch -n new-name
12201
12202 Returns 0 if import succeeded.
12203
12204 Options:
12205
12206 -e, --existing
12207 import file in patch directory
12208
12209 -n,--name <NAME>
12210 name of patch file
12211
12212 -f, --force
12213 overwrite existing files
12214
12215 -r,--rev <REV[+]>
12216 place existing revisions under mq control
12217
12218 -g, --git
12219 use git extended diff format
12220
12221 -P, --push
12222 qpush after importing
12223
12224 [+] marked option can be specified multiple times
12225
12226 narrow
12227 create clones which fetch history data for subset of files (EXPERIMEN‐
12228 TAL)
12229
12230 Commands
12231 Repository maintenance
12232 tracked
12233 show or change the current narrowspec:
12234
12235 hg tracked [OPTIONS]... [REMOTE]
12236
12237 With no argument, shows the current narrowspec entries, one per line.
12238 Each line will be prefixed with 'I' or 'X' for included or excluded
12239 patterns, respectively.
12240
12241 The narrowspec is comprised of expressions to match remote files and/or
12242 directories that should be pulled into your client. The narrowspec has
12243 include and exclude expressions, with excludes always trumping in‐
12244 cludes: that is, if a file matches an exclude expression, it will be
12245 excluded even if it also matches an include expression. Excluding
12246 files that were never included has no effect.
12247
12248 Each included or excluded entry is in the format described by 'hg help
12249 patterns'.
12250
12251 The options allow you to add or remove included and excluded expres‐
12252 sions.
12253
12254 If --clear is specified, then all previous includes and excludes are
12255 DROPPED and replaced by the new ones specified to --addinclude and
12256 --addexclude. If --clear is specified without any further options, the
12257 narrowspec will be empty and will not match any files.
12258
12259 If --auto-remove-includes is specified, then those includes that don't
12260 match any files modified by currently visible local commits (those not
12261 shared by the remote) will be added to the set of explicitly specified
12262 includes to remove.
12263
12264 --import-rules accepts a path to a file containing rules, allowing you
12265 to add --addinclude, --addexclude rules in bulk. Like the other include
12266 and exclude switches, the changes are applied immediately.
12267
12268 Options:
12269
12270 --addinclude <VALUE[+]>
12271 new paths to include
12272
12273 --removeinclude <VALUE[+]>
12274 old paths to no longer include
12275
12276 --auto-remove-includes
12277 automatically choose unused includes to remove
12278
12279 --addexclude <VALUE[+]>
12280 new paths to exclude
12281
12282 --import-rules <VALUE>
12283 import narrowspecs from a file
12284
12285 --removeexclude <VALUE[+]>
12286 old paths to no longer exclude
12287
12288 --clear
12289 whether to replace the existing narrowspec
12290
12291 --force-delete-local-changes
12292 forces deletion of local changes when narrowing
12293
12294 --update-working-copy
12295 update working copy when the store has changed
12296
12297 -e,--ssh <CMD>
12298 specify ssh command to use
12299
12300 --remotecmd <CMD>
12301 specify hg command to run on the remote side
12302
12303 --insecure
12304 do not verify server certificate (ignoring web.cacerts config)
12305
12306 [+] marked option can be specified multiple times
12307
12308 notify
12309 hooks for sending email push notifications
12310
12311 This extension implements hooks to send email notifications when
12312 changesets are sent from or received by the local repository.
12313
12314 First, enable the extension as explained in hg help extensions, and
12315 register the hook you want to run. incoming and changegroup hooks are
12316 run when changesets are received, while outgoing hooks are for change‐
12317 sets sent to another repository:
12318
12319 [hooks]
12320 # one email for each incoming changeset
12321 incoming.notify = python:hgext.notify.hook
12322 # one email for all incoming changesets
12323 changegroup.notify = python:hgext.notify.hook
12324
12325 # one email for all outgoing changesets
12326 outgoing.notify = python:hgext.notify.hook
12327
12328 This registers the hooks. To enable notification, subscribers must be
12329 assigned to repositories. The [usersubs] section maps multiple reposi‐
12330 tories to a given recipient. The [reposubs] section maps multiple re‐
12331 cipients to a single repository:
12332
12333 [usersubs]
12334 # key is subscriber email, value is a comma-separated list of repo patterns
12335 user@host = pattern
12336
12337 [reposubs]
12338 # key is repo pattern, value is a comma-separated list of subscriber emails
12339 pattern = user@host
12340
12341 A pattern is a glob matching the absolute path to a repository, option‐
12342 ally combined with a revset expression. A revset expression, if
12343 present, is separated from the glob by a hash. Example:
12344
12345 [reposubs]
12346 */widgets#branch(release) = qa-team@example.com
12347
12348 This sends to qa-team@example.com whenever a changeset on the release
12349 branch triggers a notification in any repository ending in widgets.
12350
12351 In order to place them under direct user management, [usersubs] and
12352 [reposubs] sections may be placed in a separate hgrc file and incorpo‐
12353 rated by reference:
12354
12355 [notify]
12356 config = /path/to/subscriptionsfile
12357
12358 Notifications will not be sent until the notify.test value is set to
12359 False; see below.
12360
12361 Notifications content can be tweaked with the following configuration
12362 entries:
12363
12364 notify.test
12365 If True, print messages to stdout instead of sending them. De‐
12366 fault: True.
12367
12368 notify.sources
12369 Space-separated list of change sources. Notifications are acti‐
12370 vated only when a changeset's source is in this list. Sources
12371 may be:
12372
12373 serve
12374
12375 changesets received via http or ssh
12376
12377 pull
12378
12379 changesets received via hg pull
12380
12381 unbundle
12382
12383 changesets received via hg unbundle
12384
12385 push
12386
12387 changesets sent or received via hg push
12388
12389 bundle
12390
12391 changesets sent via hg unbundle
12392
12393 Default: serve.
12394
12395 notify.strip
12396 Number of leading slashes to strip from url paths. By default,
12397 notifications reference repositories with their absolute path.
12398 notify.strip lets you turn them into relative paths. For exam‐
12399 ple, notify.strip=3 will change /long/path/repository into
12400 repository. Default: 0.
12401
12402 notify.domain
12403 Default email domain for sender or recipients with no explicit
12404 domain. It is also used for the domain part of the Message-Id
12405 when using notify.messageidseed.
12406
12407 notify.messageidseed
12408 Create deterministic Message-Id headers for the mails based on
12409 the seed and the revision identifier of the first commit in the
12410 changeset.
12411
12412 notify.style
12413 Style file to use when formatting emails.
12414
12415 notify.template
12416 Template to use when formatting emails.
12417
12418 notify.incoming
12419 Template to use when run as an incoming hook, overriding no‐
12420 tify.template.
12421
12422 notify.outgoing
12423 Template to use when run as an outgoing hook, overriding no‐
12424 tify.template.
12425
12426 notify.changegroup
12427 Template to use when running as a changegroup hook, overriding
12428 notify.template.
12429
12430 notify.maxdiff
12431 Maximum number of diff lines to include in notification email.
12432 Set to 0 to disable the diff, or -1 to include all of it. De‐
12433 fault: 300.
12434
12435 notify.maxdiffstat
12436 Maximum number of diffstat lines to include in notification
12437 email. Set to -1 to include all of it. Default: -1.
12438
12439 notify.maxsubject
12440 Maximum number of characters in email's subject line. Default:
12441 67.
12442
12443 notify.diffstat
12444 Set to True to include a diffstat before diff content. Default:
12445 True.
12446
12447 notify.showfunc
12448 If set, override diff.showfunc for the diff content. Default:
12449 None.
12450
12451 notify.merge
12452 If True, send notifications for merge changesets. Default: True.
12453
12454 notify.mbox
12455 If set, append mails to this mbox file instead of sending. De‐
12456 fault: None.
12457
12458 notify.fromauthor
12459 If set, use the committer of the first changeset in a change‐
12460 group for the "From" field of the notification mail. If not set,
12461 take the user from the pushing repo. Default: False.
12462
12463 notify.reply-to-predecessor (EXPERIMENTAL)
12464 If set and the changeset has a predecessor in the repository,
12465 try to thread the notification mail with the predecessor. This
12466 adds the "In-Reply-To" header to the notification mail with a
12467 reference to the predecessor with the smallest revision number.
12468 Mail threads can still be torn, especially when changesets are
12469 folded.
12470
12471 This option must be used in combination with notify.messageid‐
12472 seed.
12473
12474 If set, the following entries will also be used to customize the noti‐
12475 fications:
12476
12477 email.from
12478 Email From address to use if none can be found in the generated
12479 email content.
12480
12481 web.baseurl
12482 Root repository URL to combine with repository paths when making
12483 references. See also notify.strip.
12484
12485 pager
12486 browse command output with an external pager (DEPRECATED)
12487
12488 Forcibly enable paging for individual commands that don't typically re‐
12489 quest pagination with the attend-<command> option. This setting takes
12490 precedence over ignore options and defaults:
12491
12492 [pager]
12493 attend-cat = false
12494
12495 patchbomb
12496 command to send changesets as (a series of) patch emails
12497
12498 The series is started off with a "[PATCH 0 of N]" introduction, which
12499 describes the series as a whole.
12500
12501 Each patch email has a Subject line of "[PATCH M of N] ...", using the
12502 first line of the changeset description as the subject text. The mes‐
12503 sage contains two or three body parts:
12504
12505 • The changeset description.
12506
12507 • [Optional] The result of running diffstat on the patch.
12508
12509 • The patch itself, as generated by hg export.
12510
12511 Each message refers to the first in the series using the In-Reply-To
12512 and References headers, so they will show up as a sequence in threaded
12513 mail and news readers, and in mail archives.
12514
12515 To configure other defaults, add a section like this to your configura‐
12516 tion file:
12517
12518 [email]
12519 from = My Name <my@email>
12520 to = recipient1, recipient2, ...
12521 cc = cc1, cc2, ...
12522 bcc = bcc1, bcc2, ...
12523 reply-to = address1, address2, ...
12524
12525 Use [patchbomb] as configuration section name if you need to override
12526 global [email] address settings.
12527
12528 Then you can use the hg email command to mail a series of changesets as
12529 a patchbomb.
12530
12531 You can also either configure the method option in the email section to
12532 be a sendmail compatible mailer or fill out the [smtp] section so that
12533 the patchbomb extension can automatically send patchbombs directly from
12534 the commandline. See the [email] and [smtp] sections in hgrc(5) for de‐
12535 tails.
12536
12537 By default, hg email will prompt for a To or CC header if you do not
12538 supply one via configuration or the command line. You can override
12539 this to never prompt by configuring an empty value:
12540
12541 [email]
12542 cc =
12543
12544 You can control the default inclusion of an introduction message with
12545 the patchbomb.intro configuration option. The configuration is always
12546 overwritten by command line flags like --intro and --desc:
12547
12548 [patchbomb]
12549 intro=auto # include introduction message if more than 1 patch (default)
12550 intro=never # never include an introduction message
12551 intro=always # always include an introduction message
12552
12553 You can specify a template for flags to be added in subject prefixes.
12554 Flags specified by --flag option are exported as {flags} keyword:
12555
12556 [patchbomb]
12557 flagtemplate = "{separate(' ',
12558 ifeq(branch, 'default', '', branch|upper),
12559 flags)}"
12560
12561 You can set patchbomb to always ask for confirmation by setting patch‐
12562 bomb.confirm to true.
12563
12564 Commands
12565 Change import/export
12566 email
12567 send changesets by email:
12568
12569 hg email [OPTION]... [DEST]...
12570
12571 By default, diffs are sent in the format generated by hg export, one
12572 per message. The series starts with a "[PATCH 0 of N]" introduction,
12573 which describes the series as a whole.
12574
12575 Each patch email has a Subject line of "[PATCH M of N] ...", using the
12576 first line of the changeset description as the subject text. The mes‐
12577 sage contains two or three parts. First, the changeset description.
12578
12579 With the -d/--diffstat option, if the diffstat program is installed,
12580 the result of running diffstat on the patch is inserted.
12581
12582 Finally, the patch itself, as generated by hg export.
12583
12584 With the -d/--diffstat or --confirm options, you will be presented with
12585 a final summary of all messages and asked for confirmation before the
12586 messages are sent.
12587
12588 By default the patch is included as text in the email body for easy re‐
12589 viewing. Using the -a/--attach option will instead create an attachment
12590 for the patch. With -i/--inline an inline attachment will be created.
12591 You can include a patch both as text in the email body and as a regular
12592 or an inline attachment by combining the -a/--attach or -i/--inline
12593 with the --body option.
12594
12595 With -B/--bookmark changesets reachable by the given bookmark are se‐
12596 lected.
12597
12598 With -o/--outgoing, emails will be generated for patches not found in
12599 the destination repository (or only those which are ancestors of the
12600 specified revisions if any are provided)
12601
12602 With -b/--bundle, changesets are selected as for --outgoing, but a sin‐
12603 gle email containing a binary Mercurial bundle as an attachment will be
12604 sent. Use the patchbomb.bundletype config option to control the bundle
12605 type as with hg bundle --type.
12606
12607 With -m/--mbox, instead of previewing each patchbomb message in a pager
12608 or sending the messages directly, it will create a UNIX mailbox file
12609 with the patch emails. This mailbox file can be previewed with any mail
12610 user agent which supports UNIX mbox files.
12611
12612 With -n/--test, all steps will run, but mail will not be sent. You
12613 will be prompted for an email recipient address, a subject and an in‐
12614 troductory message describing the patches of your patchbomb. Then when
12615 all is done, patchbomb messages are displayed.
12616
12617 In case email sending fails, you will find a backup of your series in‐
12618 troductory message in .hg/last-email.txt.
12619
12620 The default behavior of this command can be customized through configu‐
12621 ration. (See hg help patchbomb for details)
12622
12623 Examples:
12624
12625 hg email -r 3000 # send patch 3000 only
12626 hg email -r 3000 -r 3001 # send patches 3000 and 3001
12627 hg email -r 3000:3005 # send patches 3000 through 3005
12628 hg email 3000 # send patch 3000 (deprecated)
12629
12630 hg email -o # send all patches not in default
12631 hg email -o DEST # send all patches not in DEST
12632 hg email -o -r 3000 # send all ancestors of 3000 not in default
12633 hg email -o -r 3000 DEST # send all ancestors of 3000 not in DEST
12634
12635 hg email -B feature # send all ancestors of feature bookmark
12636
12637 hg email -b # send bundle of all patches not in default
12638 hg email -b DEST # send bundle of all patches not in DEST
12639 hg email -b -r 3000 # bundle of all ancestors of 3000 not in default
12640 hg email -b -r 3000 DEST # bundle of all ancestors of 3000 not in DEST
12641
12642 hg email -o -m mbox && # generate an mbox file...
12643 mutt -R -f mbox # ... and view it with mutt
12644 hg email -o -m mbox && # generate an mbox file ...
12645 formail -s sendmail \ # ... and use formail to send from the mbox
12646 -bm -t < mbox # ... using sendmail
12647
12648 Before using this command, you will need to enable email in your hgrc.
12649 See the [email] section in hgrc(5) for details.
12650
12651 Options:
12652
12653 -g, --git
12654 use git extended diff format
12655
12656 --plain
12657 omit hg patch header
12658
12659 -o, --outgoing
12660 send changes not found in the target repository
12661
12662 -b, --bundle
12663 send changes not in target as a binary bundle
12664
12665 -B,--bookmark <BOOKMARK>
12666 send changes only reachable by given bookmark
12667
12668 --bundlename <NAME>
12669 name of the bundle attachment file (default: bundle)
12670
12671 -r,--rev <REV[+]>
12672 a revision to send
12673
12674 --force
12675 run even when remote repository is unrelated (with -b/--bundle)
12676
12677 --base <REV[+]>
12678 a base changeset to specify instead of a destination (with
12679 -b/--bundle)
12680
12681 --intro
12682 send an introduction email for a single patch
12683
12684 --body send patches as inline message text (default)
12685
12686 -a, --attach
12687 send patches as attachments
12688
12689 -i, --inline
12690 send patches as inline attachments
12691
12692 --bcc <EMAIL[+]>
12693 email addresses of blind carbon copy recipients
12694
12695 -c,--cc <EMAIL[+]>
12696 email addresses of copy recipients
12697
12698 --confirm
12699 ask for confirmation before sending
12700
12701 -d, --diffstat
12702 add diffstat output to messages
12703
12704 --date <DATE>
12705 use the given date as the sending date
12706
12707 --desc <FILE>
12708 use the given file as the series description
12709
12710 -f,--from <EMAIL>
12711 email address of sender
12712
12713 -n, --test
12714 print messages that would be sent
12715
12716 -m,--mbox <FILE>
12717 write messages to mbox file instead of sending them
12718
12719 --reply-to <EMAIL[+]>
12720 email addresses replies should be sent to
12721
12722 -s,--subject <TEXT>
12723 subject of first message (intro or single patch)
12724
12725 --in-reply-to <MSGID>
12726 message identifier to reply to
12727
12728 --flag <FLAG[+]>
12729 flags to add in subject prefixes
12730
12731 -t,--to <EMAIL[+]>
12732 email addresses of recipients
12733
12734 -e,--ssh <CMD>
12735 specify ssh command to use
12736
12737 --remotecmd <CMD>
12738 specify hg command to run on the remote side
12739
12740 --insecure
12741 do not verify server certificate (ignoring web.cacerts config)
12742
12743 [+] marked option can be specified multiple times
12744
12745 phabricator
12746 simple Phabricator integration (EXPERIMENTAL)
12747
12748 This extension provides a phabsend command which sends a stack of
12749 changesets to Phabricator, and a phabread command which prints a stack
12750 of revisions in a format suitable for hg import, and a phabupdate com‐
12751 mand to update statuses in batch.
12752
12753 A "phabstatus" view for hg show is also provided; it displays status
12754 information of Phabricator differentials associated with unfinished
12755 changesets.
12756
12757 By default, Phabricator requires Test Plan which might prevent some
12758 changeset from being sent. The requirement could be disabled by chang‐
12759 ing differential.require-test-plan-field config server side.
12760
12761 Config:
12762
12763 [phabricator]
12764 # Phabricator URL
12765 url = https://phab.example.com/
12766
12767 # Repo callsign. If a repo has a URL https://$HOST/diffusion/FOO, then its
12768 # callsign is "FOO".
12769 callsign = FOO
12770
12771 # curl command to use. If not set (default), use builtin HTTP library to
12772 # communicate. If set, use the specified curl command. This could be useful
12773 # if you need to specify advanced options that is not easily supported by
12774 # the internal library.
12775 curlcmd = curl --connect-timeout 2 --retry 3 --silent
12776
12777 # retry failed command N time (default 0). Useful when using the extension
12778 # over flakly connection.
12779 #
12780 # We wait `retry.interval` between each retry, in seconds.
12781 # (default 1 second).
12782 retry = 3
12783 retry.interval = 10
12784
12785 # the retry option can combine well with the http.timeout one.
12786 #
12787 # For example to give up on http request after 20 seconds:
12788 [http]
12789 timeout=20
12790
12791 [auth]
12792 example.schemes = https
12793 example.prefix = phab.example.com
12794
12795 # API token. Get it from https://$HOST/conduit/login/
12796 example.phabtoken = cli-xxxxxxxxxxxxxxxxxxxxxxxxxxxx
12797
12798 Commands
12799 Change import/export
12800 phabimport
12801 import patches from Phabricator for the specified Differential Revi‐
12802 sions:
12803
12804 hg phabimport DREVSPEC... [OPTIONS]
12805
12806 The patches are read and applied starting at the parent of the working
12807 directory.
12808
12809 See hg help phabread for how to specify DREVSPEC.
12810
12811 Options:
12812
12813 --stack
12814 import dependencies as well
12815
12816 --test-vcr <VALUE>
12817 Path to a vcr file. If nonexistent, will record a new vcr tran‐
12818 script, otherwise will mock all http requests using the speci‐
12819 fied vcr file. (ADVANCED)
12820
12821 phabread
12822 print patches from Phabricator suitable for importing:
12823
12824 hg phabread DREVSPEC... [OPTIONS]
12825
12826 DREVSPEC could be a Differential Revision identity, like D123, or just
12827 the number 123. It could also have common operators like +, -, &, (, )
12828 for complex queries. Prefix : could be used to select a stack. If mul‐
12829 tiple DREVSPEC values are given, the result is the union of each indi‐
12830 vidually evaluated value. No attempt is currently made to reorder the
12831 values to run from parent to child.
12832
12833 abandoned, accepted, closed, needsreview, needsrevision could be used
12834 to filter patches by status. For performance reason, they only repre‐
12835 sent a subset of non-status selections and cannot be used alone.
12836
12837 For example, :D6+8-(2+D4) selects a stack up to D6, plus D8 and exclude
12838 D2 and D4. :D9 & needsreview selects "Needs Review" revisions in a
12839 stack up to D9.
12840
12841 If --stack is given, follow dependencies information and read all
12842 patches. It is equivalent to the : operator.
12843
12844 Options:
12845
12846 --stack
12847 read dependencies
12848
12849 --test-vcr <VALUE>
12850 Path to a vcr file. If nonexistent, will record a new vcr tran‐
12851 script, otherwise will mock all http requests using the speci‐
12852 fied vcr file. (ADVANCED)
12853
12854 phabsend
12855 upload changesets to Phabricator:
12856
12857 hg phabsend REV [OPTIONS]
12858
12859 If there are multiple revisions specified, they will be send as a stack
12860 with a linear dependencies relationship using the order specified by
12861 the revset.
12862
12863 For the first time uploading changesets, local tags will be created to
12864 maintain the association. After the first time, phabsend will check ob‐
12865 sstore and tags information so it can figure out whether to update an
12866 existing Differential Revision, or create a new one.
12867
12868 If --amend is set, update commit messages so they have the Differential
12869 Revision URL, remove related tags. This is similar to what arcanist
12870 will do, and is more desired in author-push workflows. Otherwise, use
12871 local tags to record the Differential Revision association.
12872
12873 The --confirm option lets you confirm changesets before sending them.
12874 You can also add following to your configuration file to make it de‐
12875 fault behaviour:
12876
12877 [phabsend]
12878 confirm = true
12879
12880 By default, a separate review will be created for each commit that is
12881 selected, and will have the same parent/child relationship in Phabrica‐
12882 tor. If --fold is set, multiple commits are rolled up into a single
12883 review as if diffed from the parent of the first revision to the last.
12884 The commit messages are concatenated in the summary field on Phabrica‐
12885 tor.
12886
12887 phabsend will check obsstore and the above association to decide
12888 whether to update an existing Differential Revision, or create a new
12889 one.
12890
12891 Options:
12892
12893 -r,--rev <REV[+]>
12894 revisions to send
12895
12896 --amend
12897 update commit messages (default: True)
12898
12899 --reviewer <VALUE[+]>
12900 specify reviewers
12901
12902 --blocker <VALUE[+]>
12903 specify blocking reviewers
12904
12905 -m,--comment <VALUE>
12906 add a comment to Revisions with new/updated Diffs
12907
12908 --confirm
12909 ask for confirmation before sending
12910
12911 --fold combine the revisions into one review
12912
12913 --test-vcr <VALUE>
12914 Path to a vcr file. If nonexistent, will record a new vcr tran‐
12915 script, otherwise will mock all http requests using the speci‐
12916 fied vcr file. (ADVANCED)
12917
12918 [+] marked option can be specified multiple times
12919
12920 phabupdate
12921 update Differential Revision in batch:
12922
12923 hg phabupdate [DREVSPEC...| -r REV...] [OPTIONS]
12924
12925 DREVSPEC selects revisions. See hg help phabread for its usage.
12926
12927 Options:
12928
12929 --accept
12930 accept revisions
12931
12932 --reject
12933 reject revisions
12934
12935 --request-review
12936 request review on revisions
12937
12938 --abandon
12939 abandon revisions
12940
12941 --reclaim
12942 reclaim revisions
12943
12944 --close
12945 close revisions
12946
12947 --reopen
12948 reopen revisions
12949
12950 --plan-changes
12951 plan changes for revisions
12952
12953 --resign
12954 resign as a reviewer from revisions
12955
12956 --commandeer
12957 commandeer revisions
12958
12959 -m,--comment <VALUE>
12960 comment on the last revision
12961
12962 -r,--rev <REV>
12963 local revision to update
12964
12965 --test-vcr <VALUE>
12966 Path to a vcr file. If nonexistent, will record a new vcr tran‐
12967 script, otherwise will mock all http requests using the speci‐
12968 fied vcr file. (ADVANCED)
12969
12970 Uncategorized commands
12971 purge
12972 command to delete untracked files from the working directory
12973
12974 Commands
12975 Working directory management
12976 purge
12977 removes files not tracked by Mercurial:
12978
12979 hg purge [OPTION]... [DIR]...
12980
12981 Delete files not known to Mercurial. This is useful to test local and
12982 uncommitted changes in an otherwise-clean source tree.
12983
12984 This means that purge will delete the following by default:
12985
12986 • Unknown files: files marked with "?" by hg status
12987
12988 • Empty directories: in fact Mercurial ignores directories unless they
12989 contain files under source control management
12990
12991 But it will leave untouched:
12992
12993 • Modified and unmodified tracked files
12994
12995 • Ignored files (unless -i or --all is specified)
12996
12997 • New files added to the repository (with hg add)
12998
12999 The --files and --dirs options can be used to direct purge to delete
13000 only files, only directories, or both. If neither option is given, both
13001 will be deleted.
13002
13003 If directories are given on the command line, only files in these di‐
13004 rectories are considered.
13005
13006 Be careful with purge, as you could irreversibly delete some files you
13007 forgot to add to the repository. If you only want to print the list of
13008 files that this program would delete, use the --print option.
13009
13010 Options:
13011
13012 -a, --abort-on-err
13013 abort if an error occurs
13014
13015 --all purge ignored files too
13016
13017 -i, --ignored
13018 purge only ignored files
13019
13020 --dirs purge empty directories
13021
13022 --files
13023 purge files
13024
13025 -p, --print
13026 print filenames instead of deleting them
13027
13028 -0, --print0
13029 end filenames with NUL, for use with xargs (implies -p/--print)
13030
13031 -I,--include <PATTERN[+]>
13032 include names matching the given patterns
13033
13034 -X,--exclude <PATTERN[+]>
13035 exclude names matching the given patterns
13036
13037 [+] marked option can be specified multiple times
13038
13039 aliases: clean
13040
13041 rebase
13042 command to move sets of revisions to a different ancestor
13043
13044 This extension lets you rebase changesets in an existing Mercurial
13045 repository.
13046
13047 For more information: https://mercurial-scm.org/wiki/RebaseExtension
13048
13049 Commands
13050 Change manipulation
13051 rebase
13052 move changeset (and descendants) to a different branch:
13053
13054 hg rebase [[-s REV]... | [-b REV]... | [-r REV]...] [-d REV] [OPTION]...
13055
13056 Rebase uses repeated merging to graft changesets from one part of his‐
13057 tory (the source) onto another (the destination). This can be useful
13058 for linearizing local changes relative to a master development tree.
13059
13060 Published commits cannot be rebased (see hg help phases). To copy com‐
13061 mits, see hg help graft.
13062
13063 If you don't specify a destination changeset (-d/--dest), rebase will
13064 use the same logic as hg merge to pick a destination. if the current
13065 branch contains exactly one other head, the other head is merged with
13066 by default. Otherwise, an explicit revision with which to merge with
13067 must be provided. (destination changeset is not modified by rebasing,
13068 but new changesets are added as its descendants.)
13069
13070 Here are the ways to select changesets:
13071
13072 1. Explicitly select them using --rev.
13073
13074 2. Use --source to select a root changeset and include all of its
13075 descendants.
13076
13077 3. Use --base to select a changeset; rebase will find ancestors and
13078 their descendants which are not also ancestors of the destina‐
13079 tion.
13080
13081 4. If you do not specify any of --rev, --source, or --base, rebase
13082 will use --base . as above.
13083
13084 If --source or --rev is used, special names SRC and ALLSRC can be used
13085 in --dest. Destination would be calculated per source revision with SRC
13086 substituted by that single source revision and ALLSRC substituted by
13087 all source revisions.
13088
13089 Rebase will destroy original changesets unless you use --keep. It will
13090 also move your bookmarks (even if you do).
13091
13092 Some changesets may be dropped if they do not contribute changes (e.g.
13093 merges from the destination branch).
13094
13095 Unlike merge, rebase will do nothing if you are at the branch tip of a
13096 named branch with two heads. You will need to explicitly specify source
13097 and/or destination.
13098
13099 If you need to use a tool to automate merge/conflict decisions, you can
13100 specify one with --tool, see hg help merge-tools. As a caveat: the
13101 tool will not be used to mediate when a file was deleted, there is no
13102 hook presently available for this.
13103
13104 If a rebase is interrupted to manually resolve a conflict, it can be
13105 continued with --continue/-c, aborted with --abort/-a, or stopped with
13106 --stop.
13107
13108 Examples:
13109
13110 • move "local changes" (current commit back to branching point) to the
13111 current branch tip after a pull:
13112
13113 hg rebase
13114
13115 • move a single changeset to the stable branch:
13116
13117 hg rebase -r 5f493448 -d stable
13118
13119 • splice a commit and all its descendants onto another part of history:
13120
13121 hg rebase --source c0c3 --dest 4cf9
13122
13123 • rebase everything on a branch marked by a bookmark onto the default
13124 branch:
13125
13126 hg rebase --base myfeature --dest default
13127
13128 • collapse a sequence of changes into a single commit:
13129
13130 hg rebase --collapse -r 1520:1525 -d .
13131
13132 • move a named branch while preserving its name:
13133
13134 hg rebase -r "branch(featureX)" -d 1.3 --keepbranches
13135
13136 • stabilize orphaned changesets so history looks linear:
13137
13138 hg rebase -r 'orphan()-obsolete()' -d 'first(max((successors(max(roots(ALLSRC) & ::SRC)^)-obsolete())::) + max(::((roots(ALLSRC) & ::SRC)^)-obsolete()))'
13139
13140 Configuration Options:
13141
13142 You can make rebase require a destination if you set the following con‐
13143 fig option:
13144
13145 [commands]
13146 rebase.requiredest = True
13147
13148 By default, rebase will close the transaction after each commit. For
13149 performance purposes, you can configure rebase to use a single transac‐
13150 tion across the entire rebase. WARNING: This setting introduces a sig‐
13151 nificant risk of losing the work you've done in a rebase if the rebase
13152 aborts unexpectedly:
13153
13154 [rebase]
13155 singletransaction = True
13156
13157 By default, rebase writes to the working copy, but you can configure it
13158 to run in-memory for better performance. When the rebase is not moving
13159 the parent(s) of the working copy (AKA the "currently checked out
13160 changesets"), this may also allow it to run even if the working copy is
13161 dirty:
13162
13163 [rebase]
13164 experimental.inmemory = True
13165
13166 Return Values:
13167
13168 Returns 0 on success, 1 if nothing to rebase or there are unresolved
13169 conflicts.
13170
13171 Options:
13172
13173 -s,--source <REV[+]>
13174 rebase the specified changesets and their descendants
13175
13176 -b,--base <REV[+]>
13177 rebase everything from branching point of specified changeset
13178
13179 -r,--rev <REV[+]>
13180 rebase these revisions
13181
13182 -d,--dest <REV>
13183 rebase onto the specified changeset
13184
13185 --collapse
13186 collapse the rebased changesets
13187
13188 -m,--message <TEXT>
13189 use text as collapse commit message
13190
13191 -e, --edit
13192 invoke editor on commit messages
13193
13194 -l,--logfile <FILE>
13195 read collapse commit message from file
13196
13197 -k, --keep
13198 keep original changesets
13199
13200 --keepbranches
13201 keep original branch names
13202
13203 -D, --detach
13204 (DEPRECATED)
13205
13206 -i, --interactive
13207 (DEPRECATED)
13208
13209 -t,--tool <VALUE>
13210 specify merge tool
13211
13212 --stop stop interrupted rebase
13213
13214 -c, --continue
13215 continue an interrupted rebase
13216
13217 -a, --abort
13218 abort an interrupted rebase
13219
13220 --auto-orphans <VALUE>
13221 automatically rebase orphan revisions in the specified revset
13222 (EXPERIMENTAL)
13223
13224 -n, --dry-run
13225 do not perform actions, just print output
13226
13227 -T,--template <TEMPLATE>
13228 display with template
13229
13230 --confirm
13231 ask before applying actions
13232
13233 [+] marked option can be specified multiple times
13234
13235 record
13236 commands to interactively select changes for commit/qrefresh (DEPRE‐
13237 CATED)
13238
13239 The feature provided by this extension has been moved into core Mercu‐
13240 rial as hg commit --interactive.
13241
13242 Commands
13243 Change creation
13244 qrecord
13245 interactively record a new patch:
13246
13247 hg qrecord [OPTION]... PATCH [FILE]...
13248
13249 See hg help qnew & hg help record for more information and usage.
13250
13251 record
13252 interactively select changes to commit:
13253
13254 hg record [OPTION]... [FILE]...
13255
13256 If a list of files is omitted, all changes reported by hg status will
13257 be candidates for recording.
13258
13259 See hg help dates for a list of formats valid for -d/--date.
13260
13261 If using the text interface (see hg help config), you will be prompted
13262 for whether to record changes to each modified file, and for files with
13263 multiple changes, for each change to use. For each query, the following
13264 responses are possible:
13265
13266 y - record this change
13267 n - skip this change
13268 e - edit this change manually
13269
13270 s - skip remaining changes to this file
13271 f - record remaining changes to this file
13272
13273 d - done, skip remaining changes and files
13274 a - record all changes to all remaining files
13275 q - quit, recording no changes
13276
13277 ? - display help
13278
13279 This command is not available when committing a merge.
13280
13281 Options:
13282
13283 -A, --addremove
13284 mark new/missing files as added/removed before committing
13285
13286 --close-branch
13287 mark a branch head as closed
13288
13289 --amend
13290 amend the parent of the working directory
13291
13292 -s, --secret
13293 use the secret phase for committing
13294
13295 -e, --edit
13296 invoke editor on commit messages
13297
13298 --force-close-branch
13299 forcibly close branch from a non-head changeset (ADVANCED)
13300
13301 -I,--include <PATTERN[+]>
13302 include names matching the given patterns
13303
13304 -X,--exclude <PATTERN[+]>
13305 exclude names matching the given patterns
13306
13307 -m,--message <TEXT>
13308 use text as commit message
13309
13310 -l,--logfile <FILE>
13311 read commit message from file
13312
13313 -d,--date <DATE>
13314 record the specified date as commit date
13315
13316 -u,--user <USER>
13317 record the specified user as committer
13318
13319 -S, --subrepos
13320 recurse into subrepositories
13321
13322 -w, --ignore-all-space
13323 ignore white space when comparing lines
13324
13325 -b, --ignore-space-change
13326 ignore changes in the amount of white space
13327
13328 -B, --ignore-blank-lines
13329 ignore changes whose lines are all blank
13330
13331 -Z, --ignore-space-at-eol
13332 ignore changes in whitespace at EOL
13333
13334 [+] marked option can be specified multiple times
13335
13336 releasenotes
13337 generate release notes from commit messages (EXPERIMENTAL)
13338
13339 It is common to maintain files detailing changes in a project between
13340 releases. Maintaining these files can be difficult and time consuming.
13341 The hg releasenotes command provided by this extension makes the
13342 process simpler by automating it.
13343
13344 Commands
13345 Change navigation
13346 releasenotes
13347 parse release notes from commit messages into an output file:
13348
13349 hg releasenotes [-r REV] [-c] FILE
13350
13351 Given an output file and set of revisions, this command will parse com‐
13352 mit messages for release notes then add them to the output file.
13353
13354 Release notes are defined in commit messages as ReStructuredText direc‐
13355 tives. These have the form:
13356
13357 .. directive:: title
13358
13359 content
13360
13361 Each directive maps to an output section in a generated release notes
13362 file, which itself is ReStructuredText. For example, the .. feature::
13363 directive would map to a New Features section.
13364
13365 Release note directives can be either short-form or long-form. In
13366 short- form, title is omitted and the release note is rendered as a
13367 bullet list. In long form, a sub-section with the title title is added
13368 to the section.
13369
13370 The FILE argument controls the output file to write gathered release
13371 notes to. The format of the file is:
13372
13373 Section 1
13374 =========
13375
13376 ...
13377
13378 Section 2
13379 =========
13380
13381 ...
13382
13383 Only sections with defined release notes are emitted.
13384
13385 If a section only has short-form notes, it will consist of bullet list:
13386
13387 Section
13388 =======
13389
13390 * Release note 1
13391 * Release note 2
13392
13393 If a section has long-form notes, sub-sections will be emitted:
13394
13395 Section
13396 =======
13397
13398 Note 1 Title
13399 ------------
13400
13401 Description of the first long-form note.
13402
13403 Note 2 Title
13404 ------------
13405
13406 Description of the second long-form note.
13407
13408 If the FILE argument points to an existing file, that file will be
13409 parsed for release notes having the format that would be generated by
13410 this command. The notes from the processed commit messages will be
13411 merged into this parsed set.
13412
13413 During release notes merging:
13414
13415 • Duplicate items are automatically ignored
13416
13417 • Items that are different are automatically ignored if the similarity
13418 is greater than a threshold.
13419
13420 This means that the release notes file can be updated independently
13421 from this command and changes should not be lost when running this com‐
13422 mand on that file. A particular use case for this is to tweak the word‐
13423 ing of a release note after it has been added to the release notes
13424 file.
13425
13426 The -c/--check option checks the commit message for invalid admoni‐
13427 tions.
13428
13429 The -l/--list option, presents the user with a list of existing avail‐
13430 able admonitions along with their title. This also includes the custom
13431 admonitions (if any).
13432
13433 Options:
13434
13435 -r,--rev <REV>
13436 revisions to process for release notes
13437
13438 -c, --check
13439 checks for validity of admonitions (if any)
13440
13441 -l, --list
13442 list the available admonitions with their title
13443
13444 Uncategorized commands
13445 relink
13446 recreates hardlinks between repository clones
13447
13448 Commands
13449 Repository maintenance
13450 relink
13451 recreate hardlinks between two repositories:
13452
13453 hg relink [ORIGIN]
13454
13455 When repositories are cloned locally, their data files will be
13456 hardlinked so that they only use the space of a single repository.
13457
13458 Unfortunately, subsequent pulls into either repository will break
13459 hardlinks for any files touched by the new changesets, even if both
13460 repositories end up pulling the same changes.
13461
13462 Similarly, passing --rev to "hg clone" will fail to use any hardlinks,
13463 falling back to a complete copy of the source repository.
13464
13465 This command lets you recreate those hardlinks and reclaim that wasted
13466 space.
13467
13468 This repository will be relinked to share space with ORIGIN, which must
13469 be on the same local disk. If ORIGIN is omitted, looks for "default-re‐
13470 link", then "default", in [paths].
13471
13472 Do not attempt any read operations on this repository while the command
13473 is running. (Both repositories will be locked against writes.)
13474
13475 remotefilelog
13476 remotefilelog causes Mercurial to lazilly fetch file contents (EXPERI‐
13477 MENTAL)
13478
13479 This extension is HIGHLY EXPERIMENTAL. There are NO BACKWARDS COMPATI‐
13480 BILITY GUARANTEES. This means that repositories created with this ex‐
13481 tension may only be usable with the exact version of this exten‐
13482 sion/Mercurial that was used. The extension attempts to enforce this in
13483 order to prevent repository corruption.
13484
13485 remotefilelog works by fetching file contents lazily and storing them
13486 in a cache on the client rather than in revlogs. This allows enormous
13487 histories to be transferred only partially, making them easier to oper‐
13488 ate on.
13489
13490 Configs:
13491
13492 packs.maxchainlen specifies the maximum delta chain length in pack
13493 files
13494
13495 packs.maxpacksize specifies the maximum pack file size
13496
13497 packs.maxpackfilecount specifies the maximum number of packs in the
13498
13499 shared cache (trees only for now)
13500
13501 remotefilelog.backgroundprefetch runs prefetch in background when
13502 True
13503
13504 remotefilelog.bgprefetchrevs specifies revisions to fetch on commit
13505 and
13506
13507 update, and on other commands that use them. Different from
13508 pullprefetch.
13509
13510 remotefilelog.gcrepack does garbage collection during repack when
13511 True
13512
13513 remotefilelog.nodettl specifies maximum TTL of a node in seconds be‐
13514 fore
13515
13516 it is garbage collected
13517
13518 remotefilelog.repackonhggc runs repack on hg gc when True
13519
13520 remotefilelog.prefetchdays specifies the maximum age of a commit in
13521
13522 days after which it is no longer prefetched.
13523
13524 remotefilelog.prefetchdelay specifies delay between background
13525
13526 prefetches in seconds after operations that change the work‐
13527 ing copy parent
13528
13529 remotefilelog.data.gencountlimit constraints the minimum number of
13530 data
13531
13532 pack files required to be considered part of a generation. In
13533 particular, minimum number of packs files > gencountlimit.
13534
13535 remotefilelog.data.generations list for specifying the lower bound
13536 of
13537
13538 each generation of the data pack files. For example, list
13539 ['100MB','1MB'] or ['1MB', '100MB'] will lead to three gener‐
13540 ations: [0, 1MB), [ 1MB, 100MB) and [100MB, infinity).
13541
13542 remotefilelog.data.maxrepackpacks the maximum number of pack files
13543 to
13544
13545 include in an incremental data repack.
13546
13547 remotefilelog.data.repackmaxpacksize the maximum size of a pack file
13548 for
13549
13550 it to be considered for an incremental data repack.
13551
13552 remotefilelog.data.repacksizelimit the maximum total size of pack
13553 files
13554
13555 to include in an incremental data repack.
13556
13557 remotefilelog.history.gencountlimit constraints the minimum number
13558 of
13559
13560 history pack files required to be considered part of a gener‐
13561 ation. In particular, minimum number of packs files > gen‐
13562 countlimit.
13563
13564 remotefilelog.history.generations list for specifying the lower
13565 bound of
13566
13567 each generation of the history pack files. For example, list
13568 [ '100MB', '1MB'] or ['1MB', '100MB'] will lead to three gen‐
13569 erations: [ 0, 1MB), [1MB, 100MB) and [100MB, infinity).
13570
13571 remotefilelog.history.maxrepackpacks the maximum number of pack
13572 files to
13573
13574 include in an incremental history repack.
13575
13576 remotefilelog.history.repackmaxpacksize the maximum size of a pack
13577 file
13578
13579 for it to be considered for an incremental history repack.
13580
13581 remotefilelog.history.repacksizelimit the maximum total size of pack
13582
13583 files to include in an incremental history repack.
13584
13585 remotefilelog.backgroundrepack automatically consolidate packs in
13586 the
13587
13588 background
13589
13590 remotefilelog.cachepath path to cache
13591
13592 remotefilelog.cachegroup if set, make cache directory sgid to this
13593
13594 group
13595
13596 remotefilelog.cacheprocess binary to invoke for fetching file data
13597
13598 remotefilelog.debug turn on remotefilelog-specific debug output
13599
13600 remotefilelog.excludepattern pattern of files to exclude from pulls
13601
13602 remotefilelog.includepattern pattern of files to include in pulls
13603
13604 remotefilelog.fetchwarning: message to print when too many
13605
13606 single-file fetches occur
13607
13608 remotefilelog.getfilesstep number of files to request in a single
13609 RPC
13610
13611 remotefilelog.getfilestype if set to 'threaded' use threads to fetch
13612
13613 files, otherwise use optimistic fetching
13614
13615 remotefilelog.pullprefetch revset for selecting files that should be
13616
13617 eagerly downloaded rather than lazily
13618
13619 remotefilelog.reponame name of the repo. If set, used to partition
13620
13621 data from other repos in a shared store.
13622
13623 remotefilelog.server if true, enable server-side functionality
13624
13625 remotefilelog.servercachepath path for caching blobs on the server
13626
13627 remotefilelog.serverexpiration number of days to keep cached server
13628
13629 blobs
13630
13631 remotefilelog.validatecache if set, check cache entries for corrup‐
13632 tion
13633
13634 before returning blobs
13635
13636 remotefilelog.validatecachelog if set, check cache entries for
13637
13638 corruption before returning metadata
13639
13640 Commands
13641 Repository maintenance
13642 prefetch
13643 prefetch file revisions from the server:
13644
13645 hg prefetch [OPTIONS] [FILE...]
13646
13647 Prefetchs file revisions for the specified revs and stores them in the
13648 local remotefilelog cache. If no rev is specified, the default rev is
13649 used which is the union of dot, draft, pullprefetch and bgprefetchrev.
13650 File names or patterns can be used to limit which files are downloaded.
13651
13652 Return 0 on success.
13653
13654 Options:
13655
13656 -r,--rev <REV[+]>
13657 prefetch the specified revisions
13658
13659 --repack
13660 run repack after prefetch
13661
13662 -b,--base <VALUE>
13663 rev that is assumed to already be local
13664
13665 -I,--include <PATTERN[+]>
13666 include names matching the given patterns
13667
13668 -X,--exclude <PATTERN[+]>
13669 exclude names matching the given patterns
13670
13671 [+] marked option can be specified multiple times
13672
13673 Uncategorized commands
13674 gc
13675 garbage collect the client and server filelog caches:
13676
13677 hg gc [REPO...]
13678
13679 garbage collect the client and server filelog caches
13680
13681 repack
13682 hg repack [OPTIONS]
13683
13684 Options:
13685
13686 --background
13687 run in a background process
13688
13689 --incremental
13690 do an incremental repack
13691
13692 --packsonly
13693 only repack packs (skip loose objects)
13694
13695 verifyremotefilelog
13696 hg verifyremotefilelogs <directory>
13697
13698 Options:
13699
13700 -d, --decompress
13701 decompress the filelogs first
13702
13703 remotenames
13704 showing remotebookmarks and remotebranches in UI (EXPERIMENTAL)
13705
13706 By default both remotebookmarks and remotebranches are turned on. Con‐
13707 fig knob to control the individually are as follows.
13708
13709 Config options to tweak the default behaviour:
13710
13711 remotenames.bookmarks
13712 Boolean value to enable or disable showing of remotebookmarks
13713 (default: True)
13714
13715 remotenames.branches
13716 Boolean value to enable or disable showing of remotebranches
13717 (default: True)
13718
13719 remotenames.hoistedpeer
13720 Name of the peer whose remotebookmarks should be hoisted into
13721 the top-level namespace (default: 'default')
13722
13723 schemes
13724 extend schemes with shortcuts to repository swarms
13725
13726 This extension allows you to specify shortcuts for parent URLs with a
13727 lot of repositories to act like a scheme, for example:
13728
13729 [schemes]
13730 py = http://code.python.org/hg/
13731
13732 After that you can use it like:
13733
13734 hg clone py://trunk/
13735
13736 Additionally there is support for some more complex schemas, for exam‐
13737 ple used by Google Code:
13738
13739 [schemes]
13740 gcode = http://{1}.googlecode.com/hg/
13741
13742 The syntax is taken from Mercurial templates, and you have unlimited
13743 number of variables, starting with {1} and continuing with {2}, {3} and
13744 so on. This variables will receive parts of URL supplied, split by /.
13745 Anything not specified as {part} will be just appended to an URL.
13746
13747 For convenience, the extension adds these schemes by default:
13748
13749 [schemes]
13750 py = http://hg.python.org/
13751 bb = https://bitbucket.org/
13752 bb+ssh = ssh://hg@bitbucket.org/
13753 gcode = https://{1}.googlecode.com/hg/
13754 kiln = https://{1}.kilnhg.com/Repo/
13755
13756 You can override a predefined scheme by defining a new scheme with the
13757 same name.
13758
13759 Commands
13760 Uncategorized commands
13761 share
13762 share a common history between several working directories
13763
13764 The share extension introduces a new command hg share to create a new
13765 working directory. This is similar to hg clone, but doesn't involve
13766 copying or linking the storage of the repository. This allows working
13767 on different branches or changes in parallel without the associated
13768 cost in terms of disk space.
13769
13770 Note: destructive operations or extensions like hg rollback should be
13771 used with care as they can result in confusing problems.
13772
13773 Automatic Pooled Storage for Clones
13774 When this extension is active, hg clone can be configured to automati‐
13775 cally share/pool storage across multiple clones. This mode effectively
13776 converts hg clone to hg clone + hg share. The benefit of using this
13777 mode is the automatic management of store paths and intelligent pooling
13778 of related repositories.
13779
13780 The following share. config options influence this feature:
13781
13782 share.pool
13783
13784 Filesystem path where shared repository data will be stored.
13785 When defined, hg clone will automatically use shared repository
13786 storage instead of creating a store inside each clone.
13787
13788 share.poolnaming
13789
13790 How directory names in share.pool are constructed.
13791
13792 "identity" means the name is derived from the first changeset in
13793 the repository. In this mode, different remotes share storage if
13794 their root/initial changeset is identical. In this mode, the lo‐
13795 cal shared repository is an aggregate of all encountered remote
13796 repositories.
13797
13798 "remote" means the name is derived from the source repository's
13799 path or URL. In this mode, storage is only shared if the path or
13800 URL requested in the hg clone command matches exactly to a
13801 repository that was cloned before.
13802
13803 The default naming mode is "identity".
13804
13805 Sharing requirements and configs of source repository with shares:
13806
13807 By default creating a shared repository only enables sharing a common
13808 history and does not share requirements and configs between them. This
13809 may lead to problems in some cases, for example when you upgrade the
13810 storage format from one repository but does not set related configs in
13811 the shares.
13812
13813 Setting format.exp-share-safe = True enables sharing configs and re‐
13814 quirements. This only applies to shares which are done after enabling
13815 the config option.
13816
13817 For enabling this in existing shares, enable the config option and re‐
13818 share.
13819
13820 For resharing existing shares, make sure your working directory is
13821 clean and there are no untracked files, delete that share and create a
13822 new share.
13823
13824 Commands
13825 Repository creation
13826 share
13827 create a new shared repository:
13828
13829 hg share [-U] [-B] SOURCE [DEST]
13830
13831 Initialize a new repository and working directory that shares its his‐
13832 tory (and optionally bookmarks) with another repository.
13833
13834 Note using rollback or extensions that destroy/modify history (mq,
13835 rebase, etc.) can cause considerable confusion with shared
13836 clones. In particular, if two shared clones are both updated to
13837 the same changeset, and one of them destroys that changeset with
13838 rollback, the other clone will suddenly stop working: all opera‐
13839 tions will fail with "abort: working directory has unknown par‐
13840 ent". The only known workaround is to use debugsetparents on the
13841 broken clone to reset it to a changeset that still exists.
13842
13843 Options:
13844
13845 -U, --noupdate
13846 do not create a working directory
13847
13848 -B, --bookmarks
13849 also share bookmarks
13850
13851 --relative
13852 point to source using a relative path
13853
13854 Repository maintenance
13855 unshare
13856 convert a shared repository to a normal one:
13857
13858 hg unshare
13859
13860 Copy the store data to the repo and remove the sharedpath data.
13861
13862 show
13863 unified command to show various repository information (EXPERIMENTAL)
13864
13865 This extension provides the hg show command, which provides a central
13866 command for displaying commonly-accessed repository data and views of
13867 that data.
13868
13869 The following config options can influence operation.
13870
13871 commands
13872 show.aliasprefix
13873
13874 List of strings that will register aliases for views. e.g. s
13875 will effectively set config options alias.s<view> = show <view>
13876 for all views. i.e. hg swork would execute hg show work.
13877
13878 Aliases that would conflict with existing registrations will not
13879 be performed.
13880
13881 Commands
13882 Change navigation
13883 show
13884 show various repository information:
13885
13886 hg show VIEW
13887
13888 A requested view of repository data is displayed.
13889
13890 If no view is requested, the list of available views is shown and the
13891 command aborts.
13892
13893 Note There are no backwards compatibility guarantees for the output
13894 of this command. Output may change in any future Mercurial re‐
13895 lease.
13896
13897 Consumers wanting stable command output should specify a tem‐
13898 plate via -T/--template.
13899
13900 List of available views:
13901
13902 bookmarks bookmarks and their associated changeset
13903
13904 stack current line of work
13905
13906 work changesets that aren't finished
13907
13908 Options:
13909
13910 -T,--template <TEMPLATE>
13911 display with template
13912
13913 sparse
13914 allow sparse checkouts of the working directory (EXPERIMENTAL)
13915
13916 (This extension is not yet protected by backwards compatibility guaran‐
13917 tees. Any aspect may break in future releases until this notice is re‐
13918 moved.)
13919
13920 This extension allows the working directory to only consist of a subset
13921 of files for the revision. This allows specific files or directories to
13922 be explicitly included or excluded. Many repository operations have
13923 performance proportional to the number of files in the working direc‐
13924 tory. So only realizing a subset of files in the working directory can
13925 improve performance.
13926
13927 Sparse Config Files
13928 The set of files that are part of a sparse checkout are defined by a
13929 sparse config file. The file defines 3 things: includes (files to in‐
13930 clude in the sparse checkout), excludes (files to exclude from the
13931 sparse checkout), and profiles (links to other config files).
13932
13933 The file format is newline delimited. Empty lines and lines beginning
13934 with # are ignored.
13935
13936 Lines beginning with %include `` denote another sparse config file to
13937 include. e.g. ``%include tests.sparse. The filename is relative to the
13938 repository root.
13939
13940 The special lines [include] and [exclude] denote the section for in‐
13941 cludes and excludes that follow, respectively. It is illegal to have
13942 [include] after [exclude].
13943
13944 Non-special lines resemble file patterns to be added to either includes
13945 or excludes. The syntax of these lines is documented by hg help pat‐
13946 terns. Patterns are interpreted as glob: by default and match against
13947 the root of the repository.
13948
13949 Exclusion patterns take precedence over inclusion patterns. So even if
13950 a file is explicitly included, an [exclude] entry can remove it.
13951
13952 For example, say you have a repository with 3 directories, frontend/,
13953 backend/, and tools/. frontend/ and backend/ correspond to different
13954 projects and it is uncommon for someone working on one to need the
13955 files for the other. But tools/ contains files shared between both
13956 projects. Your sparse config files may resemble:
13957
13958 # frontend.sparse
13959 frontend/**
13960 tools/**
13961
13962 # backend.sparse
13963 backend/**
13964 tools/**
13965
13966 Say the backend grows in size. Or there's a directory with thousands of
13967 files you wish to exclude. You can modify the profile to exclude cer‐
13968 tain files:
13969
13970 [include]
13971 backend/**
13972 tools/**
13973
13974 [exclude]
13975 tools/tests/**
13976
13977 Commands
13978 Uncategorized commands
13979 split
13980 command to split a changeset into smaller ones (EXPERIMENTAL)
13981
13982 Commands
13983 Change manipulation
13984 split
13985 split a changeset into smaller ones:
13986
13987 hg split [--no-rebase] [[-r] REV]
13988
13989 Repeatedly prompt changes and commit message for new changesets until
13990 there is nothing left in the original changeset.
13991
13992 If --rev was not given, split the working directory parent.
13993
13994 By default, rebase connected non-obsoleted descendants onto the new
13995 changeset. Use --no-rebase to avoid the rebase.
13996
13997 Options:
13998
13999 -r,--rev <REV>
14000 revision to split
14001
14002 --rebase
14003 rebase descendants after split (default: True)
14004
14005 -d,--date <DATE>
14006 record the specified date as commit date
14007
14008 -u,--user <USER>
14009 record the specified user as committer
14010
14011 sqlitestore
14012 store repository data in SQLite (EXPERIMENTAL)
14013
14014 The sqlitestore extension enables the storage of repository data in
14015 SQLite.
14016
14017 This extension is HIGHLY EXPERIMENTAL. There are NO BACKWARDS COMPATI‐
14018 BILITY GUARANTEES. This means that repositories created with this ex‐
14019 tension may only be usable with the exact version of this exten‐
14020 sion/Mercurial that was used. The extension attempts to enforce this in
14021 order to prevent repository corruption.
14022
14023 In addition, several features are not yet supported or have known bugs:
14024
14025 • Only some data is stored in SQLite. Changeset, manifest, and other
14026 repository data is not yet stored in SQLite.
14027
14028 • Transactions are not robust. If the process is aborted at the right
14029 time during transaction close/rollback, the repository could be in an
14030 inconsistent state. This problem will diminish once all repository
14031 data is tracked by SQLite.
14032
14033 • Bundle repositories do not work (the ability to use e.g. hg -R <bun‐
14034 dle-file> log to automatically overlay a bundle on top of the exist‐
14035 ing repository).
14036
14037 • Various other features don't work.
14038
14039 This extension should work for basic clone/pull, update, and commit
14040 workflows. Some history rewriting operations may fail due to lack of
14041 support for bundle repositories.
14042
14043 To use, activate the extension and set the storage.new-repo-backend
14044 config option to sqlite to enable new repositories to use SQLite for
14045 storage.
14046
14047 strip
14048 strip changesets and their descendants from history (DEPRECATED)
14049
14050 The functionality of this extension has been included in core Mercurial
14051 since version 5.7. Please use hg debugstrip ... instead.
14052
14053 This extension allows you to strip changesets and all their descendants
14054 from the repository. See the command help for details.
14055
14056 transplant
14057 command to transplant changesets from another branch
14058
14059 This extension allows you to transplant changes to another parent revi‐
14060 sion, possibly in another repository. The transplant is done using
14061 'diff' patches.
14062
14063 Transplanted patches are recorded in .hg/transplant/transplants, as a
14064 map from a changeset hash to its hash in the source repository.
14065
14066 Commands
14067 Change manipulation
14068 transplant
14069 transplant changesets from another branch:
14070
14071 hg transplant [-s REPO] [-b BRANCH [-a]] [-p REV] [-m REV] [REV]...
14072
14073 Selected changesets will be applied on top of the current working di‐
14074 rectory with the log of the original changeset. The changesets are
14075 copied and will thus appear twice in the history with different identi‐
14076 ties.
14077
14078 Consider using the graft command if everything is inside the same
14079 repository - it will use merges and will usually give a better result.
14080 Use the rebase extension if the changesets are unpublished and you want
14081 to move them instead of copying them.
14082
14083 If --log is specified, log messages will have a comment appended of the
14084 form:
14085
14086 (transplanted from CHANGESETHASH)
14087
14088 You can rewrite the changelog message with the --filter option. Its
14089 argument will be invoked with the current changelog message as $1 and
14090 the patch as $2.
14091
14092 --source/-s specifies another repository to use for selecting change‐
14093 sets, just as if it temporarily had been pulled. If --branch/-b is
14094 specified, these revisions will be used as heads when deciding which
14095 changesets to transplant, just as if only these revisions had been
14096 pulled. If --all/-a is specified, all the revisions up to the heads
14097 specified with --branch will be transplanted.
14098
14099 Example:
14100
14101 • transplant all changes up to REV on top of your current revision:
14102
14103 hg transplant --branch REV --all
14104
14105 You can optionally mark selected transplanted changesets as merge
14106 changesets. You will not be prompted to transplant any ancestors of a
14107 merged transplant, and you can merge descendants of them normally in‐
14108 stead of transplanting them.
14109
14110 Merge changesets may be transplanted directly by specifying the proper
14111 parent changeset by calling hg transplant --parent.
14112
14113 If no merges or revisions are provided, hg transplant will start an in‐
14114 teractive changeset browser.
14115
14116 If a changeset application fails, you can fix the merge by hand and
14117 then resume where you left off by calling hg transplant --continue/-c.
14118
14119 Options:
14120
14121 -s,--source <REPO>
14122 transplant changesets from REPO
14123
14124 -b,--branch <REV[+]>
14125 use this source changeset as head
14126
14127 -a, --all
14128 pull all changesets up to the --branch revisions
14129
14130 -p,--prune <REV[+]>
14131 skip over REV
14132
14133 -m,--merge <REV[+]>
14134 merge at REV
14135
14136 --parent <REV>
14137 parent to choose when transplanting merge
14138
14139 -e, --edit
14140 invoke editor on commit messages
14141
14142 --log append transplant info to log message
14143
14144 --stop stop interrupted transplant
14145
14146 -c, --continue
14147 continue last transplant session after fixing conflicts
14148
14149 --filter <CMD>
14150 filter changesets through command
14151
14152 [+] marked option can be specified multiple times
14153
14154 uncommit
14155 uncommit part or all of a local changeset (EXPERIMENTAL)
14156
14157 This command undoes the effect of a local commit, returning the af‐
14158 fected files to their uncommitted state. This means that files modi‐
14159 fied, added or removed in the changeset will be left unchanged, and so
14160 will remain modified, added and removed in the working directory.
14161
14162 Commands
14163 Change manipulation
14164 unamend
14165 undo the most recent amend operation on a current changeset:
14166
14167 hg unamend
14168
14169 This command will roll back to the previous version of a changeset,
14170 leaving working directory in state in which it was before running hg
14171 amend (e.g. files modified as part of an amend will be marked as modi‐
14172 fied hg status)
14173
14174 uncommit
14175 uncommit part or all of a local changeset:
14176
14177 hg uncommit [OPTION]... [FILE]...
14178
14179 This command undoes the effect of a local commit, returning the af‐
14180 fected files to their uncommitted state. This means that files modified
14181 or deleted in the changeset will be left unchanged, and so will remain
14182 modified in the working directory.
14183
14184 If no files are specified, the commit will be pruned, unless --keep is
14185 given.
14186
14187 Options:
14188
14189 --keep allow an empty commit after uncommitting
14190
14191 --allow-dirty-working-copy
14192 allow uncommit with outstanding changes
14193
14194 -n,--note <TEXT>
14195 store a note on uncommit
14196
14197 -I,--include <PATTERN[+]>
14198 include names matching the given patterns
14199
14200 -X,--exclude <PATTERN[+]>
14201 exclude names matching the given patterns
14202
14203 -m,--message <TEXT>
14204 use text as commit message
14205
14206 -l,--logfile <FILE>
14207 read commit message from file
14208
14209 -d,--date <DATE>
14210 record the specified date as commit date
14211
14212 -u,--user <USER>
14213 record the specified user as committer
14214
14215 -D, --currentdate
14216 record the current date as commit date
14217
14218 -U, --currentuser
14219 record the current user as committer
14220
14221 [+] marked option can be specified multiple times
14222
14223 win32mbcs
14224 allow the use of MBCS paths with problematic encodings
14225
14226 Some MBCS encodings are not good for some path operations (i.e. split‐
14227 ting path, case conversion, etc.) with its encoded bytes. We call such
14228 a encoding (i.e. shift_jis and big5) as "problematic encoding". This
14229 extension can be used to fix the issue with those encodings by wrapping
14230 some functions to convert to Unicode string before path operation.
14231
14232 This extension is useful for:
14233
14234 • Japanese Windows users using shift_jis encoding.
14235
14236 • Chinese Windows users using big5 encoding.
14237
14238 • All users who use a repository with one of problematic encodings on
14239 case-insensitive file system.
14240
14241 This extension is not needed for:
14242
14243 • Any user who use only ASCII chars in path.
14244
14245 • Any user who do not use any of problematic encodings.
14246
14247 Note that there are some limitations on using this extension:
14248
14249 • You should use single encoding in one repository.
14250
14251 • If the repository path ends with 0x5c, .hg/hgrc cannot be read.
14252
14253 • win32mbcs is not compatible with fixutf8 extension.
14254
14255 By default, win32mbcs uses encoding.encoding decided by Mercurial. You
14256 can specify the encoding by config option:
14257
14258 [win32mbcs]
14259 encoding = sjis
14260
14261 It is useful for the users who want to commit with UTF-8 log message.
14262
14263 win32text
14264 perform automatic newline conversion (DEPRECATED)
14265
14266 Deprecation: The win32text extension requires each user to configure
14267 the extension again and again for each clone since the configuration
14268 is not copied when cloning.
14269
14270 We have therefore made the eol as an alternative. The eol uses a
14271 version controlled file for its configuration and each clone will
14272 therefore use the right settings from the start.
14273
14274 To perform automatic newline conversion, use:
14275
14276 [extensions]
14277 win32text =
14278 [encode]
14279 ** = cleverencode:
14280 # or ** = macencode:
14281
14282 [decode]
14283 ** = cleverdecode:
14284 # or ** = macdecode:
14285
14286 If not doing conversion, to make sure you do not commit CRLF/CR by ac‐
14287 cident:
14288
14289 [hooks]
14290 pretxncommit.crlf = python:hgext.win32text.forbidcrlf
14291 # or pretxncommit.cr = python:hgext.win32text.forbidcr
14292
14293 To do the same check on a server to prevent CRLF/CR from being pushed
14294 or pulled:
14295
14296 [hooks]
14297 pretxnchangegroup.crlf = python:hgext.win32text.forbidcrlf
14298 # or pretxnchangegroup.cr = python:hgext.win32text.forbidcr
14299
14300 zeroconf
14301 discover and advertise repositories on the local network
14302
14303 The zeroconf extension will advertise hg serve instances over DNS-SD so
14304 that they can be discovered using the hg paths command without knowing
14305 the server's IP address.
14306
14307 To allow other people to discover your repository using run hg serve in
14308 your repository:
14309
14310 $ cd test
14311 $ hg serve
14312
14313 You can discover Zeroconf-enabled repositories by running hg paths:
14314
14315 $ hg paths
14316 zc-test = http://example.com:8000/test
14317
14319 /etc/mercurial/hgrc, $HOME/.hgrc, .hg/hgrc
14320
14321 This file contains defaults and configuration. Values in
14322 .hg/hgrc override those in $HOME/.hgrc, and these override set‐
14323 tings made in the global /etc/mercurial/hgrc configuration. See
14324 hgrc(5) for details of the contents and format of these files.
14325
14326 .hgignore
14327
14328 This file contains regular expressions (one per line) that de‐
14329 scribe file names that should be ignored by hg. For details, see
14330 hgignore(5).
14331
14332 .hgsub
14333
14334 This file defines the locations of all subrepositories, and
14335 tells where the subrepository checkouts came from. For details,
14336 see hg help subrepos.
14337
14338 .hgsubstate
14339
14340 This file is where Mercurial stores all nested repository
14341 states. NB: This file should not be edited manually.
14342
14343 .hgtags
14344
14345 This file contains changeset hash values and text tag names (one
14346 of each separated by spaces) that correspond to tagged versions
14347 of the repository contents. The file content is encoded using
14348 UTF-8.
14349
14350 .hg/last-message.txt
14351
14352 This file is used by hg commit to store a backup of the commit
14353 message in case the commit fails.
14354
14355 .hg/localtags
14356
14357 This file can be used to define local tags which are not shared
14358 among repositories. The file format is the same as for .hgtags,
14359 but it is encoded using the local system encoding.
14360
14361 Some commands (e.g. revert) produce backup files ending in .orig, if
14362 the .orig file already exists and is not tracked by Mercurial, it will
14363 be overwritten.
14364
14366 Probably lots, please post them to the mailing list (see Resources
14367 below) when you find them.
14368
14370 hgignore(5), hgrc(5)
14371
14373 Written by Matt Mackall <mpm@selenic.com>
14374
14376 Main Web Site: https://mercurial-scm.org/
14377
14378 Source code repository: https://www.mercurial-scm.org/repo/hg
14379
14380 Mailing list: https://www.mercurial-scm.org/mailman/listinfo/mercurial/
14381
14383 Copyright (C) 2005-2021 Matt Mackall. Free use of this software is
14384 granted under the terms of the GNU General Public License version 2 or
14385 any later version.
14386
14388 Matt Mackall <mpm@selenic.com>
14389
14390 Organization: Mercurial
14391
14392
14393
14394
14395 HG(1)