3 hg \- Mercurial source code management system
18 command provides a command line interface to the Mercurial system.
20 .SH "COMMAND ELEMENTS"
24 indicates one or more filename or relative path filenames; see
26 for information on pattern matching
31 indicates a path on the local machine
36 indicates a changeset which can be specified as a changeset revision number, a tag, or a unique substring of the changeset hash value
41 either the pathname of a local repository or the URI of a remote repository. There are two available URI protocols, http:// which is fast and the static\-http:// protocol which is much slower but does not require a special server on the web host.
47 repository root directory or symbolic path name
52 change working directory
55 \-y, \-\-noninteractive
59 for any required answers
69 enable additional output
74 set/override config option
79 enable debugging output
89 set the charset encoding (default: UTF\-8)
94 set the charset encoding mode (default: strict)
99 print improved command execution profile
104 print traceback on exception
109 time how long the command takes
114 print command execution profile
119 output version information and exit
124 display help and exit
128 add [OPTION]... [FILE]...
130 Schedule files to be version controlled and added to the repository.
134 The files will be added to the repository at the next commit. To
135 undo an add before that, see hg revert.
141 If no names are given, add all files in the repository.
148 \-I, \-\-include include names matching the given patterns
149 \-X, \-\-exclude exclude names matching the given patterns
150 \-n, \-\-dry\-run do not perform actions, just print output
155 addremove [OPTION]... [FILE]...
157 Add all new files and remove all missing files from the repository.
161 New files are ignored if they match any of the patterns in .hgignore. As
162 with add, these changes take effect at the next commit.
168 Use the \-s option to detect renamed files. With a parameter > 0,
169 this compares every removed file with every added file and records
170 those similar enough as renames. This option takes a percentage
171 between 0 (disabled) and 100 (files must be identical) as its
172 parameter. Detecting renamed files this way can be expensive.
179 \-s, \-\-similarity guess renamed files by similarity (0<=s<=100)
180 \-I, \-\-include include names matching the given patterns
181 \-X, \-\-exclude exclude names matching the given patterns
182 \-n, \-\-dry\-run do not perform actions, just print output
187 annotate [\-r REV] [\-f] [\-a] [\-u] [\-d] [\-n] [\-c] [\-l] FILE...
189 List changes in files, showing the revision id responsible for each line
193 This command is useful to discover who did a change or when a change took
200 Without the \-a option, annotate will avoid processing files it
201 detects as binary. With \-a, annotate will generate an annotation
202 anyway, probably with undesirable results.
209 \-r, \-\-rev annotate the specified revision
210 \-f, \-\-follow follow file copies and renames
211 \-a, \-\-text treat all files as text
212 \-u, \-\-user list the author (long with \-v)
213 \-d, \-\-date list the date (short with \-q)
214 \-n, \-\-number list the revision number (default)
215 \-c, \-\-changeset list the changeset
216 \-l, \-\-line\-number show line number at the first appearance
217 \-I, \-\-include include names matching the given patterns
218 \-X, \-\-exclude exclude names matching the given patterns
229 archive [OPTION]... DEST
231 By default, the revision used is the parent of the working directory; use "\-r" to specify a different revision.
235 To specify the type of archive to create, use "\-t". Valid
242 "files" (default): a directory full of files
243 "tar": tar archive, uncompressed
244 "tbz2": tar archive, compressed using bzip2
245 "tgz": tar archive, compressed using gzip
246 "uzip": zip archive, uncompressed
247 "zip": zip archive, compressed using deflate
253 The exact name of the destination archive or directory is given
254 using a format string; see "hg help export" for details.
260 Each member added to an archive file has a directory prefix
261 prepended. Use "\-p" to specify a format string for the prefix.
262 The default is the basename of the archive, with suffixes removed.
269 \-\-no\-decode do not pass files through decoders
270 \-p, \-\-prefix directory prefix for files in archive
271 \-r, \-\-rev revision to distribute
272 \-t, \-\-type type of distribution to create
273 \-I, \-\-include include names matching the given patterns
274 \-X, \-\-exclude exclude names matching the given patterns
279 backout [OPTION]... [\-r] REV
281 Commit the backed out changes as a new changeset. The new changeset is a child of the backed out changeset.
285 If you back out a changeset other than the tip, a new head is
286 created. This head will be the new tip and you should merge this
287 backout changeset with another head (current one by default).
293 The \-\-merge option remembers the parent of the working directory
294 before starting the backout, then merges the new head with that
295 changeset afterwards. This saves you from doing the merge by
296 hand. The result of this merge is not committed, as for a normal
303 See \'hg help dates\' for a list of formats valid for \-d/\-\-date.
310 \-\-merge merge with old dirstate parent after backout
311 \-\-parent parent to choose when backing out merge
312 \-r, \-\-rev revision to backout
313 \-I, \-\-include include names matching the given patterns
314 \-X, \-\-exclude exclude names matching the given patterns
315 \-m, \-\-message use <text> as commit message
316 \-l, \-\-logfile read commit message from <file>
317 \-d, \-\-date record datecode as commit date
318 \-u, \-\-user record user as committer
323 bisect [\-gbsr] [REV]
325 This command helps to find changesets which introduce problems. To use, mark the earliest changeset you know exhibits the problem as bad, then mark the latest changeset which is free from the problem as good. Bisect will update your working directory to a revision for testing. Once you have performed tests, mark the working directory as bad or good and bisect will either update to another candidate changeset or announce that it has found the bad revision.
330 \-r, \-\-reset reset bisect state
331 \-g, \-\-good mark changeset good
332 \-b, \-\-bad mark changeset bad
333 \-s, \-\-skip skip testing changeset
334 \-U, \-\-noupdate do not update to target
341 With no argument, show the current branch name. With one argument, set the working directory branch name (the branch does not exist in the repository until the next commit).
345 Unless \-\-force is specified, branch will not let you set a
346 branch name that shadows an existing branch.
352 Use the command \'hg update\' to switch to an existing branch.
359 \-f, \-\-force set branch name even if it shadows an existing branch
366 List the repository\'s named branches, indicating which ones are inactive. If active is specified, only show active branches.
370 A branch is considered active if it contains repository heads.
376 Use the command \'hg update\' to switch to an existing branch.
383 \-a, \-\-active show only branches that have unmerged heads
388 bundle [\-f] [\-a] [\-r REV]... [\-\-base REV]... FILE [DEST]
390 Generate a compressed changegroup file collecting changesets not found in the other repository.
394 If no destination repository is specified the destination is
395 assumed to have all the nodes specified by one or more \-\-base
396 parameters. To create a bundle containing all changesets, use
397 \-\-all (or \-\-base null).
403 The bundle file can then be transferred using conventional means and
404 applied to another repository with the unbundle or pull command.
405 This is useful when direct push and pull are not available or when
406 exporting an entire repository is undesirable.
412 Applying bundles preserves all changeset contents including
413 permissions, copy/rename information, and revision history.
420 \-f, \-\-force run even when remote repository is unrelated
421 \-r, \-\-rev a changeset up to which you would like to bundle
422 \-\-base a base changeset to specify instead of a destination
423 \-a, \-\-all bundle all changesets in the repository
424 \-e, \-\-ssh specify ssh command to use
425 \-\-remotecmd specify hg command to run on the remote side
430 cat [OPTION]... FILE...
432 Print the specified files as they were at the given revision. If no revision is given, the parent of the working directory is used, or tip if no revision is checked out.
436 Output may be to a file, in which case the name of the file is
437 given using a format string. The formatting rules are the same as
438 for the export command, with the following additions:
444 %s basename of file being printed
445 %d dirname of file being printed, or \'.\' if in repo root
446 %p root\-relative path name of file being printed
453 \-o, \-\-output print output to file with formatted name
454 \-r, \-\-rev print the given revision
455 \-\-decode apply any matching decode filter
456 \-I, \-\-include include names matching the given patterns
457 \-X, \-\-exclude exclude names matching the given patterns
462 clone [OPTION]... SOURCE [DEST]
464 Create a copy of an existing repository in a new directory.
468 If no destination directory name is specified, it defaults to the
469 basename of the source.
475 The location of the source is added to the new repository\'s
476 .hg/hgrc file, as the default to be used for future pulls.
482 For efficiency, hardlinks are used for cloning whenever the source
483 and destination are on the same filesystem (note this applies only
484 to the repository data, not to the checked out files). Some
485 filesystems, such as AFS, implement hardlinking incorrectly, but
486 do not report errors. In these cases, use the \-\-pull option to
493 You can safely clone repositories and checked out files using full
500 $ cp \-al REPO REPOCLONE
506 which is the fastest way to clone. However, the operation is not
507 atomic (making sure REPO is not modified during the operation is
508 up to you) and you have to make sure your editor breaks hardlinks
509 (Emacs and most Linux Kernel tools do so).
515 If you use the \-r option to clone up to a specific revision, no
516 subsequent revisions will be present in the cloned repository.
517 This option implies \-\-pull, even on local repositories.
523 If the \-U option is used, the new clone will contain only a repository
524 (.hg) and no working copy (the working copy parent is the null revision).
530 See pull for valid source format details.
536 It is possible to specify an ssh:// URL as the destination, but no
537 .hg/hgrc and working directory will be created on the remote side.
538 Look at the help text for the pull command for important details
546 \-U, \-\-noupdate the clone will only contain a repository (no
548 \-r, \-\-rev a changeset you would like to have after cloning
549 \-\-pull use pull protocol to copy metadata
550 \-\-uncompressed use uncompressed transfer (fast over LAN)
551 \-e, \-\-ssh specify ssh command to use
552 \-\-remotecmd specify hg command to run on the remote side
557 commit [OPTION]... [FILE]...
559 Commit changes to the given files into the repository.
563 If a list of files is omitted, all changes reported by "hg status"
570 If you are committing the result of a merge, do not provide any
571 file names or \-I/\-X filters.
577 If no commit message is specified, the configured editor is started to
584 See \'hg help dates\' for a list of formats valid for \-d/\-\-date.
591 \-A, \-\-addremove mark new/missing files as added/removed before
593 \-I, \-\-include include names matching the given patterns
594 \-X, \-\-exclude exclude names matching the given patterns
595 \-m, \-\-message use <text> as commit message
596 \-l, \-\-logfile read commit message from <file>
597 \-d, \-\-date record datecode as commit date
598 \-u, \-\-user record user as committer
609 copy [OPTION]... [SOURCE]... DEST
611 Mark dest as having copies of source files. If dest is a directory, copies are put in that directory. If dest is a file, there can only be one source.
615 By default, this command copies the contents of files as they
616 stand in the working directory. If invoked with \-\-after, the
617 operation is recorded, but no copying is performed.
623 This command takes effect in the next commit. To undo a copy
624 before that, see hg revert.
631 \-A, \-\-after record a copy that has already occurred
632 \-f, \-\-force forcibly copy over an existing managed file
633 \-I, \-\-include include names matching the given patterns
634 \-X, \-\-exclude exclude names matching the given patterns
635 \-n, \-\-dry\-run do not perform actions, just print output
646 diff [OPTION]... [\-r REV1 [\-r REV2]] [FILE]...
648 Show differences between revisions for the specified files.
652 Differences between files are shown using the unified diff format.
658 NOTE: diff may generate unexpected results for merges, as it will
659 default to comparing against the working directory\'s first parent
660 changeset if no revisions are specified.
666 When two revision arguments are given, then changes are shown
667 between those revisions. If only one revision is specified then
668 that revision is compared to the working directory, and, when no
669 revisions are specified, the working directory files are compared
676 Without the \-a option, diff will avoid generating diffs of files
677 it detects as binary. With \-a, diff will generate a diff anyway,
678 probably with undesirable results.
685 \-r, \-\-rev revision
686 \-a, \-\-text treat all files as text
687 \-p, \-\-show\-function show which function each change is in
688 \-g, \-\-git use git extended diff format
689 \-\-nodates don\'t include dates in diff headers
690 \-w, \-\-ignore\-all\-space ignore white space when comparing lines
691 \-b, \-\-ignore\-space\-change ignore changes in the amount of white
693 \-B, \-\-ignore\-blank\-lines ignore changes whose lines are all
695 \-U, \-\-unified number of lines of context to show
696 \-I, \-\-include include names matching the given
698 \-X, \-\-exclude exclude names matching the given
704 export [OPTION]... [\-o OUTFILESPEC] REV...
706 Print the changeset header and diffs for one or more revisions.
710 The information shown in the changeset header is: author,
711 changeset hash, parent(s) and commit comment.
717 NOTE: export may generate unexpected diff output for merge changesets,
718 as it will compare the merge changeset against its first parent only.
724 Output may be to a file, in which case the name of the file is
725 given using a format string. The formatting rules are as follows:
731 %% literal "%" character
732 %H changeset hash (40 bytes of hexadecimal)
733 %N number of patches being generated
734 %R changeset revision number
735 %b basename of the exporting repository
736 %h short\-form changeset hash (12 bytes of hexadecimal)
737 %n zero\-padded sequence number, starting at 1
738 %r zero\-padded changeset revision number
744 Without the \-a option, export will avoid generating diffs of files
745 it detects as binary. With \-a, export will generate a diff anyway,
746 probably with undesirable results.
752 With the \-\-switch\-parent option, the diff will be against the second
753 parent. It can be useful to review a merge.
760 \-o, \-\-output print output to file with formatted name
761 \-a, \-\-text treat all files as text
762 \-g, \-\-git use git extended diff format
763 \-\-nodates don\'t include dates in diff headers
764 \-\-switch\-parent diff against the second parent
769 grep [OPTION]... PATTERN [FILE]...
771 Search revisions of files for a regular expression.
775 This command behaves differently than Unix grep. It only accepts
776 Python/Perl regexps. It searches repository history, not the
777 working directory. It always prints the revision number in which
784 By default, grep only prints output for the first revision of a
785 file in which it finds a match. To get it to print every revision
786 that contains a change in match status ("\-" for a match that
787 becomes a non\-match, or "+" for a non\-match that becomes a match),
788 use the \-\-all flag.
795 \-0, \-\-print0 end fields with NUL
796 \-\-all print all revisions that match
797 \-f, \-\-follow follow changeset history, or file
798 history across copies and renames
799 \-i, \-\-ignore\-case ignore case when matching
800 \-l, \-\-files\-with\-matches print only filenames and revs that match
801 \-n, \-\-line\-number print matching line numbers
802 \-r, \-\-rev search in given revision range
803 \-u, \-\-user list the author (long with \-v)
804 \-d, \-\-date list the date (short with \-q)
805 \-I, \-\-include include names matching the given
807 \-X, \-\-exclude exclude names matching the given
813 heads [\-r REV] [REV]...
815 With no arguments, show all repository head changesets.
819 If branch or revisions names are given this will show the heads of
820 the specified branches or the branches those revisions are tagged
827 Repository "heads" are changesets that don\'t have child
828 changesets. They are where development generally takes place and
829 are the usual targets for update and merge operations.
835 Branch heads are changesets that have a given branch tag, but have
836 no child changesets with that tag. They are usually where
837 development on the given branch takes place.
844 \-r, \-\-rev show only heads which are descendants of rev
845 \-\-style display using template map file
846 \-\-template display with template
853 With no arguments, print a list of commands and short help.
857 Given a command name, print help for that command.
863 Given an extension name, print help for that extension, and the
864 commands it provides.
869 identify [\-nibt] [\-r REV] [SOURCE]
871 With no revision, print a summary of the current state of the repo.
875 With a path, do a lookup in another repository.
881 This summary identifies the repository state using one or two parent
882 hash identifiers, followed by a "+" if there are uncommitted changes
883 in the working directory, a list of tags for this revision and a branch
884 name for non\-default branches.
891 \-r, \-\-rev identify the specified rev
892 \-n, \-\-num show local revision number
893 \-i, \-\-id show global revision id
894 \-b, \-\-branch show branch
895 \-t, \-\-tags show tags
906 import [OPTION]... PATCH...
908 Import a list of patches and commit them individually.
912 If there are outstanding changes in the working directory, import
913 will abort unless given the \-f flag.
919 You can import a patch straight from a mail message. Even patches
920 as attachments work (body part must be type text/plain or
921 text/x\-patch to be used). From and Subject headers of email
922 message are used as default committer and commit message. All
923 text/plain body parts before first diff are added to commit
930 If the imported patch was generated by hg export, user and description
931 from patch override values from message headers and body. Values
932 given on command line with \-m and \-u override these.
938 If \-\-exact is specified, import will set the working directory
939 to the parent of each patch before applying it, and will abort
940 if the resulting changeset has a different ID than the one
941 recorded in the patch. This may happen due to character set
942 problems or other deficiencies in the text patch format.
948 To read a patch from standard input, use patch name "\-".
949 See \'hg help dates\' for a list of formats valid for \-d/\-\-date.
956 \-p, \-\-strip directory strip option for patch. This has the
957 same meaning as the corresponding patch option
959 \-b, \-\-base base path
960 \-f, \-\-force skip check for outstanding uncommitted changes
961 \-\-no\-commit don\'t commit, just update the working directory
962 \-\-exact apply patch to the nodes from which it was
964 \-\-import\-branch Use any branch information in patch (implied by
966 \-m, \-\-message use <text> as commit message
967 \-l, \-\-logfile read commit message from <file>
968 \-d, \-\-date record datecode as commit date
969 \-u, \-\-user record user as committer
980 incoming [\-p] [\-n] [\-M] [\-f] [\-r REV]... [\-\-bundle FILENAME] [SOURCE]
982 Show new changesets found in the specified path/URL or the default pull location. These are the changesets that would be pulled if a pull was requested.
986 For remote repository, using \-\-bundle avoids downloading the changesets
987 twice if the incoming is followed by a pull.
993 See pull for valid source format details.
1000 \-f, \-\-force run even when remote repository is unrelated
1001 \-n, \-\-newest\-first show newest record first
1002 \-\-bundle file to store the bundles into
1003 \-r, \-\-rev a specific revision up to which you would like
1005 \-p, \-\-patch show patch
1006 \-l, \-\-limit limit number of changes displayed
1007 \-M, \-\-no\-merges do not show merges
1008 \-\-style display using template map file
1009 \-\-template display with template
1010 \-e, \-\-ssh specify ssh command to use
1011 \-\-remotecmd specify hg command to run on the remote side
1022 init [\-e CMD] [\-\-remotecmd CMD] [DEST]
1024 Initialize a new repository in the given directory. If the given directory does not exist, it is created.
1028 If no directory is given, the current directory is used.
1034 It is possible to specify an ssh:// URL as the destination.
1035 Look at the help text for the pull command for important details
1043 \-e, \-\-ssh specify ssh command to use
1044 \-\-remotecmd specify hg command to run on the remote side
1049 locate [OPTION]... [PATTERN]...
1051 Print all files under Mercurial control whose names match the given patterns.
1055 This command searches the entire repository by default. To search
1056 just the current directory and its subdirectories, use
1063 If no patterns are given to match, this command prints all file
1070 If you want to feed the output of this command into the "xargs"
1071 command, use the "\-0" option to both this command and "xargs".
1072 This will avoid the problem of "xargs" treating single filenames
1073 that contain white space as multiple filenames.
1080 \-r, \-\-rev search the repository as it stood at rev
1081 \-0, \-\-print0 end filenames with NUL, for use with xargs
1082 \-f, \-\-fullpath print complete paths from the filesystem root
1083 \-I, \-\-include include names matching the given patterns
1084 \-X, \-\-exclude exclude names matching the given patterns
1089 log [OPTION]... [FILE]
1091 Print the revision history of the specified files or the entire project.
1095 File history is shown without following rename or copy history of
1096 files. Use \-f/\-\-follow with a file name to follow history across
1097 renames and copies. \-\-follow without a file name will only show
1098 ancestors or descendants of the starting revision. \-\-follow\-first
1099 only follows the first parent of merge revisions.
1105 If no revision range is specified, the default is tip:0 unless
1106 \-\-follow is set, in which case the working directory parent is
1107 used as the starting revision.
1113 See \'hg help dates\' for a list of formats valid for \-d/\-\-date.
1119 By default this command outputs: changeset id and hash, tags,
1120 non\-trivial parents, user, date and time, and a summary for each
1121 commit. When the \-v/\-\-verbose switch is used, the list of changed
1122 files and full commit message is shown.
1128 NOTE: log \-p may generate unexpected diff output for merge
1129 changesets, as it will compare the merge changeset against its
1130 first parent only. Also, the files: list will only reflect files
1131 that are different from BOTH parents.
1138 \-f, \-\-follow follow changeset history, or file history
1139 across copies and renames
1140 \-\-follow\-first only follow the first parent of merge
1142 \-d, \-\-date show revs matching date spec
1143 \-C, \-\-copies show copied files
1144 \-k, \-\-keyword do case\-insensitive search for a keyword
1145 \-r, \-\-rev show the specified revision or range
1146 \-\-removed include revs where files were removed
1147 \-m, \-\-only\-merges show only merges
1148 \-b, \-\-only\-branch show only changesets within the given named
1150 \-P, \-\-prune do not display revision or any of its ancestors
1151 \-p, \-\-patch show patch
1152 \-l, \-\-limit limit number of changes displayed
1153 \-M, \-\-no\-merges do not show merges
1154 \-\-style display using template map file
1155 \-\-template display with template
1156 \-I, \-\-include include names matching the given patterns
1157 \-X, \-\-exclude exclude names matching the given patterns
1170 Print a list of version controlled files for the given revision. If no revision is given, the parent of the working directory is used, or tip if no revision is checked out.
1174 The manifest is the list of files being version controlled. If no revision
1175 is given then the first parent of the working directory is used.
1181 With \-v flag, print file permissions, symlink and executable bits. With
1182 \-\-debug flag, print file revision hashes.
1189 \-r, \-\-rev revision to display
1194 merge [\-f] [[\-r] REV]
1196 Merge the contents of the current working directory and the requested revision. Files that changed between either parent are marked as changed for the next commit and a commit must be performed before any further updates are allowed.
1200 If no revision is specified, the working directory\'s parent is a
1201 head revision, and the repository contains exactly one other head,
1202 the other head is merged with by default. Otherwise, an explicit
1203 revision to merge with must be provided.
1210 \-f, \-\-force force a merge with outstanding changes
1211 \-r, \-\-rev revision to merge
1216 outgoing [\-M] [\-p] [\-n] [\-f] [\-r REV]... [DEST]
1218 Show changesets not found in the specified destination repository or the default push location. These are the changesets that would be pushed if a push was requested.
1222 See pull for valid destination format details.
1229 \-f, \-\-force run even when remote repository is unrelated
1230 \-r, \-\-rev a specific revision up to which you would like
1232 \-n, \-\-newest\-first show newest record first
1233 \-p, \-\-patch show patch
1234 \-l, \-\-limit limit number of changes displayed
1235 \-M, \-\-no\-merges do not show merges
1236 \-\-style display using template map file
1237 \-\-template display with template
1238 \-e, \-\-ssh specify ssh command to use
1239 \-\-remotecmd specify hg command to run on the remote side
1250 parents [\-r REV] [FILE]
1252 Print the working directory\'s parent revisions. If a revision is given via \-\-rev, the parent of that revision will be printed. If a file argument is given, revision in which the file was last changed (before the working directory revision or the argument to \-\-rev if given) is printed.
1257 \-r, \-\-rev show parents from the specified rev
1258 \-\-style display using template map file
1259 \-\-template display with template
1266 Show definition of symbolic path name NAME. If no name is given, show definition of available names.
1270 Path names are defined in the [paths] section of /etc/mercurial/hgrc
1271 and $HOME/.hgrc. If run inside a repository, .hg/hgrc is used, too.
1276 pull [\-u] [\-f] [\-r REV]... [\-e CMD] [\-\-remotecmd CMD] [SOURCE]
1278 Pull changes from a remote repository to a local one.
1282 This finds all changes from the repository at the specified path
1283 or URL and adds them to the local repository. By default, this
1284 does not update the copy of the project in the working directory.
1290 Valid URLs are of the form:
1296 local/filesystem/path (or file://local/filesystem/path)
1297 http://[user@]host[:port]/[path]
1298 https://[user@]host[:port]/[path]
1299 ssh://[user@]host[:port]/[path]
1300 static\-http://host[:port]/[path]
1306 Paths in the local filesystem can either point to Mercurial
1307 repositories or to bundle files (as created by \'hg bundle\' or
1308 \'hg incoming \-\-bundle\'). The static\-http:// protocol, albeit slow,
1309 allows access to a Mercurial repository where you simply use a web
1310 server to publish the .hg directory as static content.
1316 An optional identifier after # indicates a particular branch, tag,
1317 or changeset to pull.
1323 Some notes about using SSH with Mercurial:
1324 \- SSH requires an accessible shell account on the destination machine
1325 and a copy of hg in the remote path or specified with as remotecmd.
1326 \- path is relative to the remote user\'s home directory by default.
1327 Use an extra slash at the start of a path to specify an absolute path:
1328 ssh://example.com//tmp/repository
1329 \- Mercurial doesn\'t use its own compression via SSH; the right thing
1330 to do is to configure it in your ~/.ssh/config, e.g.:
1331 Host *.mylocalnetwork.example.com
1335 Alternatively specify "ssh \-C" as your ssh command in your hgrc or
1336 with the \-\-ssh command line option.
1343 \-u, \-\-update update to new tip if changesets were pulled
1344 \-f, \-\-force run even when remote repository is unrelated
1345 \-r, \-\-rev a specific revision up to which you would like to
1347 \-e, \-\-ssh specify ssh command to use
1348 \-\-remotecmd specify hg command to run on the remote side
1353 push [\-f] [\-r REV]... [\-e CMD] [\-\-remotecmd CMD] [DEST]
1355 Push changes from the local repository to the given destination.
1359 This is the symmetrical operation for pull. It helps to move
1360 changes from the current repository to a different one. If the
1361 destination is local this is identical to a pull in that directory
1362 from the current one.
1368 By default, push will refuse to run if it detects the result would
1369 increase the number of remote heads. This generally indicates the
1370 the client has forgotten to pull and merge before pushing.
1376 Valid URLs are of the form:
1382 local/filesystem/path (or file://local/filesystem/path)
1383 ssh://[user@]host[:port]/[path]
1384 http://[user@]host[:port]/[path]
1385 https://[user@]host[:port]/[path]
1391 An optional identifier after # indicates a particular branch, tag,
1392 or changeset to push. If \-r is used, the named changeset and all its
1393 ancestors will be pushed to the remote repository.
1399 Look at the help text for the pull command for important details
1406 Pushing to http:// and https:// URLs is only possible, if this
1407 feature is explicitly enabled on the remote Mercurial server.
1414 \-f, \-\-force force push
1415 \-r, \-\-rev a specific revision up to which you would like to
1417 \-e, \-\-ssh specify ssh command to use
1418 \-\-remotecmd specify hg command to run on the remote side
1425 Recover from an interrupted commit or pull.
1429 This command tries to fix the repository status after an interrupted
1430 operation. It should only be necessary when Mercurial suggests it.
1435 remove [OPTION]... FILE...
1437 Schedule the indicated files for removal from the repository.
1441 This only removes files from the current branch, not from the entire
1442 project history. \-A can be used to remove only files that have already
1443 been deleted, \-f can be used to force deletion, and \-Af can be used
1444 to remove files from the next revision without deleting them.
1450 The following table details the behavior of remove for different file
1451 states (columns) and option combinations (rows). The file states are
1452 Added, Clean, Modified and Missing (as reported by hg status). The
1453 actions are Warn, Remove (from branch) and Delete (from disk).
1469 This command schedules the files to be removed at the next commit.
1470 To undo a remove before that, see hg revert.
1477 \-A, \-\-after record delete for missing files
1478 \-f, \-\-force remove (and delete) file even if added or modified
1479 \-I, \-\-include include names matching the given patterns
1480 \-X, \-\-exclude exclude names matching the given patterns
1491 rename [OPTION]... SOURCE... DEST
1493 Mark dest as copies of sources; mark sources for deletion. If dest is a directory, copies are put in that directory. If dest is a file, there can only be one source.
1497 By default, this command copies the contents of files as they
1498 stand in the working directory. If invoked with \-\-after, the
1499 operation is recorded, but no copying is performed.
1505 This command takes effect in the next commit. To undo a rename
1506 before that, see hg revert.
1513 \-A, \-\-after record a rename that has already occurred
1514 \-f, \-\-force forcibly copy over an existing managed file
1515 \-I, \-\-include include names matching the given patterns
1516 \-X, \-\-exclude exclude names matching the given patterns
1517 \-n, \-\-dry\-run do not perform actions, just print output
1528 revert [OPTION]... [\-r REV] [NAME]...
1530 (use update \-r to check out earlier revisions, revert does not change the working dir parents)
1534 With no revision specified, revert the named files or directories
1535 to the contents they had in the parent of the working directory.
1536 This restores the contents of the affected files to an unmodified
1537 state and unschedules adds, removes, copies, and renames. If the
1538 working directory has two parents, you must explicitly specify the
1539 revision to revert to.
1545 Using the \-r option, revert the given files or directories to their
1546 contents as of a specific revision. This can be helpful to "roll
1547 back" some or all of an earlier change.
1548 See \'hg help dates\' for a list of formats valid for \-d/\-\-date.
1554 Revert modifies the working directory. It does not commit any
1555 changes, or change the parent of the working directory. If you
1556 revert to a revision other than the parent of the working
1557 directory, the reverted files will thus appear modified
1564 If a file has been deleted, it is restored. If the executable
1565 mode of a file was changed, it is reset.
1571 If names are given, all files matching the names are reverted.
1572 If no arguments are given, no files are reverted.
1578 Modified files are saved with a .orig suffix before reverting.
1579 To disable these backups, use \-\-no\-backup.
1586 \-a, \-\-all revert all changes when no arguments given
1587 \-d, \-\-date tipmost revision matching date
1588 \-r, \-\-rev revision to revert to
1589 \-\-no\-backup do not save backup copies of files
1590 \-I, \-\-include include names matching the given patterns
1591 \-X, \-\-exclude exclude names matching the given patterns
1592 \-n, \-\-dry\-run do not perform actions, just print output
1599 This command should be used with care. There is only one level of rollback, and there is no way to undo a rollback. It will also restore the dirstate at the time of the last transaction, losing any dirstate changes since that time.
1603 Transactions are used to encapsulate the effects of all commands
1604 that create new changesets or propagate existing changesets into a
1605 repository. For example, the following commands are transactional,
1606 and their effects can be rolled back:
1615 push (with this repository as destination)
1622 This command is not intended for use on public repositories. Once
1623 changes are visible for pull by other users, rolling a transaction
1624 back locally is ineffective (someone else may already have pulled
1625 the changes). Furthermore, a race is possible with readers of the
1626 repository; for example an in\-progress pull from the repository
1627 may fail if a rollback is performed.
1634 Print the root directory of the current repository.
1639 Start a local HTTP repository browser and pull server.
1643 By default, the server logs accesses to stdout and errors to
1644 stderr. Use the "\-A" and "\-E" options to log to files.
1651 \-A, \-\-accesslog name of access log file to write to
1652 \-d, \-\-daemon run server in background
1653 \-\-daemon\-pipefds used internally by daemon mode
1654 \-E, \-\-errorlog name of error log file to write to
1655 \-p, \-\-port port to listen on (default: 8000)
1656 \-a, \-\-address address to listen on (default: all interfaces)
1657 \-\-prefix prefix path to serve from (default: server root)
1658 \-n, \-\-name name to show in web pages (default: working dir)
1659 \-\-webdir\-conf name of the webdir config file (serve more than
1661 \-\-pid\-file name of file to write process ID to
1662 \-\-stdio for remote clients
1663 \-t, \-\-templates web templates to use
1664 \-\-style template style to use
1665 \-6, \-\-ipv6 use IPv6 in addition to IPv4
1666 \-\-certificate SSL certificate file
1671 showconfig [\-u] [NAME]...
1673 With no args, print names and values of all config items.
1677 With one arg of the form section.name, print just the value of
1684 With multiple args, print names and values of all config items
1685 with matching section names.
1692 \-u, \-\-untrusted show untrusted configuration options
1698 aliases: debugconfig
1703 status [OPTION]... [FILE]...
1705 Show status of files in the repository. If names are given, only files that match are shown. Files that are clean or ignored or source of a copy/move operation, are not listed unless \-c (clean), \-i (ignored), \-C (copies) or \-A is given. Unless options described with "show only ..." are given, the options \-mardu are used.
1709 Option \-q/\-\-quiet hides untracked (unknown and ignored) files
1710 unless explicitly requested with \-u/\-\-unknown or \-i/\-ignored.
1716 NOTE: status may appear to disagree with diff if permissions have
1717 changed or a merge has occurred. The standard diff format does not
1718 report permission changes and diff only reports changes relative
1719 to one merge parent.
1725 If one revision is given, it is used as the base revision.
1726 If two revisions are given, the difference between them is shown.
1732 The codes used to show the status of files are:
1737 ! = deleted, but still tracked
1740 = the previous added file was copied from here
1747 \-A, \-\-all show status of all files
1748 \-m, \-\-modified show only modified files
1749 \-a, \-\-added show only added files
1750 \-r, \-\-removed show only removed files
1751 \-d, \-\-deleted show only deleted (but tracked) files
1752 \-c, \-\-clean show only files without changes
1753 \-u, \-\-unknown show only unknown (not tracked) files
1754 \-i, \-\-ignored show only ignored files
1755 \-n, \-\-no\-status hide status prefix
1756 \-C, \-\-copies show source of copied files
1757 \-0, \-\-print0 end filenames with NUL, for use with xargs
1758 \-\-rev show difference from revision
1759 \-I, \-\-include include names matching the given patterns
1760 \-X, \-\-exclude exclude names matching the given patterns
1771 tag [\-l] [\-m TEXT] [\-d DATE] [\-u USER] [\-r REV] NAME...
1773 Name a particular revision using <name>.
1777 Tags are used to name particular revisions of the repository and are
1778 very useful to compare different revisions, to go back to significant
1779 earlier versions or to mark branch points as releases, etc.
1785 If no revision is given, the parent of the working directory is used,
1786 or tip if no revision is checked out.
1792 To facilitate version control, distribution, and merging of tags,
1793 they are stored as a file named ".hgtags" which is managed
1794 similarly to other project files and can be hand\-edited if
1795 necessary. The file \'.hg/localtags\' is used for local tags (not
1796 shared among repositories).
1802 See \'hg help dates\' for a list of formats valid for \-d/\-\-date.
1809 \-f, \-\-force replace existing tag
1810 \-l, \-\-local make the tag local
1811 \-r, \-\-rev revision to tag
1812 \-\-remove remove a tag
1813 \-m, \-\-message use <text> as commit message
1814 \-d, \-\-date record datecode as commit date
1815 \-u, \-\-user record user as committer
1822 List the repository tags.
1826 This lists both regular and local tags. When the \-v/\-\-verbose switch
1827 is used, a third column "local" is printed for local tags.
1834 The tip revision (usually just called the tip) is the most recently added changeset in the repository, the most recently changed head.
1838 If you have just made a commit, that commit will be the tip. If
1839 you have just pulled changes from another repository, the tip of
1840 that repository becomes the current tip. The "tip" tag is special
1841 and cannot be renamed or assigned to a different changeset.
1848 \-p, \-\-patch show patch
1849 \-\-style display using template map file
1850 \-\-template display with template
1855 unbundle [\-u] FILE...
1857 Apply one or more compressed changegroup files generated by the bundle command.
1862 \-u, \-\-update update to new tip if changesets were unbundled
1867 update [\-C] [\-d DATE] [[\-r] REV]
1869 Update the working directory to the specified revision, or the tip of the current branch if none is specified.
1873 If the requested revision is a descendant of the working
1874 directory, any outstanding changes in the working directory will
1875 be merged into the result. If it is not directly descended but is
1876 on the same named branch, update aborts with a suggestion to use
1877 merge or update \-C instead.
1883 If the requested revision is on a different named branch and the
1884 working directory is clean, update quietly switches branches.
1890 If you want to update just one file to an older revision, use revert.
1896 See \'hg help dates\' for a list of formats valid for \-\-date.
1903 \-C, \-\-clean overwrite locally modified files
1904 \-d, \-\-date tipmost revision matching date
1905 \-r, \-\-rev revision
1911 aliases: up checkout co
1918 Verify the integrity of the current repository.
1922 This will perform an extensive check of the repository\'s
1923 integrity, validating the hashes and checksums of each entry in
1924 the changelog, manifest, and tracked files, as well as the
1925 integrity of their crosslinks and indices.
1932 output version and copyright information
1938 Some commands allow the user to specify a date:
1939 backout, commit, import, tag: Specify the commit date.
1940 log, revert, update: Select revision(s) by date.
1946 Many date formats are valid. Here are some examples:
1952 "Wed Dec 6 13:18:29 2006" (local timezone assumed)
1953 "Dec 6 13:18 \-0600" (year assumed, time offset provided)
1954 "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
1956 "13:18" (today assumed)
1957 "3:39" (3:39AM assumed)
1959 "2006\-12\-6 13:18:29" (ISO 8601 format)
1964 "12/6/6" (Dec 6 2006)
1970 Lastly, there is Mercurial\'s internal format:
1976 "1165432709 0" (Wed Dec 6 13:18:29 2006 UTC)
1982 This is the internal representation format for dates. unixtime is
1983 the number of seconds since the epoch (1970\-01\-01 00:00 UTC). offset
1984 is the offset of the local timezone, in seconds west of UTC (negative
1985 if the timezone is east of UTC).
1991 The log command also accepts date ranges:
1997 "<{date}" \- on or before a given date
1998 ">{date}" \- on or after a given date
1999 "{date} to {date}" \- a date range, inclusive
2000 "\-{days}" \- within a given number of days of today
2007 Mercurial accepts several notations for identifying one or more
2014 By default, Mercurial treats filenames as shell\-style extended
2021 Alternate pattern notations must be specified explicitly.
2027 To use a plain path name without any pattern matching, start a
2028 name with "path:". These path names must match completely, from
2029 the root of the current repository.
2035 To use an extended glob, start a name with "glob:". Globs are
2036 rooted at the current directory; a glob such as "*.c" will match
2037 files ending in ".c" in the current directory only.
2043 The supported glob syntax extensions are "**" to match any string
2044 across path separators, and "{a,b}" to mean "a or b".
2050 To use a Perl/Python regular expression, start a name with "re:".
2051 Regexp pattern matching is anchored at the root of the repository.
2063 path:foo/bar a name bar in a directory named foo in the root of
2065 path:path:name a file or directory named "path:name"
2077 glob:*.c any name ending in ".c" in the current directory
2078 *.c any name ending in ".c" in the current directory
2079 **.c any name ending in ".c" in the current directory, or
2081 foo/*.c any name ending in ".c" in the directory foo
2082 foo/**.c any name ending in ".c" in the directory foo, or any
2095 re:.*\e.c$ any name ending in ".c", anywhere in the repository
2098 .SH "ENVIRONMENT VARIABLES"
2104 executable, automatically passed when running hooks, extensions or external tools. If unset or empty, an executable named
2106 (with com/exe/bat/cmd extension on Windows) is searched.
2111 This is the name of the editor to use when committing. See EDITOR.
2115 (deprecated, use .hgrc)
2122 This overrides the default locale setting detected by Mercurial. This setting is used to convert data including usernames, changeset descriptions, tag names, and branches. This setting can be overridden with the \-\-encoding command\-line option.
2127 This sets Mercurial\'s behavior for handling unknown characters while transcoding user inputs. The default is "strict", which causes Mercurial to abort if it can\'t translate a character. Other settings include "replace", which replaces unknown characters, and "ignore", which drops them. This setting can be overridden with the \-\-encodingmode command\-line option.
2132 An executable to use for resolving merge conflicts. The program will be executed with three arguments: local file, remote file, ancestor file.
2136 (deprecated, use .hgrc)
2143 A list of files or directories to search for hgrc files. Item separator is ":" on Unix, ";" on Windows. If HGRCPATH is not set, platform default search path is used. If empty, only .hg/hgrc of current repository is read.
2147 For each element in path, if a directory, all entries in directory
2148 ending with ".rc" are added to path. Else, element itself is
2156 This is the string used for the author of a commit.
2160 (deprecated, use .hgrc)
2167 If HGUSER is not set, this will be used as the author for a commit.
2172 If neither HGUSER nor EMAIL is set, LOGNAME will be used (with
2174 appended) as the author value for a commit.
2179 This is the name of the editor to use when committing. See EDITOR.
2184 Sometimes Mercurial needs to open a text file in an editor for a user to modify, for example when writing commit messages. The editor it uses is determined by looking at the environment variables HGEDITOR, VISUAL and EDITOR, in that order. The first non\-empty one is chosen. If all of them are empty, the editor defaults to
2190 This is used by Python to find imported modules and may need to be set appropriately if Mercurial is not installed system\-wide.
2192 .SH "SPECIFYING SINGLE REVISIONS"
2196 Mercurial accepts several notations for identifying individual
2203 A plain integer is treated as a revision number. Negative
2204 integers are treated as offsets from the tip, with \-1 denoting the
2211 A 40\-digit hexadecimal string is treated as a unique revision
2218 A hexadecimal string less than 40 characters long is treated as a
2219 unique revision identifier, and referred to as a short\-form
2220 identifier. A short\-form identifier is only valid if it is the
2221 prefix of one full\-length identifier.
2227 Any other string is treated as a tag name, which is a symbolic
2228 name associated with a revision identifier. Tag names may not
2229 contain the ":" character.
2235 The reserved name "tip" is a special tag that always identifies
2236 the most recent revision.
2242 The reserved name "null" indicates the null revision. This is the
2243 revision of an empty repository, and the parent of revision 0.
2249 The reserved name "." indicates the working directory parent. If
2250 no working directory is checked out, it is equivalent to null.
2251 If an uncommitted merge is in progress, "." is the revision of
2255 .SH "SPECIFYING MULTIPLE REVISIONS"
2259 When Mercurial accepts more than one revision, they may be
2260 specified individually, or provided as a continuous range,
2261 separated by the ":" character.
2267 The syntax of range notation is [BEGIN]:[END], where BEGIN and END
2268 are revision identifiers. Both BEGIN and END are optional. If
2269 BEGIN is not specified, it defaults to revision number 0. If END
2270 is not specified, it defaults to the tip. The range ":" thus
2271 means "all revisions".
2277 If BEGIN is greater than END, revisions are treated in reverse
2284 A range acts as a closed interval. This means that a range of 3:5
2285 gives 3, 4 and 5. Similarly, a range of 4:2 gives 4, 3, and 2.
2292 This file contains regular expressions (one per line) that describe file names that should be ignored by hg. For details, see hgignore(5).
2297 This file contains changeset hash values and text tag names (one of each separated by spaces) that correspond to tagged versions of the repository contents.
2300 /etc/mercurial/hgrc, $HOME/.hgrc, .hg/hgrc
2302 This file contains defaults and configuration. Values in .hg/hgrc override those in $HOME/.hgrc, and these override settings made in the global /etc/mercurial/hgrc configuration. See hgrc(5) for details of the contents and format of these files.
2304 Some commands (e.g. revert) produce backup files ending in .orig, if the .orig file already exists and is not tracked by Mercurial, it will be overwritten.
2307 Probably lots, please post them to the mailing list (See Resources below) when you find them.
2314 Written by Matt Mackall <mpm@selenic.com>
2317 \fIMain Web Site\fR[1]
2319 \fISource code repository\fR[2]
2321 \fIMailing list\fR[3]
2324 Copyright (C) 2005\-2007 Matt Mackall. Free use of this software is granted under the terms of the GNU General Public License (GPL).
2330 http://selenic.com/mercurial
2333 Source code repository
2335 http://selenic.com/hg
2340 http://selenic.com/mailman/listinfo/mercurial