1HG(1) Mercurial Manual HG(1)
2
3
4
6 hg - Mercurial source code management system
7
9 hg command [option]... [argument]...
10
12 The hg command provides a command line interface to the Mercurial sys‐
13 tem.
14
16 files...
17 indicates one or more filename or relative path filenames; see
18 File Name Patterns for information on pattern matching
19
20 path indicates a path on the local machine
21
22 revision
23 indicates a changeset which can be specified as a changeset
24 revision number, a tag, or a unique substring of the changeset
25 hash value
26
27 repository path
28 either the pathname of a local repository or the URI of a remote
29 repository.
30
32 -R, --repository
33 repository root directory or name of overlay bundle file
34
35 --cwd change working directory
36
37 -y, --noninteractive
38 do not prompt, assume 'yes' for any required answers
39
40 -q, --quiet
41 suppress output
42
43 -v, --verbose
44 enable additional output
45
46 --config
47 set/override config option
48
49 --debug
50 enable debugging output
51
52 --debugger
53 start debugger
54
55 --encoding
56 set the charset encoding (default: UTF-8)
57
58 --encodingmode
59 set the charset encoding mode (default: strict)
60
61 --traceback
62 always print a traceback on exception
63
64 --time time how long the command takes
65
66 --profile
67 print command execution profile
68
69 --version
70 output version information and exit
71
72 -h, --help
73 display help and exit
74
76 add [OPTION]... [FILE]...
77
78 Schedule files to be version controlled and added to the reposi‐
79 tory.
80
81 The files will be added to the repository at the next commit. To
82 undo an add before that, see hg forget.
83
84 If no names are given, add all files to the repository.
85
86 options:
87
88 -I, --include
89 include names matching the given patterns
90
91 -X, --exclude
92 exclude names matching the given patterns
93
94 -n, --dry-run
95 do not perform actions, just print output
96
97 addremove [OPTION]... [FILE]...
98
99 Add all new files and remove all missing files from the reposi‐
100 tory.
101
102 New files are ignored if they match any of the patterns in com‐
103 mit.
104
105 Use the -s/--similarity option to detect renamed files. With a
106 parameter greater than 0, this compares every removed file with
107 every added file and records those similar enough as renames.
108 This option takes a percentage between 0 (disabled) and 100
109 (files must be identical) as its parameter. Detecting renamed
110 files this way can be expensive.
111
112 options:
113
114 -s, --similarity
115 guess renamed files by similarity (0<=s<=100)
116
117 -I, --include
118 include names matching the given patterns
119
120 -X, --exclude
121 exclude names matching the given patterns
122
123 -n, --dry-run
124 do not perform actions, just print output
125
126 annotate [-r REV] [-f] [-a] [-u] [-d] [-n] [-c] [-l] FILE...
127
128 List changes in files, showing the revision id responsible for
129 each line
130
131 This command is useful for discovering when a change was made
132 and by whom.
133
134 Without the -a/--text option, annotate will avoid processing
135 files it detects as binary. With -a, annotate will annotate the
136 file anyway, although the results will probably be neither use‐
137 ful nor desirable.
138
139 options:
140
141 -r, --rev
142 annotate the specified revision
143
144 -f, --follow
145 follow file copies and renames
146
147 -a, --text
148 treat all files as text
149
150 -u, --user
151 list the author (long with -v)
152
153 -d, --date
154 list the date (short with -q)
155
156 -n, --number
157 list the revision number (default)
158
159 -c, --changeset
160 list the changeset
161
162 -l, --line-number
163 show line number at the first appearance
164
165 -I, --include
166 include names matching the given patterns
167
168 -X, --exclude
169 exclude names matching the given patterns
170
171 aliases: blame
172
173 archive [OPTION]... DEST
174
175 By default, the revision used is the parent of the working
176 directory; use -r/--rev to specify a different revision.
177
178 To specify the type of archive to create, use -t/--type. Valid
179 types are:
180
181 "files" (default): a directory full of files
182 "tar": tar archive, uncompressed
183 "tbz2": tar archive, compressed using bzip2
184 "tgz": tar archive, compressed using gzip
185 "uzip": zip archive, uncompressed
186 "zip": zip archive, compressed using deflate
187
188 The exact name of the destination archive or directory is given
189 using a format string; see 'hg help export' for details.
190
191 Each member added to an archive file has a directory prefix
192 prepended. Use -p/--prefix to specify a format string for the
193 prefix. The default is the basename of the archive, with suf‐
194 fixes removed.
195
196 options:
197
198 --no-decode
199 do not pass files through decoders
200
201 -p, --prefix
202 directory prefix for files in archive
203
204 -r, --rev
205 revision to distribute
206
207 -t, --type
208 type of distribution to create
209
210 -I, --include
211 include names matching the given patterns
212
213 -X, --exclude
214 exclude names matching the given patterns
215
216 backout [OPTION]... [-r] REV
217
218 Commit the backed out changes as a new changeset. The new
219 changeset is a child of the backed out changeset.
220
221 If you backout a changeset other than the tip, a new head is
222 created. This head will be the new tip and you should merge this
223 backout changeset with another head.
224
225 The --merge option remembers the parent of the working directory
226 before starting the backout, then merges the new head with that
227 changeset afterwards. This saves you from doing the merge by
228 hand. The result of this merge is not committed, as with a nor‐
229 mal merge.
230
231 See 'hg help dates' for a list of formats valid for -d/--date.
232
233 options:
234
235 --merge
236 merge with old dirstate parent after backout
237
238 --parent
239 parent to choose when backing out merge
240
241 -r, --rev
242 revision to backout
243
244 -I, --include
245 include names matching the given patterns
246
247 -X, --exclude
248 exclude names matching the given patterns
249
250 -m, --message
251 use <text> as commit message
252
253 -l, --logfile
254 read commit message from <file>
255
256 -d, --date
257 record datecode as commit date
258
259 -u, --user
260 record the specified user as committer
261
262 bisect [-gbsr] [-c CMD] [REV]
263
264 This command helps to find changesets which introduce problems.
265 To use, mark the earliest changeset you know exhibits the prob‐
266 lem as bad, then mark the latest changeset which is free from
267 the problem as good. Bisect will update your working directory
268 to a revision for testing (unless the -U/--noupdate option is
269 specified). Once you have performed tests, mark the working
270 directory as good or bad, and bisect will either update to
271 another candidate changeset or announce that it has found the
272 bad revision.
273
274 As a shortcut, you can also use the revision argument to mark a
275 revision as good or bad without checking it out first.
276
277 If you supply a command, it will be used for automatic bisec‐
278 tion. Its exit status will be used to mark revisions as good or
279 bad: status 0 means good, 125 means to skip the revision, 127
280 (command not found) will abort the bisection, and any other
281 non-zero exit status means the revision is bad.
282
283 options:
284
285 -r, --reset
286 reset bisect state
287
288 -g, --good
289 mark changeset good
290
291 -b, --bad
292 mark changeset bad
293
294 -s, --skip
295 skip testing changeset
296
297 -c, --command
298 use command to check changeset state
299
300 -U, --noupdate
301 do not update to target
302
303 branch [-fC] [NAME]
304
305 With no argument, show the current branch name. With one argu‐
306 ment, set the working directory branch name (the branch will not
307 exist in the repository until the next commit). Standard prac‐
308 tice recommends that primary development take place on the
309 'default' branch.
310
311 Unless -f/--force is specified, branch will not let you set a
312 branch name that already exists, even if it's inactive.
313
314 Use -C/--clean to reset the working directory branch to that of
315 the parent of the working directory, negating a previous branch
316 change.
317
318 Use the command 'hg update' to switch to an existing branch. Use
319 'hg commit --close-branch' to mark this branch as closed.
320
321 options:
322
323 -f, --force
324 set branch name even if it shadows an existing branch
325
326 -C, --clean
327 reset branch name to parent branch name
328
329 branches [-a]
330
331 List the repository's named branches, indicating which ones are
332 inactive. If -c/--closed is specified, also list branches which
333 have been marked closed (see hg commit --close-branch).
334
335 If -a/--active is specified, only show active branches. A branch
336 is considered active if it contains repository heads.
337
338 Use the command 'hg update' to switch to an existing branch.
339
340 options:
341
342 -a, --active
343 show only branches that have unmerged heads
344
345 -c, --closed
346 show normal and closed branches
347
348 bundle [-f] [-a] [-r REV]... [--base REV]... FILE [DEST]
349
350 Generate a compressed changegroup file collecting changesets not
351 known to be in another repository.
352
353 If no destination repository is specified the destination is
354 assumed to have all the nodes specified by one or more --base
355 parameters. To create a bundle containing all changesets, use
356 -a/--all (or --base null).
357
358 You can change compression method with the -t/--type option.
359 The available compression methods are: none, bzip2, and gzip (by
360 default, bundles are compressed using bzip2).
361
362 The bundle file can then be transferred using conventional means
363 and applied to another repository with the unbundle or pull com‐
364 mand. This is useful when direct push and pull are not available
365 or when exporting an entire repository is undesirable.
366
367 Applying bundles preserves all changeset contents including per‐
368 missions, copy/rename information, and revision history.
369
370 options:
371
372 -f, --force
373 run even when remote repository is unrelated
374
375 -r, --rev
376 a changeset up to which you would like to bundle
377
378 --base a base changeset to specify instead of a destination
379
380 -a, --all
381 bundle all changesets in the repository
382
383 -t, --type
384 bundle compression type to use (default: bzip2)
385
386 -e, --ssh
387 specify ssh command to use
388
389 --remotecmd
390 specify hg command to run on the remote side
391
392 cat [OPTION]... FILE...
393
394 Print the specified files as they were at the given revision. If
395 no revision is given, the parent of the working directory is
396 used, or tip if no revision is checked out.
397
398 Output may be to a file, in which case the name of the file is
399 given using a format string. The formatting rules are the same
400 as for the export command, with the following additions:
401
402 %s basename of file being printed
403 %d dirname of file being printed, or '.' if in repository root
404 %p root-relative path name of file being printed
405
406 options:
407
408 -o, --output
409 print output to file with formatted name
410
411 -r, --rev
412 print the given revision
413
414 --decode
415 apply any matching decode filter
416
417 -I, --include
418 include names matching the given patterns
419
420 -X, --exclude
421 exclude names matching the given patterns
422
423 clone [OPTION]... SOURCE [DEST]
424
425 Create a copy of an existing repository in a new directory.
426
427 If no destination directory name is specified, it defaults to
428 the basename of the source.
429
430 The location of the source is added to the new repository's
431
432 See 'hg help urls' for valid source format details.
433
434 It is possible to specify an ssh:// URL as the destination, but
435 no Please see 'hg help urls' for important details about ssh://
436 URLs.
437
438 If the -U/--noupdate option is specified, the new clone will
439 contain only a repository (.hg) and no working copy (the working
440 copy parent will be the null changeset). Otherwise, clone will
441 initially check out (in order of precedence):
442
443 a. the changeset, tag or branch specified with -u/--updaterev
444
445 b. the changeset, tag or branch given with the first -r/--rev
446
447 c. the head of the default branch
448
449 Use 'hg clone -u . src dst' to checkout the source repository's
450 parent changeset (applicable for local source repositories
451 only).
452
453 A set of changesets (tags, or branch names) to pull may be spec‐
454 ified by listing each changeset (tag, or branch name) with
455 -r/--rev. If -r/--rev is used, the cloned repository will con‐
456 tain only a subset of the changesets of the source repository.
457 Only the set of changesets defined by all -r/--rev options
458 (including all their ancestors) will be pulled into the destina‐
459 tion repository. No subsequent changesets (including subsequent
460 tags) will be present in the destination.
461
462 Using -r/--rev (or 'clone src#rev dest') implies --pull, even
463 for local source repositories.
464
465 For efficiency, hardlinks are used for cloning whenever the
466 source and destination are on the same filesystem (note this
467 applies only to the repository data, not to the checked out
468 files). Some filesystems, such as AFS, implement hardlinking
469 incorrectly, but do not report errors. In these cases, use the
470 --pull option to avoid hardlinking.
471
472 In some cases, you can clone repositories and checked out files
473 using full hardlinks with
474
475 $ cp -al REPO REPOCLONE
476
477 This is the fastest way to clone, but it is not always safe. The
478 operation is not atomic (making sure REPO is not modified during
479 the operation is up to you) and you have to make sure your edi‐
480 tor breaks hardlinks (Emacs and most Linux Kernel tools do so).
481 Also, this is not compatible with certain extensions that place
482 their metadata under the .hg directory, such as mq.
483
484 options:
485
486 -U, --noupdate
487 the clone will only contain a repository (no working
488 copy)
489
490 -u, --updaterev
491 revision, tag or branch to check out
492
493 -r, --rev
494 a changeset you would like to have after cloning
495
496 --pull use pull protocol to copy metadata
497
498 --uncompressed
499 use uncompressed transfer (fast over LAN)
500
501 -e, --ssh
502 specify ssh command to use
503
504 --remotecmd
505 specify hg command to run on the remote side
506
507 commit [OPTION]... [FILE]...
508
509 Commit changes to the given files into the repository. Unlike a
510 centralized RCS, this operation is a local operation. See hg
511 push for a way to actively distribute your changes.
512
513 If a list of files is omitted, all changes reported by "hg sta‐
514 tus" will be committed.
515
516 If you are committing the result of a merge, do not provide any
517 filenames or -I/-X filters.
518
519 If no commit message is specified, the configured editor is
520 started to prompt you for a message.
521
522 See 'hg help dates' for a list of formats valid for -d/--date.
523
524 options:
525
526 -A, --addremove
527 mark new/missing files as added/removed before committing
528
529 --close-branch
530 mark a branch as closed, hiding it from the branch list
531
532 -I, --include
533 include names matching the given patterns
534
535 -X, --exclude
536 exclude names matching the given patterns
537
538 -m, --message
539 use <text> as commit message
540
541 -l, --logfile
542 read commit message from <file>
543
544 -d, --date
545 record datecode as commit date
546
547 -u, --user
548 record the specified user as committer
549
550 aliases: ci
551
552 copy [OPTION]... [SOURCE]... DEST
553
554 Mark dest as having copies of source files. If dest is a direc‐
555 tory, copies are put in that directory. If dest is a file, the
556 source must be a single file.
557
558 By default, this command copies the contents of files as they
559 exist in the working directory. If invoked with -A/--after, the
560 operation is recorded, but no copying is performed.
561
562 This command takes effect with the next commit. To undo a copy
563 before that, see hg revert.
564
565 options:
566
567 -A, --after
568 record a copy that has already occurred
569
570 -f, --force
571 forcibly copy over an existing managed file
572
573 -I, --include
574 include names matching the given patterns
575
576 -X, --exclude
577 exclude names matching the given patterns
578
579 -n, --dry-run
580 do not perform actions, just print output
581
582 aliases: cp
583
584 diff [OPTION]... [-r REV1 [-r REV2]] [FILE]...
585
586 Show differences between revisions for the specified files.
587
588 Differences between files are shown using the unified diff for‐
589 mat.
590
591 NOTE: diff may generate unexpected results for merges, as it
592 will default to comparing against the working directory's first
593 parent changeset if no revisions are specified.
594
595 When two revision arguments are given, then changes are shown
596 between those revisions. If only one revision is specified then
597 that revision is compared to the working directory, and, when no
598 revisions are specified, the working directory files are com‐
599 pared to its parent.
600
601 Without the -a/--text option, diff will avoid generating diffs
602 of files it detects as binary. With -a, diff will generate a
603 diff anyway, probably with undesirable results.
604
605 Use the -g/--git option to generate diffs in the git extended
606 diff format. For more information, read 'hg help diffs'.
607
608 options:
609
610 -r, --rev
611 revision
612
613 -c, --change
614 change made by revision
615
616 -a, --text
617 treat all files as text
618
619 -g, --git
620 use git extended diff format
621
622 --nodates
623 don't include dates in diff headers
624
625 -p, --show-function
626 show which function each change is in
627
628 --reverse
629 produce a diff that undoes the changes
630
631 -w, --ignore-all-space
632 ignore white space when comparing lines
633
634 -b, --ignore-space-change
635 ignore changes in the amount of white space
636
637 -B, --ignore-blank-lines
638 ignore changes whose lines are all blank
639
640 -U, --unified
641 number of lines of context to show
642
643 --stat output diffstat-style summary of changes
644
645 -I, --include
646 include names matching the given patterns
647
648 -X, --exclude
649 exclude names matching the given patterns
650
651 export [OPTION]... [-o OUTFILESPEC] REV...
652
653 Print the changeset header and diffs for one or more revisions.
654
655 The information shown in the changeset header is: author,
656 changeset hash, parent(s) and commit comment.
657
658 NOTE: export may generate unexpected diff output for merge
659 changesets, as it will compare the merge changeset against its
660 first parent only.
661
662 Output may be to a file, in which case the name of the file is
663 given using a format string. The formatting rules are as fol‐
664 lows:
665
666 %% literal "%" character
667 %H changeset hash (40 bytes of hexadecimal)
668 %N number of patches being generated
669 %R changeset revision number
670 %b basename of the exporting repository
671 %h short-form changeset hash (12 bytes of hexadecimal)
672 %n zero-padded sequence number, starting at 1
673 %r zero-padded changeset revision number
674
675 Without the -a/--text option, export will avoid generating diffs
676 of files it detects as binary. With -a, export will generate a
677 diff anyway, probably with undesirable results.
678
679 Use the -g/--git option to generate diffs in the git extended
680 diff format. See 'hg help diffs' for more information.
681
682 With the --switch-parent option, the diff will be against the
683 second parent. It can be useful to review a merge.
684
685 options:
686
687 -o, --output
688 print output to file with formatted name
689
690 --switch-parent
691 diff against the second parent
692
693 -a, --text
694 treat all files as text
695
696 -g, --git
697 use git extended diff format
698
699 --nodates
700 don't include dates in diff headers
701
702 forget [OPTION]... FILE...
703
704 Mark the specified files so they will no longer be tracked after
705 the next commit.
706
707 This only removes files from the current branch, not from the
708 entire project history, and it does not delete them from the
709 working directory.
710
711 To undo a forget before the next commit, see hg add.
712
713 options:
714
715 -I, --include
716 include names matching the given patterns
717
718 -X, --exclude
719 exclude names matching the given patterns
720
721 grep [OPTION]... PATTERN [FILE]...
722
723 Search revisions of files for a regular expression.
724
725 This command behaves differently than Unix grep. It only accepts
726 Python/Perl regexps. It searches repository history, not the
727 working directory. It always prints the revision number in which
728 a match appears.
729
730 By default, grep only prints output for the first revision of a
731 file in which it finds a match. To get it to print every revi‐
732 sion that contains a change in match status ("-" for a match
733 that becomes a non-match, or "+" for a non-match that becomes a
734 match), use the --all flag.
735
736 options:
737
738 -0, --print0
739 end fields with NUL
740
741 --all print all revisions that match
742
743 -f, --follow
744 follow changeset history, or file history across copies
745 and renames
746
747 -i, --ignore-case
748 ignore case when matching
749
750 -l, --files-with-matches
751 print only filenames and revisions that match
752
753 -n, --line-number
754 print matching line numbers
755
756 -r, --rev
757 search in given revision range
758
759 -u, --user
760 list the author (long with -v)
761
762 -d, --date
763 list the date (short with -q)
764
765 -I, --include
766 include names matching the given patterns
767
768 -X, --exclude
769 exclude names matching the given patterns
770
771 heads [-r STARTREV] [REV]...
772
773 With no arguments, show all repository head changesets.
774
775 Repository "heads" are changesets with no child changesets. They
776 are where development generally takes place and are the usual
777 targets for update and merge operations.
778
779 If one or more REV is given, the "branch heads" will be shown
780 for the named branch associated with the specified changeset(s).
781
782 Branch heads are changesets on a named branch with no descen‐
783 dants on the same branch. A branch head could be a "true"
784 (repository) head, or it could be the last changeset on that
785 branch before it was merged into another branch, or it could be
786 the last changeset on the branch before a new branch was cre‐
787 ated. If none of the branch heads are true heads, the branch is
788 considered inactive.
789
790 If -c/--closed is specified, also show branch heads marked
791 closed (see hg commit --close-branch).
792
793 If STARTREV is specified, only those heads that are descendants
794 of STARTREV will be displayed.
795
796 options:
797
798 -r, --rev
799 show only heads which are descendants of REV
800
801 -a, --active
802 show only the active branch heads from open branches
803
804 -c, --closed
805 show normal and closed branch heads
806
807 --style
808 display using template map file
809
810 --template
811 display with template
812
813 help [TOPIC]
814
815 With no arguments, print a list of commands with short help mes‐
816 sages.
817
818 Given a topic, extension, or command name, print help for that
819 topic.
820
821 identify [-nibt] [-r REV] [SOURCE]
822
823 With no revision, print a summary of the current state of the
824 repository.
825
826 Specifying a path to a repository root or Mercurial bundle will
827 cause lookup to operate on that repository/bundle.
828
829 This summary identifies the repository state using one or two
830 parent hash identifiers, followed by a "+" if there are uncom‐
831 mitted changes in the working directory, a list of tags for this
832 revision and a branch name for non-default branches.
833
834 options:
835
836 -r, --rev
837 identify the specified revision
838
839 -n, --num
840 show local revision number
841
842 -i, --id
843 show global revision id
844
845 -b, --branch
846 show branch
847
848 -t, --tags
849 show tags
850
851 aliases: id
852
853 import [OPTION]... PATCH...
854
855 Import a list of patches and commit them individually (unless
856 --no-commit is specified).
857
858 If there are outstanding changes in the working directory,
859 import will abort unless given the -f/--force flag.
860
861 You can import a patch straight from a mail message. Even
862 patches as attachments work (to use the body part, it must have
863 type text/plain or text/x-patch). From and Subject headers of
864 email message are used as default committer and commit message.
865 All text/plain body parts before first diff are added to commit
866 message.
867
868 If the imported patch was generated by hg export, user and
869 description from patch override values from message headers and
870 body. Values given on command line with -m/--message and
871 -u/--user override these.
872
873 If --exact is specified, import will set the working directory
874 to the parent of each patch before applying it, and will abort
875 if the resulting changeset has a different ID than the one
876 recorded in the patch. This may happen due to character set
877 problems or other deficiencies in the text patch format.
878
879 With -s/--similarity, hg will attempt to discover renames and
880 copies in the patch in the same way as 'addremove'.
881
882 To read a patch from standard input, use "-" as the patch name.
883 If a URL is specified, the patch will be downloaded from it.
884 See 'hg help dates' for a list of formats valid for -d/--date.
885
886 options:
887
888 -p, --strip
889 directory strip option for patch. This has the same mean‐
890 ing as the corresponding patch option (default: 1)
891
892 -b, --base
893 base path
894
895 -f, --force
896 skip check for outstanding uncommitted changes
897
898 --no-commit
899 don't commit, just update the working directory
900
901 --exact
902 apply patch to the nodes from which it was generated
903
904 --import-branch
905 use any branch information in patch (implied by --exact)
906
907 -m, --message
908 use <text> as commit message
909
910 -l, --logfile
911 read commit message from <file>
912
913 -d, --date
914 record datecode as commit date
915
916 -u, --user
917 record the specified user as committer
918
919 -s, --similarity
920 guess renamed files by similarity (0<=s<=100)
921
922 aliases: patch
923
924 incoming [-p] [-n] [-M] [-f] [-r REV]... [--bundle FILENAME] [SOURCE]
925
926 Show new changesets found in the specified path/URL or the
927 default pull location. These are the changesets that would have
928 been pulled if a pull at the time you issued this command.
929
930 For remote repository, using --bundle avoids downloading the
931 changesets twice if the incoming is followed by a pull.
932
933 See pull for valid source format details.
934
935 options:
936
937 -f, --force
938 run even when remote repository is unrelated
939
940 -n, --newest-first
941 show newest record first
942
943 --bundle
944 file to store the bundles into
945
946 -r, --rev
947 a specific remote revision up to which you would like to
948 pull
949
950 -p, --patch
951 show patch
952
953 -g, --git
954 use git extended diff format
955
956 -l, --limit
957 limit number of changes displayed
958
959 -M, --no-merges
960 do not show merges
961
962 --style
963 display using template map file
964
965 --template
966 display with template
967
968 -e, --ssh
969 specify ssh command to use
970
971 --remotecmd
972 specify hg command to run on the remote side
973
974 aliases: in
975
976 init [-e CMD] [--remotecmd CMD] [DEST]
977
978 Initialize a new repository in the given directory. If the given
979 directory does not exist, it will be created.
980
981 If no directory is given, the current directory is used.
982
983 It is possible to specify an ssh:// URL as the destination. See
984 'hg help urls' for more information.
985
986 options:
987
988 -e, --ssh
989 specify ssh command to use
990
991 --remotecmd
992 specify hg command to run on the remote side
993
994 locate [OPTION]... [PATTERN]...
995
996 Print files under Mercurial control in the working directory
997 whose names match the given patterns.
998
999 By default, this command searches all directories in the working
1000 directory. To search just the current directory and its subdi‐
1001 rectories, use "--include .".
1002
1003 If no patterns are given to match, this command prints the names
1004 of all files under Mercurial control in the working directory.
1005
1006 If you want to feed the output of this command into the "xargs"
1007 command, use the -0 option to both this command and "xargs".
1008 This will avoid the problem of "xargs" treating single filenames
1009 that contain whitespace as multiple filenames.
1010
1011 options:
1012
1013 -r, --rev
1014 search the repository as it stood at REV
1015
1016 -0, --print0
1017 end filenames with NUL, for use with xargs
1018
1019 -f, --fullpath
1020 print complete paths from the filesystem root
1021
1022 -I, --include
1023 include names matching the given patterns
1024
1025 -X, --exclude
1026 exclude names matching the given patterns
1027
1028 log [OPTION]... [FILE]
1029
1030 Print the revision history of the specified files or the entire
1031 project.
1032
1033 File history is shown without following rename or copy history
1034 of files. Use -f/--follow with a filename to follow history
1035 across renames and copies. --follow without a filename will only
1036 show ancestors or descendants of the starting revision. --fol‐
1037 low-first only follows the first parent of merge revisions.
1038
1039 If no revision range is specified, the default is tip:0 unless
1040 --follow is set, in which case the working directory parent is
1041 used as the starting revision.
1042
1043 See 'hg help dates' for a list of formats valid for -d/--date.
1044
1045 By default this command prints revision number and changeset id,
1046 tags, non-trivial parents, user, date and time, and a summary
1047 for each commit. When the -v/--verbose switch is used, the list
1048 of changed files and full commit message are shown.
1049
1050 NOTE: log -p/--patch may generate unexpected diff output for
1051 merge changesets, as it will only compare the merge changeset
1052 against its first parent. Also, only files different from BOTH
1053 parents will appear in files:.
1054
1055 options:
1056
1057 -f, --follow
1058 follow changeset history, or file history across copies
1059 and renames
1060
1061 --follow-first
1062 only follow the first parent of merge changesets
1063
1064 -d, --date
1065 show revisions matching date spec
1066
1067 -C, --copies
1068 show copied files
1069
1070 -k, --keyword
1071 do case-insensitive search for a keyword
1072
1073 -r, --rev
1074 show the specified revision or range
1075
1076 --removed
1077 include revisions where files were removed
1078
1079 -m, --only-merges
1080 show only merges
1081
1082 -u, --user
1083 revisions committed by user
1084
1085 -b, --only-branch
1086 show only changesets within the given named branch
1087
1088 -P, --prune
1089 do not display revision or any of its ancestors
1090
1091 -p, --patch
1092 show patch
1093
1094 -g, --git
1095 use git extended diff format
1096
1097 -l, --limit
1098 limit number of changes displayed
1099
1100 -M, --no-merges
1101 do not show merges
1102
1103 --style
1104 display using template map file
1105
1106 --template
1107 display with template
1108
1109 -I, --include
1110 include names matching the given patterns
1111
1112 -X, --exclude
1113 exclude names matching the given patterns
1114
1115 aliases: history
1116
1117 manifest [-r REV]
1118
1119 Print a list of version controlled files for the given revision.
1120 If no revision is given, the first parent of the working direc‐
1121 tory is used, or the null revision if no revision is checked
1122 out.
1123
1124 With -v, print file permissions, symlink and executable bits.
1125 With --debug, print file revision hashes.
1126
1127 options:
1128
1129 -r, --rev
1130 revision to display
1131
1132 merge [-f] [[-r] REV]
1133
1134 The current working directory is updated with all changes made
1135 in the requested revision since the last common predecessor
1136 revision.
1137
1138 Files that changed between either parent are marked as changed
1139 for the next commit and a commit must be performed before any
1140 further updates to the repository are allowed. The next commit
1141 will have two parents.
1142
1143 If no revision is specified, the working directory's parent is a
1144 head revision, and the current branch contains exactly one other
1145 head, the other head is merged with by default. Otherwise, an
1146 explicit revision with which to merge with must be provided.
1147
1148 options:
1149
1150 -f, --force
1151 force a merge with outstanding changes
1152
1153 -r, --rev
1154 revision to merge
1155
1156 -P, --preview
1157 review revisions to merge (no merge is performed)
1158
1159 outgoing [-M] [-p] [-n] [-f] [-r REV]... [DEST]
1160
1161 Show changesets not found in the specified destination reposi‐
1162 tory or the default push location. These are the changesets that
1163 would be pushed if a push was requested.
1164
1165 See pull for valid destination format details.
1166
1167 options:
1168
1169 -f, --force
1170 run even when remote repository is unrelated
1171
1172 -r, --rev
1173 a specific revision up to which you would like to push
1174
1175 -n, --newest-first
1176 show newest record first
1177
1178 -p, --patch
1179 show patch
1180
1181 -g, --git
1182 use git extended diff format
1183
1184 -l, --limit
1185 limit number of changes displayed
1186
1187 -M, --no-merges
1188 do not show merges
1189
1190 --style
1191 display using template map file
1192
1193 --template
1194 display with template
1195
1196 -e, --ssh
1197 specify ssh command to use
1198
1199 --remotecmd
1200 specify hg command to run on the remote side
1201
1202 aliases: out
1203
1204 parents [-r REV] [FILE]
1205
1206 Print the working directory's parent revisions. If a revision is
1207 given via -r/--rev, the parent of that revision will be printed.
1208 If a file argument is given, the revision in which the file was
1209 last changed (before the working directory revision or the argu‐
1210 ment to --rev if given) is printed.
1211
1212 options:
1213
1214 -r, --rev
1215 show parents from the specified revision
1216
1217 --style
1218 display using template map file
1219
1220 --template
1221 display with template
1222
1223 paths [NAME]
1224
1225 Show definition of symbolic path name NAME. If no name is given,
1226 show definition of all available names.
1227
1228 Path names are defined in the [paths] section of /etc/mercu‐
1229 rial/hgrc and $HOME/.hgrc. If run inside a repository, .hg/hgrc
1230 is used, too.
1231
1232 See 'hg help urls' for more information.
1233
1234 pull [-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [SOURCE]
1235
1236 Pull changes from a remote repository to a local one.
1237
1238 This finds all changes from the repository at the specified path
1239 or URL and adds them to a local repository (the current one
1240 unless -R is specified). By default, this does not update the
1241 copy of the project in the working directory.
1242
1243 Use hg incoming if you want to see what would have been added by
1244 a pull at the time you issued this command. If you then decide
1245 to added those changes to the repository, you should use pull -r
1246 X where X is the last changeset listed by hg incoming.
1247
1248 If SOURCE is omitted, the 'default' path will be used. See 'hg
1249 help urls' for more information.
1250
1251 options:
1252
1253 -u, --update
1254 update to new tip if changesets were pulled
1255
1256 -f, --force
1257 run even when remote repository is unrelated
1258
1259 -r, --rev
1260 a specific remote revision up to which you would like to
1261 pull
1262
1263 -e, --ssh
1264 specify ssh command to use
1265
1266 --remotecmd
1267 specify hg command to run on the remote side
1268
1269 push [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]
1270
1271 Push changes from the local repository to the given destination.
1272
1273 This is the symmetrical operation for pull. It moves changes
1274 from the current repository to a different one. If the destina‐
1275 tion is local this is identical to a pull in that directory from
1276 the current one.
1277
1278 By default, push will refuse to run if it detects the result
1279 would increase the number of remote heads. This generally indi‐
1280 cates the user forgot to pull and merge before pushing.
1281
1282 If -r/--rev is used, the named revision and all its ancestors
1283 will be pushed to the remote repository.
1284
1285 Please see 'hg help urls' for important details about ssh://
1286 URLs. If DESTINATION is omitted, a default path will be used.
1287
1288 options:
1289
1290 -f, --force
1291 force push
1292
1293 -r, --rev
1294 a specific revision up to which you would like to push
1295
1296 -e, --ssh
1297 specify ssh command to use
1298
1299 --remotecmd
1300 specify hg command to run on the remote side
1301
1302 recover
1303
1304 Recover from an interrupted commit or pull.
1305
1306 This command tries to fix the repository status after an inter‐
1307 rupted operation. It should only be necessary when Mercurial
1308 suggests it.
1309
1310 remove [OPTION]... FILE...
1311
1312 Schedule the indicated files for removal from the repository.
1313
1314 This only removes files from the current branch, not from the
1315 entire project history. -A/--after can be used to remove only
1316 files that have already been deleted, -f/--force can be used to
1317 force deletion, and -Af can be used to remove files from the
1318 next revision without deleting them from the working directory.
1319
1320 The following table details the behavior of remove for different
1321 file states (columns) and option combinations (rows). The file
1322 states are Added [A], Clean [C], Modified [M] and Missing [!]
1323 (as reported by hg status). The actions are Warn, Remove (from
1324 branch) and Delete (from disk):
1325
1326 A C M !
1327 none W RD W R
1328 -f R RD RD R
1329 -A W W W R
1330 -Af R R R R
1331
1332 This command schedules the files to be removed at the next com‐
1333 mit. To undo a remove before that, see hg revert.
1334
1335 options:
1336
1337 -A, --after
1338 record delete for missing files
1339
1340 -f, --force
1341 remove (and delete) file even if added or modified
1342
1343 -I, --include
1344 include names matching the given patterns
1345
1346 -X, --exclude
1347 exclude names matching the given patterns
1348
1349 aliases: rm
1350
1351 rename [OPTION]... SOURCE... DEST
1352
1353 Mark dest as copies of sources; mark sources for deletion. If
1354 dest is a directory, copies are put in that directory. If dest
1355 is a file, there can only be one source.
1356
1357 By default, this command copies the contents of files as they
1358 exist in the working directory. If invoked with -A/--after, the
1359 operation is recorded, but no copying is performed.
1360
1361 This command takes effect at the next commit. To undo a rename
1362 before that, see hg revert.
1363
1364 options:
1365
1366 -A, --after
1367 record a rename that has already occurred
1368
1369 -f, --force
1370 forcibly copy over an existing managed file
1371
1372 -I, --include
1373 include names matching the given patterns
1374
1375 -X, --exclude
1376 exclude names matching the given patterns
1377
1378 -n, --dry-run
1379 do not perform actions, just print output
1380
1381 aliases: mv
1382
1383 resolve [OPTION]... [FILE]...
1384
1385 This command can cleanly retry unresolved file merges using file
1386 revisions preserved from the last update or merge.
1387
1388 If a conflict is resolved manually, please note that the changes
1389 will be overwritten if the merge is retried with resolve. The
1390 -m/--mark switch should be used to mark the file as resolved.
1391
1392 You can specify a set of files to operate on, or use the -a/-all
1393 switch to select all unresolved files.
1394
1395 This command also allows listing resolved files and manually
1396 indicating whether or not files are resolved. All files must be
1397 marked as resolved before a commit is permitted.
1398
1399 The codes used to show the status of files are:
1400
1401 U = unresolved
1402 R = resolved
1403
1404 options:
1405
1406 -a, --all
1407 select all unresolved files
1408
1409 -l, --list
1410 list state of files needing merge
1411
1412 -m, --mark
1413 mark files as resolved
1414
1415 -u, --unmark
1416 unmark files as resolved
1417
1418 -n, --no-status
1419 hide status prefix
1420
1421 -I, --include
1422 include names matching the given patterns
1423
1424 -X, --exclude
1425 exclude names matching the given patterns
1426
1427 revert [OPTION]... [-r REV] [NAME]...
1428
1429 (Use update -r to check out earlier revisions, revert does not
1430 change the working directory parents.)
1431
1432 With no revision specified, revert the named files or directo‐
1433 ries to the contents they had in the parent of the working
1434 directory. This restores the contents of the affected files to
1435 an unmodified state and unschedules adds, removes, copies, and
1436 renames. If the working directory has two parents, you must
1437 explicitly specify the revision to revert to.
1438
1439 Using the -r/--rev option, revert the given files or directories
1440 to their contents as of a specific revision. This can be helpful
1441 to "roll back" some or all of an earlier change. See 'hg help
1442 dates' for a list of formats valid for -d/--date.
1443
1444 Revert modifies the working directory. It does not commit any
1445 changes, or change the parent of the working directory. If you
1446 revert to a revision other than the parent of the working direc‐
1447 tory, the reverted files will thus appear modified afterwards.
1448
1449 If a file has been deleted, it is restored. If the executable
1450 mode of a file was changed, it is reset.
1451
1452 If names are given, all files matching the names are reverted.
1453 If no arguments are given, no files are reverted.
1454
1455 Modified files are saved with a .orig suffix before reverting.
1456 To disable these backups, use --no-backup.
1457
1458 options:
1459
1460 -a, --all
1461 revert all changes when no arguments given
1462
1463 -d, --date
1464 tipmost revision matching date
1465
1466 -r, --rev
1467 revision to revert to
1468
1469 --no-backup
1470 do not save backup copies of files
1471
1472 -I, --include
1473 include names matching the given patterns
1474
1475 -X, --exclude
1476 exclude names matching the given patterns
1477
1478 -n, --dry-run
1479 do not perform actions, just print output
1480
1481 rollback
1482
1483 This command should be used with care. There is only one level
1484 of rollback, and there is no way to undo a rollback. It will
1485 also restore the dirstate at the time of the last transaction,
1486 losing any dirstate changes since that time. This command does
1487 not alter the working directory.
1488
1489 Transactions are used to encapsulate the effects of all commands
1490 that create new changesets or propagate existing changesets into
1491 a repository. For example, the following commands are transac‐
1492 tional, and their effects can be rolled back:
1493
1494 commit
1495 import
1496 pull
1497 push (with this repository as destination)
1498 unbundle
1499
1500 This command is not intended for use on public repositories.
1501 Once changes are visible for pull by other users, rolling a
1502 transaction back locally is ineffective (someone else may
1503 already have pulled the changes). Furthermore, a race is possi‐
1504 ble with readers of the repository; for example an in-progress
1505 pull from the repository may fail if a rollback is performed.
1506
1507 root
1508
1509 Print the root directory of the current repository.
1510
1511 serve [OPTION]...
1512
1513 Start a local HTTP repository browser and pull server.
1514
1515 By default, the server logs accesses to stdout and errors to
1516 stderr. Use the -A/--accesslog and -E/--errorlog options to log
1517 to files.
1518
1519 options:
1520
1521 -A, --accesslog
1522 name of access log file to write to
1523
1524 -d, --daemon
1525 run server in background
1526
1527 --daemon-pipefds
1528 used internally by daemon mode
1529
1530 -E, --errorlog
1531 name of error log file to write to
1532
1533 -p, --port
1534 port to listen on (default: 8000)
1535
1536 -a, --address
1537 address to listen on (default: all interfaces)
1538
1539 --prefix
1540 prefix path to serve from (default: server root)
1541
1542 -n, --name
1543 name to show in web pages (default: working directory)
1544
1545 --webdir-conf
1546 name of the webdir config file (serve more than one
1547 repository)
1548
1549 --pid-file
1550 name of file to write process ID to
1551
1552 --stdio
1553 for remote clients
1554
1555 -t, --templates
1556 web templates to use
1557
1558 --style
1559 template style to use
1560
1561 -6, --ipv6
1562 use IPv6 in addition to IPv4
1563
1564 --certificate
1565 SSL certificate file
1566
1567 showconfig [-u] [NAME]...
1568
1569 With no arguments, print names and values of all config items.
1570
1571 With one argument of the form section.name, print just the value
1572 of that config item.
1573
1574 With multiple arguments, print names and values of all config
1575 items with matching section names.
1576
1577 With --debug, the source (filename and line number) is printed
1578 for each config item.
1579
1580 options:
1581
1582 -u, --untrusted
1583 show untrusted configuration options
1584
1585 aliases: debugconfig
1586
1587 status [OPTION]... [FILE]...
1588
1589 Show status of files in the repository. If names are given, only
1590 files that match are shown. Files that are clean or ignored or
1591 the source of a copy/move operation, are not listed unless
1592 -c/--clean, -i/--ignored, -C/--copies or -A/--all are given.
1593 Unless options described with "show only ..." are given, the
1594 options -mardu are used.
1595
1596 Option -q/--quiet hides untracked (unknown and ignored) files
1597 unless explicitly requested with -u/--unknown or -i/--ignored.
1598
1599 NOTE: status may appear to disagree with diff if permissions
1600 have changed or a merge has occurred. The standard diff format
1601 does not report permission changes and diff only reports changes
1602 relative to one merge parent.
1603
1604 If one revision is given, it is used as the base revision. If
1605 two revisions are given, the differences between them are shown.
1606
1607 The codes used to show the status of files are:
1608
1609 M = modified
1610 A = added
1611 R = removed
1612 C = clean
1613 ! = missing (deleted by non-hg command, but still tracked)
1614 ? = not tracked
1615 I = ignored
1616 = origin of the previous file listed as A (added)
1617
1618 options:
1619
1620 -A, --all
1621 show status of all files
1622
1623 -m, --modified
1624 show only modified files
1625
1626 -a, --added
1627 show only added files
1628
1629 -r, --removed
1630 show only removed files
1631
1632 -d, --deleted
1633 show only deleted (but tracked) files
1634
1635 -c, --clean
1636 show only files without changes
1637
1638 -u, --unknown
1639 show only unknown (not tracked) files
1640
1641 -i, --ignored
1642 show only ignored files
1643
1644 -n, --no-status
1645 hide status prefix
1646
1647 -C, --copies
1648 show source of copied files
1649
1650 -0, --print0
1651 end filenames with NUL, for use with xargs
1652
1653 --rev show difference from revision
1654
1655 -I, --include
1656 include names matching the given patterns
1657
1658 -X, --exclude
1659 exclude names matching the given patterns
1660
1661 aliases: st
1662
1663 summary [--remote]
1664
1665 This generates a brief summary of the working directory state,
1666 including parents, branch, commit status, and available updates.
1667
1668 With the --remote option, this will check the default paths for
1669 incoming and outgoing changes. This can be time-consuming.
1670
1671 options:
1672
1673 --remote
1674 check for push and pull
1675
1676 aliases: sum
1677
1678 tag [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME...
1679
1680 Name a particular revision using <name>.
1681
1682 Tags are used to name particular revisions of the repository and
1683 are very useful to compare different revisions, to go back to
1684 significant earlier versions or to mark branch points as
1685 releases, etc.
1686
1687 If no revision is given, the parent of the working directory is
1688 used, or tip if no revision is checked out.
1689
1690 To facilitate version control, distribution, and merging of
1691 tags, they are stored as a file named ".hgtags" which is managed
1692 similarly to other project files and can be hand-edited if nec‐
1693 essary. The file '.hg/localtags' is used for local tags (not
1694 shared among repositories).
1695
1696 See 'hg help dates' for a list of formats valid for -d/--date.
1697
1698 options:
1699
1700 -f, --force
1701 replace existing tag
1702
1703 -l, --local
1704 make the tag local
1705
1706 -r, --rev
1707 revision to tag
1708
1709 --remove
1710 remove a tag
1711
1712 -m, --message
1713 use <text> as commit message
1714
1715 -d, --date
1716 record datecode as commit date
1717
1718 -u, --user
1719 record the specified user as committer
1720
1721 tags
1722
1723 This lists both regular and local tags. When the -v/--verbose
1724 switch is used, a third column "local" is printed for local
1725 tags.
1726
1727 tip [-p]
1728
1729 The tip revision (usually just called the tip) is the changeset
1730 most recently added to the repository (and therefore the most
1731 recently changed head).
1732
1733 If you have just made a commit, that commit will be the tip. If
1734 you have just pulled changes from another repository, the tip of
1735 that repository becomes the current tip. The "tip" tag is spe‐
1736 cial and cannot be renamed or assigned to a different changeset.
1737
1738 options:
1739
1740 -p, --patch
1741 show patch
1742
1743 -g, --git
1744 use git extended diff format
1745
1746 --style
1747 display using template map file
1748
1749 --template
1750 display with template
1751
1752 unbundle [-u] FILE...
1753
1754 Apply one or more compressed changegroup files generated by the
1755 bundle command.
1756
1757 options:
1758
1759 -u, --update
1760 update to new tip if changesets were unbundled
1761
1762 update [-c] [-C] [-d DATE] [[-r] REV]
1763
1764 Update the repository's working directory to the specified
1765 changeset.
1766
1767 If no changeset is specified, attempt to update to the head of
1768 the current branch. If this head is a descendant of the working
1769 directory's parent, update to it, otherwise abort.
1770
1771 The following rules apply when the working directory contains
1772 uncommitted changes:
1773
1774 1. If neither -c/--check nor -C/--clean is specified, and if the
1775 requested changeset is an ancestor or descendant of the work‐
1776 ing directory's parent, the uncommitted changes are merged
1777 into the requested changeset and the merged result is left
1778 uncommitted. If the requested changeset is not an ancestor or
1779 descendant (that is, it is on another branch), the update is
1780 aborted and the uncommitted changes are preserved.
1781
1782 2. With the -c/--check option, the update is aborted and the
1783 uncommitted changes are preserved.
1784
1785 3. With the -C/--clean option, uncommitted changes are discarded
1786 and the working directory is updated to the requested change‐
1787 set.
1788
1789 Use null as the changeset to remove the working directory (like
1790 'hg clone -U').
1791
1792 If you want to update just one file to an older changeset, use
1793 'hg revert'.
1794
1795 See 'hg help dates' for a list of formats valid for -d/--date.
1796
1797 options:
1798
1799 -C, --clean
1800 discard uncommitted changes (no backup)
1801
1802 -c, --check
1803 check for uncommitted changes
1804
1805 -d, --date
1806 tipmost revision matching date
1807
1808 -r, --rev
1809 revision
1810
1811 aliases: up checkout co
1812
1813 verify
1814
1815 Verify the integrity of the current repository.
1816
1817 This will perform an extensive check of the repository's
1818 integrity, validating the hashes and checksums of each entry in
1819 the changelog, manifest, and tracked files, as well as the
1820 integrity of their crosslinks and indices.
1821
1822 version
1823
1824 output version and copyright information
1825
1827 Mercurial reads configuration data from several files, if they exist.
1828 Below we list the most specific file first.
1829
1830 On Windows, these configuration files are read:
1831
1832 · <repo>\.hg\hgrc
1833
1834 · %USERPROFILE%\.hgrc
1835
1836 · %USERPROFILE%\Mercurial.ini
1837
1838 · %HOME%\.hgrc
1839
1840 · %HOME%\Mercurial.ini
1841
1842 · C:\Mercurial\Mercurial.ini
1843
1844 · HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial
1845
1846 · <install-dir>\Mercurial.ini
1847
1848 On Unix, these files are read:
1849
1850 · <repo>/.hg/hgrc
1851
1852 · $HOME/.hgrc
1853
1854 · /etc/mercurial/hgrc
1855
1856 · /etc/mercurial/hgrc.d/*.rc
1857
1858 · <install-root>/etc/mercurial/hgrc
1859
1860 · <install-root>/etc/mercurial/hgrc.d/*.rc
1861
1862 The configuration files for Mercurial use a simple ini-file format. A
1863 configuration file consists of sections, led by a [section] header and
1864 followed by name = value entries:
1865
1866 [ui]
1867 username = Firstname Lastname <firstname.lastname@example.net>
1868 verbose = True
1869
1870 This above entries will be referred to as ui.username and ui.verbose,
1871 respectively. Please see the hgrc man page for a full description of
1872 the possible configuration values:
1873
1874 · on Unix-like systems: man hgrc
1875
1876 · online: http://www.selenic.com/mercurial/hgrc.5.html
1877
1879 Some commands allow the user to specify a date, e.g.:
1880
1881 · backout, commit, import, tag: Specify the commit date.
1882
1883 · log, revert, update: Select revision(s) by date.
1884
1885 Many date formats are valid. Here are some examples:
1886
1887 "Wed Dec 6 13:18:29 2006" (local timezone assumed)
1888 "Dec 6 13:18 -0600" (year assumed, time offset provided)
1889 "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
1890 "Dec 6" (midnight)
1891 "13:18" (today assumed)
1892 "3:39" (3:39AM assumed)
1893 "3:39pm" (15:39)
1894 "2006-12-06 13:18:29" (ISO 8601 format)
1895 "2006-12-6 13:18"
1896 "2006-12-6"
1897 "12-6"
1898 "12/6"
1899 "12/6/6" (Dec 6 2006)
1900
1901 Lastly, there is Mercurial's internal format:
1902
1903 "1165432709 0" (Wed Dec 6 13:18:29 2006 UTC)
1904
1905 This is the internal representation format for dates. unixtime is the
1906 number of seconds since the epoch (1970-01-01 00:00 UTC). offset is the
1907 offset of the local timezone, in seconds west of UTC (negative if the
1908 timezone is east of UTC).
1909
1910 The log command also accepts date ranges:
1911
1912 "<{datetime}" - at or before a given date/time
1913 ">{datetime}" - on or after a given date/time
1914 "{datetime} to {datetime}" - a date range, inclusive
1915 "-{days}" - within a given number of days of today
1916
1918 Mercurial accepts several notations for identifying one or more files
1919 at a time.
1920
1921 By default, Mercurial treats filenames as shell-style extended glob
1922 patterns.
1923
1924 Alternate pattern notations must be specified explicitly.
1925
1926 To use a plain path name without any pattern matching, start it with
1927 path:. These path names must completely match starting at the current
1928 repository root.
1929
1930 To use an extended glob, start a name with glob:. Globs are rooted at
1931 the current directory; a glob such as *.c will only match files in the
1932 current directory ending with .c.
1933
1934 The supported glob syntax extensions are ** to match any string across
1935 path separators and {a,b} to mean "a or b".
1936
1937 To use a Perl/Python regular expression, start a name with re:. Regexp
1938 pattern matching is anchored at the root of the repository.
1939
1940 Plain examples:
1941
1942 path:foo/bar a name bar in a directory named foo in the root
1943 of the repository
1944 path:path:name a file or directory named "path:name"
1945
1946 Glob examples:
1947
1948 glob:*.c any name ending in ".c" in the current directory
1949 *.c any name ending in ".c" in the current directory
1950 **.c any name ending in ".c" in any subdirectory of the
1951 current directory including itself.
1952 foo/*.c any name ending in ".c" in the directory foo
1953 foo/**.c any name ending in ".c" in any subdirectory of foo
1954 including itself.
1955
1956 Regexp examples:
1957
1958 re:.*\.c$ any name ending in ".c", anywhere in the repository
1959
1961 HG Path to the 'hg' executable, automatically passed when running
1962 hooks, extensions or external tools. If unset or empty, this is
1963 the hg executable's name if it's frozen, or an executable named
1964 'hg' (with %PATHEXT% [defaulting to COM/EXE/BAT/CMD] extensions
1965 on Windows) is searched.
1966
1967 HGEDITOR
1968 This is the name of the editor to run when committing. See EDI‐
1969 TOR.
1970
1971 (deprecated, use .hgrc)
1972
1973 HGENCODING
1974 This overrides the default locale setting detected by Mercurial.
1975 This setting is used to convert data including usernames,
1976 changeset descriptions, tag names, and branches. This setting
1977 can be overridden with the --encoding command-line option.
1978
1979 HGENCODINGMODE
1980 This sets Mercurial's behavior for handling unknown characters
1981 while transcoding user input. The default is "strict", which
1982 causes Mercurial to abort if it can't map a character. Other
1983 settings include "replace", which replaces unknown characters,
1984 and "ignore", which drops them. This setting can be overridden
1985 with the --encodingmode command-line option.
1986
1987 HGMERGE
1988 An executable to use for resolving merge conflicts. The program
1989 will be executed with three arguments: local file, remote file,
1990 ancestor file.
1991
1992 (deprecated, use .hgrc)
1993
1994 HGRCPATH
1995 A list of files or directories to search for hgrc files. Item
1996 separator is ":" on Unix, ";" on Windows. If HGRCPATH is not
1997 set, platform default search path is used. If empty, only the
1998 .hg/hgrc from the current repository is read.
1999
2000 For each element in HGRCPATH:
2001
2002 · if it's a directory, all files ending with .rc are added
2003
2004 · otherwise, the file itself will be added
2005
2006 HGUSER This is the string used as the author of a commit. If not set,
2007 available values will be considered in this order:
2008
2009 · HGUSER (deprecated)
2010
2011 · hgrc files from the HGRCPATH
2012
2013 · EMAIL
2014
2015 · interactive prompt
2016
2017 · LOGNAME (with @hostname appended)
2018
2019 (deprecated, use .hgrc)
2020
2021 EMAIL May be used as the author of a commit; see HGUSER.
2022
2023 LOGNAME
2024 May be used as the author of a commit; see HGUSER.
2025
2026 VISUAL This is the name of the editor to use when committing. See EDI‐
2027 TOR.
2028
2029 EDITOR Sometimes Mercurial needs to open a text file in an editor for a
2030 user to modify, for example when writing commit messages. The
2031 editor it uses is determined by looking at the environment vari‐
2032 ables HGEDITOR, VISUAL and EDITOR, in that order. The first
2033 non-empty one is chosen. If all of them are empty, the editor
2034 defaults to 'vi'.
2035
2036 PYTHONPATH
2037 This is used by Python to find imported modules and may need to
2038 be set appropriately if this Mercurial is not installed sys‐
2039 tem-wide.
2040
2042 Mercurial supports several ways to specify individual revisions.
2043
2044 A plain integer is treated as a revision number. Negative integers are
2045 treated as sequential offsets from the tip, with -1 denoting the tip,
2046 -2 denoting the revision prior to the tip, and so forth.
2047
2048 A 40-digit hexadecimal string is treated as a unique revision identi‐
2049 fier.
2050
2051 A hexadecimal string less than 40 characters long is treated as a
2052 unique revision identifier and is referred to as a short-form identi‐
2053 fier. A short-form identifier is only valid if it is the prefix of
2054 exactly one full-length identifier.
2055
2056 Any other string is treated as a tag or branch name. A tag name is a
2057 symbolic name associated with a revision identifier. A branch name
2058 denotes the tipmost revision of that branch. Tag and branch names must
2059 not contain the ":" character.
2060
2061 The reserved name "tip" is a special tag that always identifies the
2062 most recent revision.
2063
2064 The reserved name "null" indicates the null revision. This is the revi‐
2065 sion of an empty repository, and the parent of revision 0.
2066
2067 The reserved name "." indicates the working directory parent. If no
2068 working directory is checked out, it is equivalent to null. If an
2069 uncommitted merge is in progress, "." is the revision of the first par‐
2070 ent.
2071
2073 When Mercurial accepts more than one revision, they may be specified
2074 individually, or provided as a topologically continuous range, sepa‐
2075 rated by the ":" character.
2076
2077 The syntax of range notation is [BEGIN]:[END], where BEGIN and END are
2078 revision identifiers. Both BEGIN and END are optional. If BEGIN is not
2079 specified, it defaults to revision number 0. If END is not specified,
2080 it defaults to the tip. The range ":" thus means "all revisions".
2081
2082 If BEGIN is greater than END, revisions are treated in reverse order.
2083
2084 A range acts as a closed interval. This means that a range of 3:5 gives
2085 3, 4 and 5. Similarly, a range of 9:6 gives 9, 8, 7, and 6.
2086
2088 Mercurial's default format for showing changes between two versions of
2089 a file is compatible with the unified format of GNU diff, which can be
2090 used by GNU patch and many other standard tools.
2091
2092 While this standard format is often enough, it does not encode the fol‐
2093 lowing information:
2094
2095 · executable status and other permission bits
2096
2097 · copy or rename information
2098
2099 · changes in binary files
2100
2101 · creation or deletion of empty files
2102
2103 Mercurial also supports the extended diff format from the git VCS which
2104 addresses these limitations. The git diff format is not produced by
2105 default because a few widespread tools still do not understand this
2106 format.
2107
2108 This means that when generating diffs from a Mercurial repository (e.g.
2109 with "hg export"), you should be careful about things like file copies
2110 and renames or other things mentioned above, because when applying a
2111 standard diff to a different repository, this extra information is
2112 lost. Mercurial's internal operations (like push and pull) are not
2113 affected by this, because they use an internal binary format for commu‐
2114 nicating changes.
2115
2116 To make Mercurial produce the git extended diff format, use the --git
2117 option available for many commands, or set 'git = True' in the [diff]
2118 section of your hgrc. You do not need to set this option when importing
2119 diffs in this format or using them in the mq extension.
2120
2122 Mercurial allows you to customize output of commands through templates.
2123 You can either pass in a template from the command line, via the --tem‐
2124 plate option, or select an existing template-style (--style).
2125
2126 You can customize output for any "log-like" command: log, outgoing,
2127 incoming, tip, parents, heads and glog.
2128
2129 Three styles are packaged with Mercurial: default (the style used when
2130 no explicit preference is passed), compact and changelog. Usage:
2131
2132 $ hg log -r1 --style changelog
2133
2134 A template is a piece of text, with markup to invoke variable expan‐
2135 sion:
2136
2137 $ hg log -r1 --template "{node}\n"
2138 b56ce7b07c52de7d5fd79fb89701ea538af65746
2139
2140 Strings in curly braces are called keywords. The availability of key‐
2141 words depends on the exact context of the templater. These keywords are
2142 usually available for templating a log-like command:
2143
2144 author String. The unmodified author of the changeset.
2145
2146 branches
2147 String. The name of the branch on which the changeset was com‐
2148 mitted. Will be empty if the branch name was default.
2149
2150 date Date information. The date when the changeset was committed.
2151
2152 desc String. The text of the changeset description.
2153
2154 diffstat
2155 String. Statistics of changes with the following format: "modi‐
2156 fied files: +added/-removed lines"
2157
2158 files List of strings. All files modified, added, or removed by this
2159 changeset.
2160
2161 file_adds
2162 List of strings. Files added by this changeset.
2163
2164 file_mods
2165 List of strings. Files modified by this changeset.
2166
2167 file_dels
2168 List of strings. Files removed by this changeset.
2169
2170 node String. The changeset identification hash, as a 40-character
2171 hexadecimal string.
2172
2173 parents
2174 List of strings. The parents of the changeset.
2175
2176 rev Integer. The repository-local changeset revision number.
2177
2178 tags List of strings. Any tags associated with the changeset.
2179
2180 latesttag
2181 String. Most recent global tag in the ancestors of this change‐
2182 set.
2183
2184 latesttagdistance
2185 Integer. Longest path to the latest tag.
2186
2187 The "date" keyword does not produce human-readable output. If you want
2188 to use a date in your output, you can use a filter to process it. Fil‐
2189 ters are functions which return a string based on the input variable.
2190 You can also use a chain of filters to get the desired output:
2191
2192 $ hg tip --template "{date|isodate}\n"
2193 2008-08-21 18:22 +0000
2194
2195 List of filters:
2196
2197 addbreaks
2198 Any text. Add an XHTML "<br />" tag before the end of every line
2199 except the last.
2200
2201 age Date. Returns a human-readable date/time difference between the
2202 given date/time and the current date/time.
2203
2204 basename
2205 Any text. Treats the text as a path, and returns the last compo‐
2206 nent of the path after splitting by the path separator (ignoring
2207 trailing separators). For example, "foo/bar/baz" becomes "baz"
2208 and "foo/bar//" becomes "bar".
2209
2210 stripdir
2211 Treat the text as path and strip a directory level, if possible.
2212 For example, "foo" and "foo/bar" becomes "foo".
2213
2214 date Date. Returns a date in a Unix date format, including the time‐
2215 zone: "Mon Sep 04 15:13:13 2006 0700".
2216
2217 domain Any text. Finds the first string that looks like an email
2218 address, and extracts just the domain component. Example: User
2219 <user@example.com> becomes example.com.
2220
2221 email Any text. Extracts the first string that looks like an email
2222 address. Example: User <user@example.com> becomes user@exam‐
2223 ple.com.
2224
2225 escape Any text. Replaces the special XML/XHTML characters "&", "<" and
2226 ">" with XML entities.
2227
2228 fill68 Any text. Wraps the text to fit in 68 columns.
2229
2230 fill76 Any text. Wraps the text to fit in 76 columns.
2231
2232 firstline
2233 Any text. Returns the first line of text.
2234
2235 nonempty
2236 Any text. Returns '(none)' if the string is empty.
2237
2238 hgdate Date. Returns the date as a pair of numbers: "1157407993 25200"
2239 (Unix timestamp, timezone offset).
2240
2241 isodate
2242 Date. Returns the date in ISO 8601 format: "2009-08-18 13:00
2243 +0200".
2244
2245 isodatesec
2246 Date. Returns the date in ISO 8601 format, including seconds:
2247 "2009-08-18 13:00:13 +0200". See also the rfc3339date filter.
2248
2249 localdate
2250 Date. Converts a date to local date.
2251
2252 obfuscate
2253 Any text. Returns the input text rendered as a sequence of XML
2254 entities.
2255
2256 person Any text. Returns the text before an email address.
2257
2258 rfc822date
2259 Date. Returns a date using the same format used in email head‐
2260 ers: "Tue, 18 Aug 2009 13:00:13 +0200".
2261
2262 rfc3339date
2263 Date. Returns a date using the Internet date format specified in
2264 RFC 3339: "2009-08-18T13:00:13+02:00".
2265
2266 short Changeset hash. Returns the short form of a changeset hash, i.e.
2267 a 12-byte hexadecimal string.
2268
2269 shortdate
2270 Date. Returns a date like "2006-09-18".
2271
2272 strip Any text. Strips all leading and trailing whitespace.
2273
2274 tabindent
2275 Any text. Returns the text, with every line except the first
2276 starting with a tab character.
2277
2278 urlescape
2279 Any text. Escapes all "special" characters. For example, "foo
2280 bar" becomes "foo%20bar".
2281
2282 user Any text. Returns the user portion of an email address.
2283
2285 Valid URLs are of the form:
2286
2287 local/filesystem/path[#revision]
2288 file://local/filesystem/path[#revision]
2289 http://[user[:pass]@]host[:port]/[path][#revision]
2290 https://[user[:pass]@]host[:port]/[path][#revision]
2291 ssh://[user[:pass]@]host[:port]/[path][#revision]
2292
2293 Paths in the local filesystem can either point to Mercurial reposito‐
2294 ries or to bundle files (as created by 'hg bundle' or 'hg incoming
2295 --bundle').
2296
2297 An optional identifier after # indicates a particular branch, tag, or
2298 changeset to use from the remote repository. See also 'hg help revi‐
2299 sions'.
2300
2301 Some features, such as pushing to http:// and https:// URLs are only
2302 possible if the feature is explicitly enabled on the remote Mercurial
2303 server.
2304
2305 Some notes about using SSH with Mercurial:
2306
2307 · SSH requires an accessible shell account on the destination machine
2308 and a copy of hg in the remote path or specified with as remotecmd.
2309
2310 · path is relative to the remote user's home directory by default. Use
2311 an extra slash at the start of a path to specify an absolute path:
2312
2313 ssh://example.com//tmp/repository
2314
2315 · Mercurial doesn't use its own compression via SSH; the right thing to
2316 do is to configure it in your ~/.ssh/config, e.g.:
2317
2318 Host *.mylocalnetwork.example.com
2319 Compression no
2320 Host *
2321 Compression yes
2322
2323 Alternatively specify "ssh -C" as your ssh command in your hgrc or
2324 with the --ssh command line option.
2325
2326 These URLs can all be stored in your hgrc with path aliases under the
2327 [paths] section like so:
2328
2329 [paths]
2330 alias1 = URL1
2331 alias2 = URL2
2332 ...
2333
2334 You can then use the alias for any command that uses a URL (for example
2335 'hg pull alias1' will be treated as 'hg pull URL1').
2336
2337 Two path aliases are special because they are used as defaults when you
2338 do not provide the URL to a command:
2339
2340 default:
2341 When you create a repository with hg clone, the clone command
2342 saves the location of the source repository as the new reposi‐
2343 tory's 'default' path. This is then used when you omit path from
2344 push- and pull-like commands (including incoming and outgoing).
2345
2346 default-push:
2347 The push command will look for a path named 'default-push', and
2348 prefer it over 'default' if both are defined.
2349
2351 Mercurial has the ability to add new features through the use of exten‐
2352 sions. Extensions may add new commands, add options to existing com‐
2353 mands, change the default behavior of commands, or implement hooks.
2354
2355 Extensions are not loaded by default for a variety of reasons: they can
2356 increase startup overhead; they may be meant for advanced usage only;
2357 they may provide potentially dangerous abilities (such as letting you
2358 destroy or modify history); they might not be ready for prime time; or
2359 they may alter some usual behaviors of stock Mercurial. It is thus up
2360 to the user to activate extensions as needed.
2361
2362 To enable the "foo" extension, either shipped with Mercurial or in the
2363 Python search path, create an entry for it in your hgrc, like this:
2364
2365 [extensions]
2366 foo =
2367
2368 You may also specify the full path to an extension:
2369
2370 [extensions]
2371 myfeature = ~/.hgext/myfeature.py
2372
2373 To explicitly disable an extension enabled in an hgrc of broader scope,
2374 prepend its path with !:
2375
2376 [extensions]
2377 # disabling extension bar residing in /path/to/extension/bar.py
2378 hgext.bar = !/path/to/extension/bar.py
2379 # ditto, but no path was supplied for extension baz
2380 hgext.baz = !
2381
2382 disabled extensions:
2383
2384 acl hooks for controlling repository access
2385
2386 bookmarks
2387 track a line of development with movable markers
2388
2389 bugzilla
2390 hooks for integrating with the Bugzilla bug tracker
2391
2392 children
2393 command to display child changesets
2394
2395 churn command to display statistics about repository history
2396
2397 color colorize output from some commands
2398
2399 convert
2400 import revisions from foreign VCS repositories into Mercurial
2401
2402 extdiff
2403 command to allow external programs to compare revisions
2404
2405 fetch pull, update and merge in one command
2406
2407 gpg commands to sign and verify changesets
2408
2409 graphlog
2410 command to view revision graphs from a shell
2411
2412 hgcia hooks for integrating with the CIA.vc notification service
2413
2414 hgk browse the repository in a graphical way
2415
2416 highlight
2417 syntax highlighting for hgweb (requires Pygments)
2418
2419 inotify
2420 accelerate status report using Linux's inotify service
2421
2422 interhg
2423 expand expressions into changelog and summaries
2424
2425 keyword
2426 expand keywords in tracked files
2427
2428 mq manage a stack of patches
2429
2430 notify hooks for sending email notifications at commit/push time
2431
2432 pager browse command output with an external pager
2433
2434 parentrevspec
2435 interpret suffixes to refer to ancestor revisions
2436
2437 patchbomb
2438 command to send changesets as (a series of) patch emails
2439
2440 purge command to delete untracked files from the working directory
2441
2442 rebase command to move sets of revisions to a different ancestor
2443
2444 record commands to interactively select changes for commit/qrefresh
2445
2446 relink recreates hardlinks between repository clones
2447
2448 share share a common history between several working directories
2449
2450 transplant
2451 command to transplant changesets from another branch
2452
2453 win32mbcs
2454 allow the use of MBCS paths with problematic encodings
2455
2456 win32text
2457 perform automatic newline conversion
2458
2459 zeroconf
2460 discover and advertise repositories on the local network
2461
2463 .hgignore
2464
2465 This file contains regular expressions (one per line) that
2466 describe file names that should be ignored by hg. For details,
2467 see hgignore(5).
2468
2469 .hgtags
2470
2471 This file contains changeset hash values and text tag names (one
2472 of each separated by spaces) that correspond to tagged versions
2473 of the repository contents.
2474
2475 /etc/mercurial/hgrc, $HOME/.hgrc, .hg/hgrc
2476
2477 This file contains defaults and configuration. Values in
2478 .hg/hgrc override those in $HOME/.hgrc, and these override set‐
2479 tings made in the global /etc/mercurial/hgrc configuration. See
2480 hgrc(5) for details of the contents and format of these files.
2481
2482 Some commands (e.g. revert) produce backup files ending in .orig, if
2483 the .orig file already exists and is not tracked by Mercurial, it will
2484 be overwritten.
2485
2487 Probably lots, please post them to the mailing list (see Resources
2488 below) when you find them.
2489
2491 hgignore(5), hgrc(5)
2492
2494 Written by Matt Mackall <mpm@selenic.com>
2495
2497 Main Web Site: http://mercurial.selenic.com/
2498
2499 Source code repository: http://selenic.com/hg
2500
2501 Mailing list: http://selenic.com/mailman/listinfo/mercurial
2502
2504 Copyright (C) 2005-2009 Matt Mackall. Free use of this software is
2505 granted under the terms of the GNU General Public License version 2.
2506
2508 Matt Mackall <mpm@selenic.com>
2509
2510 Organization: Mercurial
2511
2512
2513
2514
2515 HG(1)