.\" Man page generated from reStructuredText. . .TH HG 1 "" "" "Mercurial Manual" .SH NAME hg \- Mercurial source code management system . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .SH SYNOPSIS .sp \fBhg\fP \fIcommand\fP [\fIoption\fP]... [\fIargument\fP]... .SH DESCRIPTION .sp The \fBhg\fP command provides a command line interface to the Mercurial system. .SH COMMAND ELEMENTS .INDENT 0.0 .TP .B files... . indicates one or more filename or relative path filenames; see \%File Name Patterns\: for information on pattern matching .TP .B path . indicates a path on the local machine .TP .B revision . indicates a changeset which can be specified as a changeset revision number, a tag, or a unique substring of the changeset hash value .TP .B repository path . either the pathname of a local repository or the URI of a remote repository. .UNINDENT .SH OPTIONS .INDENT 0.0 .TP .BI \-R, \-\-repository \ . repository root directory or name of overlay bundle file .TP .BI \-\-cwd \ . change working directory .TP .B \-y, \-\-noninteractive . do not prompt, automatically pick the first choice for all prompts .TP .B \-q, \-\-quiet . suppress output .TP .B \-v, \-\-verbose . enable additional output .TP .BI \-\-config \ . set/override config option (use \(aqsection.name=value\(aq) .TP .B \-\-debug . enable debugging output .TP .B \-\-debugger . start debugger .TP .BI \-\-encoding \ . set the charset encoding (default: UTF\-8) .TP .BI \-\-encodingmode \ . set the charset encoding mode (default: strict) .TP .B \-\-traceback . always print a traceback on exception .TP .B \-\-time . time how long the command takes .TP .B \-\-profile . print command execution profile .TP .B \-\-version . output version information and exit .TP .B \-h, \-\-help . display help and exit .TP .B \-\-hidden . consider hidden changesets .UNINDENT .sp [+] marked option can be specified multiple times .SH COMMANDS .SS add .sp add the specified files on the next commit: .sp .nf .ft C hg add [OPTION]... [FILE]... .ft P .fi .sp Schedule files to be version controlled and added to the repository. .sp The files will be added to the repository at the next commit. To undo an add before that, see \%\fBhg forget\fP\:. .sp If no names are given, add all files to the repository. .sp An example showing how new (unknown) files are added automatically by \%\fBhg add\fP\:: .sp .nf .ft C $ ls foo.c $ hg status ? foo.c $ hg add adding foo.c $ hg status A foo.c .ft P .fi .sp Returns 0 if all files are successfully added. .sp Options: .INDENT 0.0 .TP .BI \-I, \-\-include \ . include names matching the given patterns .TP .BI \-X, \-\-exclude \ . exclude names matching the given patterns .TP .B \-S, \-\-subrepos . recurse into subrepositories .TP .B \-n, \-\-dry\-run . do not perform actions, just print output .UNINDENT .sp [+] marked option can be specified multiple times .SS addremove .sp add all new files, delete all missing files: .sp .nf .ft C hg addremove [OPTION]... [FILE]... .ft P .fi .sp Add all new files and remove all missing files from the repository. .sp New files are ignored if they match any of the patterns in \fB.hgignore\fP. As with add, these changes take effect at the next commit. .sp Use the \-s/\-\-similarity option to detect renamed files. This option takes a percentage between 0 (disabled) and 100 (files must be identical) as its parameter. With a parameter greater than 0, this compares every removed file with every added file and records those similar enough as renames. Detecting renamed files this way can be expensive. After using this option, \%\fBhg status \-C\fP\: can be used to check which files were identified as moved or renamed. If not specified, \-s/\-\-similarity defaults to 100 and only renames of identical files are detected. .sp Returns 0 if all files are successfully added. .sp Options: .INDENT 0.0 .TP .BI \-s, \-\-similarity \ . guess renamed files by similarity (0<=s<=100) .TP .BI \-I, \-\-include \ . include names matching the given patterns .TP .BI \-X, \-\-exclude \ . exclude names matching the given patterns .TP .B \-n, \-\-dry\-run . do not perform actions, just print output .UNINDENT .sp [+] marked option can be specified multiple times .SS annotate .sp show changeset information by line for each file: .sp .nf .ft C hg annotate [\-r REV] [\-f] [\-a] [\-u] [\-d] [\-n] [\-c] [\-l] FILE... .ft P .fi .sp List changes in files, showing the revision id responsible for each line .sp This command is useful for discovering when a change was made and by whom. .sp Without the \-a/\-\-text option, annotate will avoid processing files it detects as binary. With \-a, annotate will annotate the file anyway, although the results will probably be neither useful nor desirable. .sp Returns 0 on success. .sp Options: .INDENT 0.0 .TP .BI \-r, \-\-rev \ . annotate the specified revision .TP .B \-\-follow . follow copies/renames and list the filename (DEPRECATED) .TP .B \-\-no\-follow . don\(aqt follow copies and renames .TP .B \-a, \-\-text . treat all files as text .TP .B \-u, \-\-user . list the author (long with \-v) .TP .B \-f, \-\-file . list the filename .TP .B \-d, \-\-date . list the date (short with \-q) .TP .B \-n, \-\-number . list the revision number (default) .TP .B \-c, \-\-changeset . list the changeset .TP .B \-l, \-\-line\-number . show line number at the first appearance .TP .B \-w, \-\-ignore\-all\-space . ignore white space when comparing lines .TP .B \-b, \-\-ignore\-space\-change . ignore changes in the amount of white space .TP .B \-B, \-\-ignore\-blank\-lines . ignore changes whose lines are all blank .TP .BI \-I, \-\-include \ . include names matching the given patterns .TP .BI \-X, \-\-exclude \ . exclude names matching the given patterns .UNINDENT .sp [+] marked option can be specified multiple times .INDENT 0.0 .INDENT 3.5 .sp aliases: blame .UNINDENT .UNINDENT .SS archive .sp create an unversioned archive of a repository revision: .sp .nf .ft C hg archive [OPTION]... DEST .ft P .fi .sp By default, the revision used is the parent of the working directory; use \-r/\-\-rev to specify a different revision. .sp The archive type is automatically detected based on file extension (or override using \-t/\-\-type). .sp Examples: .INDENT 0.0 .IP \(bu 2 . create a zip file containing the 1.0 release: .sp .nf .ft C hg archive \-r 1.0 project\-1.0.zip .ft P .fi .IP \(bu 2 . create a tarball excluding .hg files: .sp .nf .ft C hg archive project.tar.gz \-X ".hg*" .ft P .fi .UNINDENT .sp Valid types are: .INDENT 0.0 .TP .B \fBfiles\fP .sp a directory full of files (default) .TP .B \fBtar\fP .sp tar archive, uncompressed .TP .B \fBtbz2\fP .sp tar archive, compressed using bzip2 .TP .B \fBtgz\fP .sp tar archive, compressed using gzip .TP .B \fBuzip\fP .sp zip archive, uncompressed .TP .B \fBzip\fP .sp zip archive, compressed using deflate .UNINDENT .sp The exact name of the destination archive or directory is given using a format string; see \%\fBhg help export\fP\: for details. .sp Each member added to an archive file has a directory prefix prepended. Use \-p/\-\-prefix to specify a format string for the prefix. The default is the basename of the archive, with suffixes removed. .sp Returns 0 on success. .sp Options: .INDENT 0.0 .TP .B \-\-no\-decode . do not pass files through decoders .TP .BI \-p, \-\-prefix \ . directory prefix for files in archive .TP .BI \-r, \-\-rev \ . revision to distribute .TP .BI \-t, \-\-type \ . type of distribution to create .TP .B \-S, \-\-subrepos . recurse into subrepositories .TP .BI \-I, \-\-include \ . include names matching the given patterns .TP .BI \-X, \-\-exclude \ . exclude names matching the given patterns .UNINDENT .sp [+] marked option can be specified multiple times .SS backout .sp reverse effect of earlier changeset: .sp .nf .ft C hg backout [OPTION]... [\-r] REV .ft P .fi .sp Prepare a new changeset with the effect of REV undone in the current working directory. .sp If REV is the parent of the working directory, then this new changeset is committed automatically. Otherwise, hg needs to merge the changes and the merged result is left uncommitted. .IP Note . backout cannot be used to fix either an unwanted or incorrect merge. .RE .sp By default, the pending changeset will have one parent, maintaining a linear history. With \-\-merge, the pending changeset will instead have two parents: the old parent of the working directory and a new child of REV that simply undoes REV. .sp Before version 1.7, the behavior without \-\-merge was equivalent to specifying \-\-merge followed by \%\fBhg update \-\-clean .\fP\: to cancel the merge and leave the child of REV as a head to be merged separately. .sp See \%\fBhg help dates\fP\: for a list of formats valid for \-d/\-\-date. .sp Returns 0 on success, 1 if nothing to backout or there are unresolved files. .sp Options: .INDENT 0.0 .TP .B \-\-merge . merge with old dirstate parent after backout .TP .BI \-\-parent \ . parent to choose when backing out merge (DEPRECATED) .TP .BI \-r, \-\-rev \ . revision to backout .TP .B \-e, \-\-edit . invoke editor on commit messages .TP .BI \-t, \-\-tool \ . specify merge tool .TP .BI \-I, \-\-include \ . include names matching the given patterns .TP .BI \-X, \-\-exclude \ . exclude names matching the given patterns .TP .BI \-m, \-\-message \ . use text as commit message .TP .BI \-l, \-\-logfile \ . read commit message from file .TP .BI \-d, \-\-date \ . record the specified date as commit date .TP .BI \-u, \-\-user \ . record the specified user as committer .UNINDENT .sp [+] marked option can be specified multiple times .SS bisect .sp subdivision search of changesets: .sp .nf .ft C hg bisect [\-gbsr] [\-U] [\-c CMD] [REV] .ft P .fi .sp 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 (unless the \-U/\-\-noupdate option is specified). Once you have performed tests, mark the working directory as good or bad, and bisect will either update to another candidate changeset or announce that it has found the bad revision. .sp As a shortcut, you can also use the revision argument to mark a revision as good or bad without checking it out first. .sp If you supply a command, it will be used for automatic bisection. The environment variable HG_NODE will contain the ID of the changeset being tested. The exit status of the command will be used to mark revisions as good or bad: status 0 means good, 125 means to skip the revision, 127 (command not found) will abort the bisection, and any other non\-zero exit status means the revision is bad. .sp Some examples: .INDENT 0.0 .IP \(bu 2 . start a bisection with known bad revision 34, and good revision 12: .sp .nf .ft C hg bisect \-\-bad 34 hg bisect \-\-good 12 .ft P .fi .IP \(bu 2 . advance the current bisection by marking current revision as good or bad: .sp .nf .ft C hg bisect \-\-good hg bisect \-\-bad .ft P .fi .IP \(bu 2 . mark the current revision, or a known revision, to be skipped (e.g. if that revision is not usable because of another issue): .sp .nf .ft C hg bisect \-\-skip hg bisect \-\-skip 23 .ft P .fi .IP \(bu 2 . skip all revisions that do not touch directories \fBfoo\fP or \fBbar\fP: .sp .nf .ft C hg bisect \-\-skip "!( file(\(aqpath:foo\(aq) & file(\(aqpath:bar\(aq) )" .ft P .fi .IP \(bu 2 . forget the current bisection: .sp .nf .ft C hg bisect \-\-reset .ft P .fi .IP \(bu 2 . use \(aqmake && make tests\(aq to automatically find the first broken revision: .sp .nf .ft C hg bisect \-\-reset hg bisect \-\-bad 34 hg bisect \-\-good 12 hg bisect \-\-command "make && make tests" .ft P .fi .IP \(bu 2 . see all changesets whose states are already known in the current bisection: .sp .nf .ft C hg log \-r "bisect(pruned)" .ft P .fi .IP \(bu 2 . see the changeset currently being bisected (especially useful if running with \-U/\-\-noupdate): .sp .nf .ft C hg log \-r "bisect(current)" .ft P .fi .IP \(bu 2 . see all changesets that took part in the current bisection: .sp .nf .ft C hg log \-r "bisect(range)" .ft P .fi .IP \(bu 2 . you can even get a nice graph: .sp .nf .ft C hg log \-\-graph \-r "bisect(range)" .ft P .fi .UNINDENT .sp See \%\fBhg help revsets\fP\: for more about the \fIbisect()\fP keyword. .sp Returns 0 on success. .sp Options: .INDENT 0.0 .TP .B \-r, \-\-reset . reset bisect state .TP .B \-g, \-\-good . mark changeset good .TP .B \-b, \-\-bad . mark changeset bad .TP .B \-s, \-\-skip . skip testing changeset .TP .B \-e, \-\-extend . extend the bisect range .TP .BI \-c, \-\-command \ . use command to check changeset state .TP .B \-U, \-\-noupdate . do not update to target .UNINDENT .SS bookmarks .sp create a new bookmark or list existing bookmarks: .sp .nf .ft C hg bookmarks [OPTIONS]... [NAME]... .ft P .fi .sp Bookmarks are labels on changesets to help track lines of development. Bookmarks are unversioned and can be moved, renamed and deleted. Deleting or moving a bookmark has no effect on the associated changesets. .sp Creating or updating to a bookmark causes it to be marked as \(aqactive\(aq. The active bookmark is indicated with a \(aq*\(aq. When a commit is made, the active bookmark will advance to the new commit. A plain \%\fBhg update\fP\: will also advance an active bookmark, if possible. Updating away from a bookmark will cause it to be deactivated. .sp Bookmarks can be pushed and pulled between repositories (see \%\fBhg help push\fP\: and \%\fBhg help pull\fP\:). If a shared bookmark has diverged, a new \(aqdivergent bookmark\(aq of the form \%\(aqname@path\:\(aq will be created. Using :hg:\(aqmerge\(aq will resolve the divergence. .sp A bookmark named \(aq@\(aq has the special property that \%\fBhg clone\fP\: will check it out by default if it exists. .sp Examples: .INDENT 0.0 .IP \(bu 2 . create an active bookmark for a new line of development: .sp .nf .ft C hg book new\-feature .ft P .fi .IP \(bu 2 . create an inactive bookmark as a place marker: .sp .nf .ft C hg book \-i reviewed .ft P .fi .IP \(bu 2 . create an inactive bookmark on another changeset: .sp .nf .ft C hg book \-r .^ tested .ft P .fi .IP \(bu 2 . move the \(aq@\(aq bookmark from another branch: .sp .nf .ft C hg book \-f @ .ft P .fi .UNINDENT .sp Options: .INDENT 0.0 .TP .B \-f, \-\-force . force .TP .BI \-r, \-\-rev \ . revision .TP .B \-d, \-\-delete . delete a given bookmark .TP .BI \-m, \-\-rename \ . rename a given bookmark .TP .B \-i, \-\-inactive . mark a bookmark inactive .sp aliases: bookmark .UNINDENT .SS branch .sp set or show the current branch name: .sp .nf .ft C hg branch [\-fC] [NAME] .ft P .fi .IP Note . Branch names are permanent and global. Use \%\fBhg bookmark\fP\: to create a light\-weight bookmark instead. See \%\fBhg help glossary\fP\: for more information about named branches and bookmarks. .RE .sp With no argument, show the current branch name. With one argument, set the working directory branch name (the branch will not exist in the repository until the next commit). Standard practice recommends that primary development take place on the \(aqdefault\(aq branch. .sp Unless \-f/\-\-force is specified, branch will not let you set a branch name that already exists, even if it\(aqs inactive. .sp Use \-C/\-\-clean to reset the working directory branch to that of the parent of the working directory, negating a previous branch change. .sp Use the command \%\fBhg update\fP\: to switch to an existing branch. Use \%\fBhg commit \-\-close\-branch\fP\: to mark this branch as closed. .sp Returns 0 on success. .sp Options: .INDENT 0.0 .TP .B \-f, \-\-force . set branch name even if it shadows an existing branch .TP .B \-C, \-\-clean . reset branch name to parent branch name .UNINDENT .SS branches .sp list repository named branches: .sp .nf .ft C hg branches [\-ac] .ft P .fi .sp List the repository\(aqs named branches, indicating which ones are inactive. If \-c/\-\-closed is specified, also list branches which have been marked closed (see \%\fBhg commit \-\-close\-branch\fP\:). .sp If \-a/\-\-active is specified, only show active branches. A branch is considered active if it contains repository heads. .sp Use the command \%\fBhg update\fP\: to switch to an existing branch. .sp Returns 0. .sp Options: .INDENT 0.0 .TP .B \-a, \-\-active . show only branches that have unmerged heads .TP .B \-c, \-\-closed . show normal and closed branches .UNINDENT .SS bundle .sp create a changegroup file: .sp .nf .ft C hg bundle [\-f] [\-t TYPE] [\-a] [\-r REV]... [\-\-base REV]... FILE [DEST] .ft P .fi .sp Generate a compressed changegroup file collecting changesets not known to be in another repository. .sp If you omit the destination repository, then hg assumes the destination will have all the nodes you specify with \-\-base parameters. To create a bundle containing all changesets, use \-a/\-\-all (or \-\-base null). .sp You can change compression method with the \-t/\-\-type option. The available compression methods are: none, bzip2, and gzip (by default, bundles are compressed using bzip2). .sp The bundle file can then be transferred using conventional means and applied to another repository with the unbundle or pull command. This is useful when direct push and pull are not available or when exporting an entire repository is undesirable. .sp Applying bundles preserves all changeset contents including permissions, copy/rename information, and revision history. .sp Returns 0 on success, 1 if no changes found. .sp Options: .INDENT 0.0 .TP .B \-f, \-\-force . run even when the destination is unrelated .TP .BI \-r, \-\-rev \ . a changeset intended to be added to the destination .TP .BI \-b, \-\-branch \ . a specific branch you would like to bundle .TP .BI \-\-base \ . a base changeset assumed to be available at the destination .TP .B \-a, \-\-all . bundle all changesets in the repository .TP .BI \-t, \-\-type \ . bundle compression type to use (default: bzip2) .TP .BI \-e, \-\-ssh \ . specify ssh command to use .TP .BI \-\-remotecmd \ . specify hg command to run on the remote side .TP .B \-\-insecure . do not verify server certificate (ignoring web.cacerts config) .UNINDENT .sp [+] marked option can be specified multiple times .SS cat .sp output the current or given revision of files: .sp .nf .ft C hg cat [OPTION]... FILE... .ft P .fi .sp Print the specified files as they were at the given revision. If no revision is given, the parent of the working directory is used. .sp Output may be to a file, in which case the name of the file is given using a format string. The formatting rules as follows: .INDENT 0.0 .TP .B \fB%%\fP .sp literal "%" character .TP .B \fB%s\fP .sp basename of file being printed .TP .B \fB%d\fP .sp dirname of file being printed, or \(aq.\(aq if in repository root .TP .B \fB%p\fP .sp root\-relative path name of file being printed .TP .B \fB%H\fP .sp changeset hash (40 hexadecimal digits) .TP .B \fB%R\fP .sp changeset revision number .TP .B \fB%h\fP .sp short\-form changeset hash (12 hexadecimal digits) .TP .B \fB%r\fP .sp zero\-padded changeset revision number .TP .B \fB%b\fP .sp basename of the exporting repository .UNINDENT .sp Returns 0 on success. .sp Options: .INDENT 0.0 .TP .BI \-o, \-\-output \ . print output to file with formatted name .TP .BI \-r, \-\-rev \ . print the given revision .TP .B \-\-decode . apply any matching decode filter .TP .BI \-I, \-\-include \ . include names matching the given patterns .TP .BI \-X, \-\-exclude \ . exclude names matching the given patterns .UNINDENT .sp [+] marked option can be specified multiple times .SS clone .sp make a copy of an existing repository: .sp .nf .ft C hg clone [OPTION]... SOURCE [DEST] .ft P .fi .sp Create a copy of an existing repository in a new directory. .sp If no destination directory name is specified, it defaults to the basename of the source. .sp The location of the source is added to the new repository\(aqs \fB.hg/hgrc\fP file, as the default to be used for future pulls. .sp Only local paths and \fBssh://\fP URLs are supported as destinations. For \fBssh://\fP destinations, no working directory or \fB.hg/hgrc\fP will be created on the remote side. .sp To pull only a subset of changesets, specify one or more revisions identifiers with \-r/\-\-rev or branches with \-b/\-\-branch. The resulting clone will contain only the specified changesets and their ancestors. These options (or \(aqclone src#rev dest\(aq) imply \-\-pull, even for local source repositories. Note that specifying a tag will include the tagged changeset but not the changeset containing the tag. .sp If the source repository has a bookmark called \(aq@\(aq set, that revision will be checked out in the new repository by default. .sp To check out a particular version, use \-u/\-\-update, or \-U/\-\-noupdate to create a clone with no working directory. .sp For efficiency, hardlinks are used for cloning whenever the source and destination are on the same filesystem (note this applies only to the repository data, not to the working directory). Some filesystems, such as AFS, implement hardlinking incorrectly, but do not report errors. In these cases, use the \-\-pull option to avoid hardlinking. .sp In some cases, you can clone repositories and the working directory using full hardlinks with .sp .nf .ft C $ cp \-al REPO REPOCLONE .ft P .fi .sp This is the fastest way to clone, but it is not always safe. The operation is not atomic (making sure REPO is not modified during the operation is up to you) and you have to make sure your editor breaks hardlinks (Emacs and most Linux Kernel tools do so). Also, this is not compatible with certain extensions that place their metadata under the .hg directory, such as mq. .sp Mercurial will update the working directory to the first applicable revision from this list: .INDENT 0.0 .IP a. 3 . null if \-U or the source repository has no changesets .IP b. 3 . if \-u . and the source repository is local, the first parent of the source repository\(aqs working directory .IP c. 3 . the changeset specified with \-u (if a branch name, this means the latest head of that branch) .IP d. 3 . the changeset specified with \-r .IP e. 3 . the tipmost head specified with \-b .IP f. 3 . the tipmost head specified with the url#branch source syntax .IP g. 3 . the revision marked with the \(aq@\(aq bookmark, if present .IP h. 3 . the tipmost head of the default branch .IP i. 3 . tip .UNINDENT .sp Examples: .INDENT 0.0 .IP \(bu 2 . clone a remote repository to a new directory named hg/: .sp .nf .ft C hg clone http://selenic.com/hg .ft P .fi .IP \(bu 2 . create a lightweight local clone: .sp .nf .ft C hg clone project/ project\-feature/ .ft P .fi .IP \(bu 2 . clone from an absolute path on an ssh server (note double\-slash): .sp .nf .ft C hg clone ssh://user@server//home/projects/alpha/ .ft P .fi .IP \(bu 2 . do a high\-speed clone over a LAN while checking out a specified version: .sp .nf .ft C hg clone \-\-uncompressed http://server/repo \-u 1.5 .ft P .fi .IP \(bu 2 . create a repository without changesets after a particular revision: .sp .nf .ft C hg clone \-r 04e544 experimental/ good/ .ft P .fi .IP \(bu 2 . clone (and track) a particular named branch: .sp .nf .ft C hg clone http://selenic.com/hg#stable .ft P .fi .UNINDENT .sp See \%\fBhg help urls\fP\: for details on specifying URLs. .sp Returns 0 on success. .sp Options: .INDENT 0.0 .TP .B \-U, \-\-noupdate . the clone will include an empty working copy (only a repository) .TP .BI \-u, \-\-updaterev \ . revision, tag or branch to check out .TP .BI \-r, \-\-rev \ . include the specified changeset .TP .BI \-b, \-\-branch \ . clone only the specified branch .TP .B \-\-pull . use pull protocol to copy metadata .TP .B \-\-uncompressed . use uncompressed transfer (fast over LAN) .TP .BI \-e, \-\-ssh \ . specify ssh command to use .TP .BI \-\-remotecmd \ . specify hg command to run on the remote side .TP .B \-\-insecure . do not verify server certificate (ignoring web.cacerts config) .UNINDENT .sp [+] marked option can be specified multiple times .SS commit .sp commit the specified files or all outstanding changes: .sp .nf .ft C hg commit [OPTION]... [FILE]... .ft P .fi .sp Commit changes to the given files into the repository. Unlike a centralized SCM, this operation is a local operation. See \%\fBhg push\fP\: for a way to actively distribute your changes. .sp If a list of files is omitted, all changes reported by \%\fBhg status\fP\: will be committed. .sp If you are committing the result of a merge, do not provide any filenames or \-I/\-X filters. .sp If no commit message is specified, Mercurial starts your configured editor where you can enter a message. In case your commit fails, you will find a backup of your message in \fB.hg/last\-message.txt\fP. .sp The \-\-amend flag can be used to amend the parent of the working directory with a new commit that contains the changes in the parent in addition to those currently reported by \%\fBhg status\fP\:, if there are any. The old commit is stored in a backup bundle in \fB.hg/strip\-backup\fP (see \%\fBhg help bundle\fP\: and \%\fBhg help unbundle\fP\: on how to restore it). .sp Message, user and date are taken from the amended commit unless specified. When a message isn\(aqt specified on the command line, the editor will open with the message of the amended commit. .sp It is not possible to amend public changesets (see \%\fBhg help phases\fP\:) or changesets that have children. .sp See \%\fBhg help dates\fP\: for a list of formats valid for \-d/\-\-date. .sp Returns 0 on success, 1 if nothing changed. .sp Options: .INDENT 0.0 .TP .B \-A, \-\-addremove . mark new/missing files as added/removed before committing .TP .B \-\-close\-branch . mark a branch as closed, hiding it from the branch list .TP .B \-\-amend . amend the parent of the working dir .TP .B \-s, \-\-secret . use the secret phase for committing .TP .B \-e, \-\-edit . invoke editor on commit messages .TP .BI \-I, \-\-include \ . include names matching the given patterns .TP .BI \-X, \-\-exclude \ . exclude names matching the given patterns .TP .BI \-m, \-\-message \ . use text as commit message .TP .BI \-l, \-\-logfile \ . read commit message from file .TP .BI \-d, \-\-date \ . record the specified date as commit date .TP .BI \-u, \-\-user \ . record the specified user as committer .TP .B \-S, \-\-subrepos . recurse into subrepositories .UNINDENT .sp [+] marked option can be specified multiple times .INDENT 0.0 .INDENT 3.5 .sp aliases: ci .UNINDENT .UNINDENT .SS config .sp show combined config settings from all hgrc files: .sp .nf .ft C hg config [\-u] [NAME]... .ft P .fi .sp With no arguments, print names and values of all config items. .sp With one argument of the form section.name, print just the value of that config item. .sp With multiple arguments, print names and values of all config items with matching section names. .sp With \-\-edit, start an editor on the user\-level config file. With \-\-global, edit the system\-wide config file. With \-\-local, edit the repository\-level config file. .sp With \-\-debug, the source (filename and line number) is printed for each config item. .sp See \%\fBhg help config\fP\: for more information about config files. .sp Returns 0 on success, 1 if NAME does not exist. .sp Options: .INDENT 0.0 .TP .B \-u, \-\-untrusted . show untrusted configuration options .TP .B \-e, \-\-edit . edit user config .TP .B \-l, \-\-local . edit repository config .TP .B \-g, \-\-global . edit global config .sp aliases: showconfig debugconfig .UNINDENT .SS copy .sp mark files as copied for the next commit: .sp .nf .ft C hg copy [OPTION]... [SOURCE]... DEST .ft P .fi .sp Mark dest as having copies of source files. If dest is a directory, copies are put in that directory. If dest is a file, the source must be a single file. .sp By default, this command copies the contents of files as they exist in the working directory. If invoked with \-A/\-\-after, the operation is recorded, but no copying is performed. .sp This command takes effect with the next commit. To undo a copy before that, see \%\fBhg revert\fP\:. .sp Returns 0 on success, 1 if errors are encountered. .sp Options: .INDENT 0.0 .TP .B \-A, \-\-after . record a copy that has already occurred .TP .B \-f, \-\-force . forcibly copy over an existing managed file .TP .BI \-I, \-\-include \ . include names matching the given patterns .TP .BI \-X, \-\-exclude \ . exclude names matching the given patterns .TP .B \-n, \-\-dry\-run . do not perform actions, just print output .UNINDENT .sp [+] marked option can be specified multiple times .INDENT 0.0 .INDENT 3.5 .sp aliases: cp .UNINDENT .UNINDENT .SS diff .sp diff repository (or selected files): .sp .nf .ft C hg diff [OPTION]... ([\-c REV] | [\-r REV1 [\-r REV2]]) [FILE]... .ft P .fi .sp Show differences between revisions for the specified files. .sp Differences between files are shown using the unified diff format. .IP Note . diff may generate unexpected results for merges, as it will default to comparing against the working directory\(aqs first parent changeset if no revisions are specified. .RE .sp When two revision arguments are given, then changes are shown between those revisions. If only one revision is specified then that revision is compared to the working directory, and, when no revisions are specified, the working directory files are compared to its parent. .sp Alternatively you can specify \-c/\-\-change with a revision to see the changes in that changeset relative to its first parent. .sp Without the \-a/\-\-text option, diff will avoid generating diffs of files it detects as binary. With \-a, diff will generate a diff anyway, probably with undesirable results. .sp Use the \-g/\-\-git option to generate diffs in the git extended diff format. For more information, read \%\fBhg help diffs\fP\:. .sp Examples: .INDENT 0.0 .IP \(bu 2 . compare a file in the current working directory to its parent: .sp .nf .ft C hg diff foo.c .ft P .fi .IP \(bu 2 . compare two historical versions of a directory, with rename info: .sp .nf .ft C hg diff \-\-git \-r 1.0:1.2 lib/ .ft P .fi .IP \(bu 2 . get change stats relative to the last change on some date: .sp .nf .ft C hg diff \-\-stat \-r "date(\(aqmay 2\(aq)" .ft P .fi .IP \(bu 2 . diff all newly\-added files that contain a keyword: .sp .nf .ft C hg diff "set:added() and grep(GNU)" .ft P .fi .IP \(bu 2 . compare a revision and its parents: .sp .nf .ft C hg diff \-c 9353 # compare against first parent hg diff \-r 9353^:9353 # same using revset syntax hg diff \-r 9353^2:9353 # compare against the second parent .ft P .fi .UNINDENT .sp Returns 0 on success. .sp Options: .INDENT 0.0 .TP .BI \-r, \-\-rev \ . revision .TP .BI \-c, \-\-change \ . change made by revision .TP .B \-a, \-\-text . treat all files as text .TP .B \-g, \-\-git . use git extended diff format .TP .B \-\-nodates . omit dates from diff headers .TP .B \-p, \-\-show\-function . show which function each change is in .TP .B \-\-reverse . produce a diff that undoes the changes .TP .B \-w, \-\-ignore\-all\-space . ignore white space when comparing lines .TP .B \-b, \-\-ignore\-space\-change . ignore changes in the amount of white space .TP .B \-B, \-\-ignore\-blank\-lines . ignore changes whose lines are all blank .TP .BI \-U, \-\-unified \ . number of lines of context to show .TP .B \-\-stat . output diffstat\-style summary of changes .TP .BI \-I, \-\-include \ . include names matching the given patterns .TP .BI \-X, \-\-exclude \ . exclude names matching the given patterns .TP .B \-S, \-\-subrepos . recurse into subrepositories .UNINDENT .sp [+] marked option can be specified multiple times .SS export .sp dump the header and diffs for one or more changesets: .sp .nf .ft C hg export [OPTION]... [\-o OUTFILESPEC] [\-r] [REV]... .ft P .fi .sp Print the changeset header and diffs for one or more revisions. If no revision is given, the parent of the working directory is used. .sp The information shown in the changeset header is: author, date, branch name (if non\-default), changeset hash, parent(s) and commit comment. .IP Note . export may generate unexpected diff output for merge changesets, as it will compare the merge changeset against its first parent only. .RE .sp Output may be to a file, in which case the name of the file is given using a format string. The formatting rules are as follows: .INDENT 0.0 .TP .B \fB%%\fP .sp literal "%" character .TP .B \fB%H\fP .sp changeset hash (40 hexadecimal digits) .TP .B \fB%N\fP .sp number of patches being generated .TP .B \fB%R\fP .sp changeset revision number .TP .B \fB%b\fP .sp basename of the exporting repository .TP .B \fB%h\fP .sp short\-form changeset hash (12 hexadecimal digits) .TP .B \fB%m\fP .sp first line of the commit message (only alphanumeric characters) .TP .B \fB%n\fP .sp zero\-padded sequence number, starting at 1 .TP .B \fB%r\fP .sp zero\-padded changeset revision number .UNINDENT .sp Without the \-a/\-\-text option, export will avoid generating diffs of files it detects as binary. With \-a, export will generate a diff anyway, probably with undesirable results. .sp Use the \-g/\-\-git option to generate diffs in the git extended diff format. See \%\fBhg help diffs\fP\: for more information. .sp With the \-\-switch\-parent option, the diff will be against the second parent. It can be useful to review a merge. .sp Examples: .INDENT 0.0 .IP \(bu 2 . use export and import to transplant a bugfix to the current branch: .sp .nf .ft C hg export \-r 9353 | hg import \- .ft P .fi .IP \(bu 2 . export all the changesets between two revisions to a file with rename information: .sp .nf .ft C hg export \-\-git \-r 123:150 > changes.txt .ft P .fi .IP \(bu 2 . split outgoing changes into a series of patches with descriptive names: .sp .nf .ft C hg export \-r "outgoing()" \-o "%n\-%m.patch" .ft P .fi .UNINDENT .sp Returns 0 on success. .sp Options: .INDENT 0.0 .TP .BI \-o, \-\-output \ . print output to file with formatted name .TP .B \-\-switch\-parent . diff against the second parent .TP .BI \-r, \-\-rev \ . revisions to export .TP .B \-a, \-\-text . treat all files as text .TP .B \-g, \-\-git . use git extended diff format .TP .B \-\-nodates . omit dates from diff headers .UNINDENT .sp [+] marked option can be specified multiple times .SS forget .sp forget the specified files on the next commit: .sp .nf .ft C hg forget [OPTION]... FILE... .ft P .fi .sp Mark the specified files so they will no longer be tracked after the next commit. .sp This only removes files from the current branch, not from the entire project history, and it does not delete them from the working directory. .sp To undo a forget before the next commit, see \%\fBhg add\fP\:. .sp Examples: .INDENT 0.0 .IP \(bu 2 . forget newly\-added binary files: .sp .nf .ft C hg forget "set:added() and binary()" .ft P .fi .IP \(bu 2 . forget files that would be excluded by .hgignore: .sp .nf .ft C hg forget "set:hgignore()" .ft P .fi .UNINDENT .sp Returns 0 on success. .sp Options: .INDENT 0.0 .TP .BI \-I, \-\-include \ . include names matching the given patterns .TP .BI \-X, \-\-exclude \ . exclude names matching the given patterns .UNINDENT .sp [+] marked option can be specified multiple times .SS graft .sp copy changes from other branches onto the current branch: .sp .nf .ft C hg graft [OPTION]... [\-r] REV... .ft P .fi .sp This command uses Mercurial\(aqs merge logic to copy individual changes from other branches without merging branches in the history graph. This is sometimes known as \(aqbackporting\(aq or \(aqcherry\-picking\(aq. By default, graft will copy user, date, and description from the source changesets. .sp Changesets that are ancestors of the current revision, that have already been grafted, or that are merges will be skipped. .sp If \-\-log is specified, log messages will have a comment appended of the form: .sp .nf .ft C (grafted from CHANGESETHASH) .ft P .fi .sp If a graft merge results in conflicts, the graft process is interrupted so that the current merge can be manually resolved. Once all conflicts are addressed, the graft process can be continued with the \-c/\-\-continue option. .IP Note . The \-c/\-\-continue option does not reapply earlier options. .RE .sp Examples: .INDENT 0.0 .IP \(bu 2 . copy a single change to the stable branch and edit its description: .sp .nf .ft C hg update stable hg graft \-\-edit 9393 .ft P .fi .IP \(bu 2 . graft a range of changesets with one exception, updating dates: .sp .nf .ft C hg graft \-D "2085::2093 and not 2091" .ft P .fi .IP \(bu 2 . continue a graft after resolving conflicts: .sp .nf .ft C hg graft \-c .ft P .fi .IP \(bu 2 . show the source of a grafted changeset: .sp .nf .ft C hg log \-\-debug \-r . .ft P .fi .UNINDENT .sp See \%\fBhg help revisions\fP\: and \%\fBhg help revsets\fP\: for more about specifying revisions. .sp Returns 0 on successful completion. .sp Options: .INDENT 0.0 .TP .BI \-r, \-\-rev \ . revisions to graft .TP .B \-c, \-\-continue . resume interrupted graft .TP .B \-e, \-\-edit . invoke editor on commit messages .TP .B \-\-log . append graft info to log message .TP .B \-D, \-\-currentdate . record the current date as commit date .TP .B \-U, \-\-currentuser . record the current user as committer .TP .BI \-d, \-\-date \ . record the specified date as commit date .TP .BI \-u, \-\-user \ . record the specified user as committer .TP .BI \-t, \-\-tool \ . specify merge tool .TP .B \-n, \-\-dry\-run . do not perform actions, just print output .UNINDENT .sp [+] marked option can be specified multiple times .SS grep .sp search for a pattern in specified files and revisions: .sp .nf .ft C hg grep [OPTION]... PATTERN [FILE]... .ft P .fi .sp Search revisions of files for a regular expression. .sp This command behaves differently than Unix grep. It only accepts Python/Perl regexps. It searches repository history, not the working directory. It always prints the revision number in which a match appears. .sp By default, grep only prints output for the first revision of a file in which it finds a match. To get it to print every revision that contains a change in match status ("\-" for a match that becomes a non\-match, or "+" for a non\-match that becomes a match), use the \-\-all flag. .sp Returns 0 if a match is found, 1 otherwise. .sp Options: .INDENT 0.0 .TP .B \-0, \-\-print0 . end fields with NUL .TP .B \-\-all . print all revisions that match .TP .B \-a, \-\-text . treat all files as text .TP .B \-f, \-\-follow . follow changeset history, or file history across copies and renames .TP .B \-i, \-\-ignore\-case . ignore case when matching .TP .B \-l, \-\-files\-with\-matches . print only filenames and revisions that match .TP .B \-n, \-\-line\-number . print matching line numbers .TP .BI \-r, \-\-rev \ . only search files changed within revision range .TP .B \-u, \-\-user . list the author (long with \-v) .TP .B \-d, \-\-date . list the date (short with \-q) .TP .BI \-I, \-\-include \ . include names matching the given patterns .TP .BI \-X, \-\-exclude \ . exclude names matching the given patterns .UNINDENT .sp [+] marked option can be specified multiple times .SS heads .sp show branch heads: .sp .nf .ft C hg heads [\-ct] [\-r STARTREV] [REV]... .ft P .fi .sp With no arguments, show all open branch heads in the repository. Branch heads are changesets that have no descendants on the same branch. They are where development generally takes place and are the usual targets for update and merge operations. .sp If one or more REVs are given, only open branch heads on the branches associated with the specified changesets are shown. This means that you can use \%\fBhg heads .\fP\: to see the heads on the currently checked\-out branch. .sp If \-c/\-\-closed is specified, also show branch heads marked closed (see \%\fBhg commit \-\-close\-branch\fP\:). .sp If STARTREV is specified, only those heads that are descendants of STARTREV will be displayed. .sp If \-t/\-\-topo is specified, named branch mechanics will be ignored and only topological heads (changesets with no children) will be shown. .sp Returns 0 if matching heads are found, 1 if not. .sp Options: .INDENT 0.0 .TP .BI \-r, \-\-rev \ . show only heads which are descendants of STARTREV .TP .B \-t, \-\-topo . show topological heads only .TP .B \-a, \-\-active . show active branchheads only (DEPRECATED) .TP .B \-c, \-\-closed . show normal and closed branch heads .TP .BI \-\-style \