<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.7: http://docutils.sourceforge.net/" />
<title>hg</title>
<meta name="author" content="Matt Mackall <mpm@selenic.com>" />
<meta name="organization" content="Mercurial" />
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<div class="document" id="hg">
<h1 class="title">hg</h1>
<h2 class="subtitle" id="mercurial-source-code-management-system">Mercurial source code management system</h2>
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name" />
<col class="docinfo-content" />
<tbody valign="top">
<tr><th class="docinfo-name">Author:</th>
<td>Matt Mackall <<a class="reference external" href="mailto:mpm@selenic.com">mpm@selenic.com</a>></td></tr>
<tr><th class="docinfo-name">Organization:</th>
<td>Mercurial</td></tr>
<tr class="field"><th class="docinfo-name">Manual section:</th><td class="field-body">1</td>
</tr>
<tr class="field"><th class="docinfo-name">Manual group:</th><td class="field-body">Mercurial Manual</td>
</tr>
</tbody>
</table>
<div class="contents htmlonly topic" id="contents">
<p class="topic-title first">Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#synopsis" id="id36">Synopsis</a></li>
<li><a class="reference internal" href="#description" id="id37">Description</a></li>
<li><a class="reference internal" href="#command-elements" id="id38">Command Elements</a></li>
<li><a class="reference internal" href="#options" id="id39">Options</a></li>
<li><a class="reference internal" href="#commands" id="id40">Commands</a></li>
<li><a class="reference internal" href="#configuration-files" id="id41">Configuration Files</a></li>
<li><a class="reference internal" href="#date-formats" id="id42">Date Formats</a></li>
<li><a class="reference internal" href="#file-name-patterns" id="id43">File Name Patterns</a></li>
<li><a class="reference internal" href="#environment-variables" id="id44">Environment Variables</a></li>
<li><a class="reference internal" href="#specifying-single-revisions" id="id45">Specifying Single Revisions</a></li>
<li><a class="reference internal" href="#specifying-multiple-revisions" id="id46">Specifying Multiple Revisions</a></li>
<li><a class="reference internal" href="#specifying-revision-sets" id="id47">Specifying Revision Sets</a></li>
<li><a class="reference internal" href="#diff-formats" id="id48">Diff Formats</a></li>
<li><a class="reference internal" href="#id1" id="id49">Merge Tools</a></li>
<li><a class="reference internal" href="#template-usage" id="id50">Template Usage</a></li>
<li><a class="reference internal" href="#url-paths" id="id51">URL Paths</a></li>
<li><a class="reference internal" href="#using-additional-features" id="id52">Using additional features</a></li>
<li><a class="reference internal" href="#subrepositories" id="id53">Subrepositories</a></li>
<li><a class="reference internal" href="#adding-a-subrepository" id="id54">Adding a Subrepository</a></li>
<li><a class="reference internal" href="#synchronizing-a-subrepository" id="id55">Synchronizing a Subrepository</a></li>
<li><a class="reference internal" href="#deleting-a-subrepository" id="id56">Deleting a Subrepository</a></li>
<li><a class="reference internal" href="#interaction-with-mercurial-commands" id="id57">Interaction with Mercurial Commands</a></li>
<li><a class="reference internal" href="#remapping-subrepositories-sources" id="id58">Remapping Subrepositories Sources</a></li>
<li><a class="reference internal" href="#configuring-hgweb" id="id59">Configuring hgweb</a></li>
<li><a class="reference internal" href="#id2" id="id60">Glossary</a></li>
<li><a class="reference internal" href="#id3" id="id61">Extensions</a></li>
<li><a class="reference internal" href="#files" id="id62">Files</a></li>
<li><a class="reference internal" href="#bugs" id="id63">Bugs</a></li>
<li><a class="reference internal" href="#see-also" id="id64">See Also</a></li>
<li><a class="reference internal" href="#author" id="id65">Author</a></li>
<li><a class="reference internal" href="#resources" id="id66">Resources</a></li>
<li><a class="reference internal" href="#copying" id="id67">Copying</a></li>
</ul>
</div>
<div class="section" id="synopsis">
<h1><a class="toc-backref" href="#contents">Synopsis</a></h1>
<p><strong>hg</strong> <em>command</em> [<em>option</em>]... [<em>argument</em>]...</p>
</div>
<div class="section" id="description">
<h1><a class="toc-backref" href="#contents">Description</a></h1>
<p>The <strong>hg</strong> command provides a command line interface to the Mercurial
system.</p>
</div>
<div class="section" id="command-elements">
<h1><a class="toc-backref" href="#contents">Command Elements</a></h1>
<dl class="docutils">
<dt>files...</dt>
<dd>indicates one or more filename or relative path filenames; see
<a class="reference internal" href="#file-name-patterns">File Name Patterns</a> for information on pattern matching</dd>
<dt>path</dt>
<dd>indicates a path on the local machine</dd>
<dt>revision</dt>
<dd>indicates a changeset which can be specified as a changeset
revision number, a tag, or a unique substring of the changeset
hash value</dd>
<dt>repository path</dt>
<dd>either the pathname of a local repository or the URI of a remote
repository.</dd>
</dl>
</div>
<div class="section" id="options">
<h1><a class="toc-backref" href="#contents">Options</a></h1>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-R</span>, <span class="option">--repository</span></kbd></td>
</tr>
<tr><td> </td><td>repository root directory or name of overlay bundle file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--cwd</span></kbd></td>
<td>change working directory</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-y</span>, <span class="option">--noninteractive</span></kbd></td>
</tr>
<tr><td> </td><td>do not prompt, assume 'yes' for any required answers</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-q</span>, <span class="option">--quiet</span></kbd></td>
<td>suppress output</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-v</span>, <span class="option">--verbose</span></kbd></td>
<td>enable additional output</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--config</span></kbd></td>
<td>set/override config option (use 'section.name=value')</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--debug</span></kbd></td>
<td>enable debugging output</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--debugger</span></kbd></td>
<td>start debugger</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--encoding</span></kbd></td>
<td>set the charset encoding (default: ascii)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--encodingmode</span></kbd></td>
<td>set the charset encoding mode (default: strict)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--traceback</span></kbd></td>
<td>always print a traceback on exception</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--time</span></kbd></td>
<td>time how long the command takes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--profile</span></kbd></td>
<td>print command execution profile</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--version</span></kbd></td>
<td>output version information and exit</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-h</span>, <span class="option">--help</span></kbd></td>
<td>display help and exit</td></tr>
</tbody>
</table>
</div>
<div class="section" id="commands">
<h1><a class="toc-backref" href="#contents">Commands</a></h1>
<div class="section" id="add">
<h2>add</h2>
<pre class="literal-block">
hg add [OPTION]... [FILE]...
</pre>
<p>Schedule files to be version controlled and added to the
repository.</p>
<p>The files will be added to the repository at the next commit. To
undo an add before that, see <a class="reference external" href="hg.1.html#forget"><tt class="docutils literal">hg forget</tt></a>.</p>
<p>If no names are given, add all files to the repository.</p>
<div class="verbose container">
<p>An example showing how new (unknown) files are added
automatically by <a class="reference external" href="hg.1.html#add"><tt class="docutils literal">hg add</tt></a>:</p>
<pre class="literal-block">
$ ls
foo.c
$ hg status
? foo.c
$ hg add
adding foo.c
$ hg status
A foo.c
</pre>
</div>
<p>Returns 0 if all files are successfully added.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-S</span>, <span class="option">--subrepos</span></kbd></td>
<td>recurse into subrepositories</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--dry-run</span></kbd></td>
<td>do not perform actions, just print output</td></tr>
</tbody>
</table>
</div>
<div class="section" id="addremove">
<h2>addremove</h2>
<pre class="literal-block">
hg addremove [OPTION]... [FILE]...
</pre>
<p>Add all new files and remove all missing files from the
repository.</p>
<p>New files are ignored if they match any of the patterns in
.hgignore. As with add, these changes take effect at the next
commit.</p>
<p>Use the -s/--similarity option to detect renamed files. With a
parameter greater than 0, this compares every removed file with
every added file and records those similar enough as renames. This
option takes a percentage between 0 (disabled) and 100 (files must
be identical) as its parameter. Detecting renamed files this way
can be expensive. After using this option, <a class="reference external" href="hg.1.html#status"><tt class="docutils literal">hg status <span class="pre">-C</span></tt></a> can be
used to check which files were identified as moved or renamed.</p>
<p>Returns 0 if all files are successfully added.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-s</span>, <span class="option">--similarity</span></kbd></td>
</tr>
<tr><td> </td><td>guess renamed files by similarity (0<=s<=100)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--dry-run</span></kbd></td>
<td>do not perform actions, just print output</td></tr>
</tbody>
</table>
</div>
<div class="section" id="annotate">
<h2>annotate</h2>
<pre class="literal-block">
hg annotate [-r REV] [-f] [-a] [-u] [-d] [-n] [-c] [-l] FILE...
</pre>
<p>List changes in files, showing the revision id responsible for
each line</p>
<p>This command is useful for discovering when a change was made and
by whom.</p>
<p>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.</p>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>annotate the specified revision</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--follow</span></kbd></td>
<td>follow copies/renames and list the filename (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--no-follow</span></kbd></td>
<td>don't follow copies and renames</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--text</span></kbd></td>
<td>treat all files as text</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td>list the author (long with -v)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--file</span></kbd></td>
<td>list the filename</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>list the date (short with -q)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--number</span></kbd></td>
<td>list the revision number (default)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-c</span>, <span class="option">--changeset</span></kbd></td>
</tr>
<tr><td> </td><td>list the changeset</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-l</span>, <span class="option">--line-number</span></kbd></td>
</tr>
<tr><td> </td><td>show line number at the first appearance</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td><p class="first">exclude names matching the given patterns</p>
<p class="last">aliases: blame</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="archive">
<h2>archive</h2>
<pre class="literal-block">
hg archive [OPTION]... DEST
</pre>
<p>By default, the revision used is the parent of the working
directory; use -r/--rev to specify a different revision.</p>
<p>The archive type is automatically detected based on file
extension (or override using -t/--type).</p>
<p>Valid types are:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name"><tt class="docutils literal">files</tt>:</th><td class="field-body">a directory full of files (default)</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">tar</tt>:</th><td class="field-body">tar archive, uncompressed</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">tbz2</tt>:</th><td class="field-body">tar archive, compressed using bzip2</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">tgz</tt>:</th><td class="field-body">tar archive, compressed using gzip</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">uzip</tt>:</th><td class="field-body">zip archive, uncompressed</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">zip</tt>:</th><td class="field-body">zip archive, compressed using deflate</td>
</tr>
</tbody>
</table>
<p>The exact name of the destination archive or directory is given
using a format string; see <a class="reference external" href="hg.1.html#export"><tt class="docutils literal">hg help export</tt></a> for details.</p>
<p>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.</p>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">--no-decode</span></kbd></td>
<td>do not pass files through decoders</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-p</span>, <span class="option">--prefix</span></kbd></td>
<td>directory prefix for files in archive</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>revision to distribute</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-t</span>, <span class="option">--type</span></kbd></td>
<td>type of distribution to create</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-S</span>, <span class="option">--subrepos</span></kbd></td>
<td>recurse into subrepositories</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
</div>
<div class="section" id="backout">
<h2>backout</h2>
<pre class="literal-block">
hg backout [OPTION]... [-r] REV
</pre>
<p>The backout command merges the reverse effect of the reverted
changeset into the working directory.</p>
<p>With the --merge option, it first commits the reverted changes
as a new changeset. This new changeset is a child of the reverted
changeset.
The --merge option remembers the parent of the working directory
before starting the backout, then merges the new head with that
changeset afterwards.
This will result in an explicit merge in the history.</p>
<p>If you backout a changeset other than the original parent of the
working directory, the result of this merge is not committed,
as with a normal merge. Otherwise, no merge is needed and the
commit is automatic.</p>
<p>Note that the default behavior (without --merge) has changed in
version 1.7. To restore the previous default behavior, use
<a class="reference external" href="hg.1.html#backout"><tt class="docutils literal">hg backout <span class="pre">--merge</span></tt></a> and then <a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update <span class="pre">--clean</span> .</tt></a> to get rid of
the ongoing merge.</p>
<p>See <a class="reference external" href="hg.1.html#dates"><tt class="docutils literal">hg help dates</tt></a> for a list of formats valid for -d/--date.</p>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">--merge</span></kbd></td>
<td>merge with old dirstate parent after backout</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--parent</span></kbd></td>
<td>parent to choose when backing out merge</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-t</span>, <span class="option">--tool</span></kbd></td>
<td>specify merge tool</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>revision to backout</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td>
<td>use text as commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td>
<td>read commit message from file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>record datecode as commit date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td>record the specified user as committer</td></tr>
</tbody>
</table>
</div>
<div class="section" id="bisect">
<h2>bisect</h2>
<pre class="literal-block">
hg bisect [-gbsr] [-U] [-c CMD] [REV]
</pre>
<p>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.</p>
<p>As a shortcut, you can also use the revision argument to mark a
revision as good or bad without checking it out first.</p>
<p>If you supply a command, it will be used for automatic bisection.
Its exit status 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.</p>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--reset</span></kbd></td>
<td>reset bisect state</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--good</span></kbd></td>
<td>mark changeset good</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--bad</span></kbd></td>
<td>mark changeset bad</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--skip</span></kbd></td>
<td>skip testing changeset</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-c</span>, <span class="option">--command</span></kbd></td>
<td>use command to check changeset state</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-U</span>, <span class="option">--noupdate</span></kbd></td>
<td>do not update to target</td></tr>
</tbody>
</table>
</div>
<div class="section" id="branch">
<h2>branch</h2>
<pre class="literal-block">
hg branch [-fC] [NAME]
</pre>
<p>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 'default'
branch.</p>
<p>Unless -f/--force is specified, branch will not let you set a
branch name that already exists, even if it's inactive.</p>
<p>Use -C/--clean to reset the working directory branch to that of
the parent of the working directory, negating a previous branch
change.</p>
<p>Use the command <a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update</tt></a> to switch to an existing branch. Use
<a class="reference external" href="hg.1.html#commit"><tt class="docutils literal">hg commit <span class="pre">--close-branch</span></tt></a> to mark this branch as closed.</p>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>set branch name even if it shadows an existing branch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-C</span>, <span class="option">--clean</span></kbd></td>
<td>reset branch name to parent branch name</td></tr>
</tbody>
</table>
</div>
<div class="section" id="branches">
<h2>branches</h2>
<pre class="literal-block">
hg branches [-ac]
</pre>
<p>List the repository's named branches, indicating which ones are
inactive. If -c/--closed is specified, also list branches which have
been marked closed (see <a class="reference external" href="hg.1.html#commit"><tt class="docutils literal">hg commit <span class="pre">--close-branch</span></tt></a>).</p>
<p>If -a/--active is specified, only show active branches. A branch
is considered active if it contains repository heads.</p>
<p>Use the command <a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update</tt></a> to switch to an existing branch.</p>
<p>Returns 0.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--active</span></kbd></td>
<td>show only branches that have unmerged heads</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-c</span>, <span class="option">--closed</span></kbd></td>
<td>show normal and closed branches</td></tr>
</tbody>
</table>
</div>
<div class="section" id="bundle">
<h2>bundle</h2>
<pre class="literal-block">
hg bundle [-f] [-t TYPE] [-a] [-r REV]... [--base REV]... FILE [DEST]
</pre>
<p>Generate a compressed changegroup file collecting changesets not
known to be in another repository.</p>
<p>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).</p>
<p>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).</p>
<p>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.</p>
<p>Applying bundles preserves all changeset contents including
permissions, copy/rename information, and revision history.</p>
<p>Returns 0 on success, 1 if no changes found.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>run even when the destination is unrelated</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>a changeset intended to be added to the destination</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td>
<td>a specific branch you would like to bundle</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--base</span></kbd></td>
<td>a base changeset assumed to be available at the destination</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--all</span></kbd></td>
<td>bundle all changesets in the repository</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-t</span>, <span class="option">--type</span></kbd></td>
<td>bundle compression type to use (default: bzip2)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td>
<td>specify ssh command to use</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--remotecmd</span></kbd></td>
<td>specify hg command to run on the remote side</td></tr>
</tbody>
</table>
</div>
<div class="section" id="cat">
<h2>cat</h2>
<pre class="literal-block">
hg cat [OPTION]... FILE...
</pre>
<p>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.</p>
<p>Output may be to a file, in which case the name of the file is
given using a format string. The formatting rules are the same as
for the export command, with the following additions:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name"><tt class="docutils literal">%s</tt>:</th><td class="field-body">basename of file being printed</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">%d</tt>:</th><td class="field-body">dirname of file being printed, or '.' if in repository root</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">%p</tt>:</th><td class="field-body">root-relative path name of file being printed</td>
</tr>
</tbody>
</table>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-o</span>, <span class="option">--output</span></kbd></td>
<td>print output to file with formatted name</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>print the given revision</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--decode</span></kbd></td>
<td>apply any matching decode filter</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
</div>
<div class="section" id="clone">
<h2>clone</h2>
<pre class="literal-block">
hg clone [OPTION]... SOURCE [DEST]
</pre>
<p>Create a copy of an existing repository in a new directory.</p>
<p>If no destination directory name is specified, it defaults to the
basename of the source.</p>
<p>The location of the source is added to the new repository's
.hg/hgrc file, as the default to be used for future pulls.</p>
<p>See <a class="reference external" href="hg.1.html#urls"><tt class="docutils literal">hg help urls</tt></a> for valid source format details.</p>
<p>It is possible to specify an <tt class="docutils literal"><span class="pre">ssh://</span></tt> URL as the destination, but no
.hg/hgrc and working directory will be created on the remote side.
Please see <a class="reference external" href="hg.1.html#urls"><tt class="docutils literal">hg help urls</tt></a> for important details about <tt class="docutils literal"><span class="pre">ssh://</span></tt> URLs.</p>
<p>A set of changesets (tags, or branch names) to pull may be specified
by listing each changeset (tag, or branch name) with -r/--rev.
If -r/--rev is used, the cloned repository will contain only a subset
of the changesets of the source repository. Only the set of changesets
defined by all -r/--rev options (including all their ancestors)
will be pulled into the destination repository.
No subsequent changesets (including subsequent tags) will be present
in the destination.</p>
<p>Using -r/--rev (or 'clone src#rev dest') implies --pull, even for
local source repositories.</p>
<p>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.</p>
<p>In some cases, you can clone repositories and the working directory
using full hardlinks with</p>
<pre class="literal-block">
$ cp -al REPO REPOCLONE
</pre>
<p>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.</p>
<p>Mercurial will update the working directory to the first applicable
revision from this list:</p>
<ol class="loweralpha simple">
<li>null if -U or the source repository has no changesets</li>
<li>if -u . and the source repository is local, the first parent of
the source repository's working directory</li>
<li>the changeset specified with -u (if a branch name, this means the
latest head of that branch)</li>
<li>the changeset specified with -r</li>
<li>the tipmost head specified with -b</li>
<li>the tipmost head specified with the url#branch source syntax</li>
<li>the tipmost head of the default branch</li>
<li>tip</li>
</ol>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-U</span>, <span class="option">--noupdate</span></kbd></td>
<td>the clone will include an empty working copy (only a repository)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-u</span>, <span class="option">--updaterev</span></kbd></td>
</tr>
<tr><td> </td><td>revision, tag or branch to check out</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>include the specified changeset</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td>
<td>clone only the specified branch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--pull</span></kbd></td>
<td>use pull protocol to copy metadata</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--uncompressed</span></kbd></td>
<td>use uncompressed transfer (fast over LAN)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td>
<td>specify ssh command to use</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--remotecmd</span></kbd></td>
<td>specify hg command to run on the remote side</td></tr>
</tbody>
</table>
</div>
<div class="section" id="commit">
<h2>commit</h2>
<pre class="literal-block">
hg commit [OPTION]... [FILE]...
</pre>
<p>Commit changes to the given files into the repository. Unlike a
centralized RCS, this operation is a local operation. See
<a class="reference external" href="hg.1.html#push"><tt class="docutils literal">hg push</tt></a> for a way to actively distribute your changes.</p>
<p>If a list of files is omitted, all changes reported by <a class="reference external" href="hg.1.html#status"><tt class="docutils literal">hg status</tt></a>
will be committed.</p>
<p>If you are committing the result of a merge, do not provide any
filenames or -I/-X filters.</p>
<p>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
<tt class="docutils literal"><span class="pre">.hg/last-message.txt</span></tt>.</p>
<p>See <a class="reference external" href="hg.1.html#dates"><tt class="docutils literal">hg help dates</tt></a> for a list of formats valid for -d/--date.</p>
<p>Returns 0 on success, 1 if nothing changed.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-A</span>, <span class="option">--addremove</span></kbd></td>
</tr>
<tr><td> </td><td>mark new/missing files as added/removed before committing</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--close-branch</span></kbd></td>
<td>mark a branch as closed, hiding it from the branch list</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td>
<td>use text as commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td>
<td>read commit message from file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>record datecode as commit date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td><p class="first">record the specified user as committer</p>
<p class="last">aliases: ci</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="copy">
<h2>copy</h2>
<pre class="literal-block">
hg copy [OPTION]... [SOURCE]... DEST
</pre>
<p>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.</p>
<p>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.</p>
<p>This command takes effect with the next commit. To undo a copy
before that, see <a class="reference external" href="hg.1.html#revert"><tt class="docutils literal">hg revert</tt></a>.</p>
<p>Returns 0 on success, 1 if errors are encountered.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-A</span>, <span class="option">--after</span></kbd></td>
<td>record a copy that has already occurred</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>forcibly copy over an existing managed file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--dry-run</span></kbd></td>
<td><p class="first">do not perform actions, just print output</p>
<p class="last">aliases: cp</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="diff">
<h2>diff</h2>
<pre class="literal-block">
hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
</pre>
<p>Show differences between revisions for the specified files.</p>
<p>Differences between files are shown using the unified diff format.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">diff may generate unexpected results for merges, as it will
default to comparing against the working directory's first
parent changeset if no revisions are specified.</p>
</div>
<p>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.</p>
<p>Alternatively you can specify -c/--change with a revision to see
the changes in that changeset relative to its first parent.</p>
<p>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.</p>
<p>Use the -g/--git option to generate diffs in the git extended diff
format. For more information, read <a class="reference external" href="hg.1.html#diffs"><tt class="docutils literal">hg help diffs</tt></a>.</p>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>revision</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-c</span>, <span class="option">--change</span></kbd></td>
<td>change made by revision</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--text</span></kbd></td>
<td>treat all files as text</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td>
<td>use git extended diff format</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--nodates</span></kbd></td>
<td>omit dates from diff headers</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-p</span>, <span class="option">--show-function</span></kbd></td>
</tr>
<tr><td> </td><td>show which function each change is in</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--reverse</span></kbd></td>
<td>produce a diff that undoes the changes</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-w</span>, <span class="option">--ignore-all-space</span></kbd></td>
</tr>
<tr><td> </td><td>ignore white space when comparing lines</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-b</span>, <span class="option">--ignore-space-change</span></kbd></td>
</tr>
<tr><td> </td><td>ignore changes in the amount of white space</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-B</span>, <span class="option">--ignore-blank-lines</span></kbd></td>
</tr>
<tr><td> </td><td>ignore changes whose lines are all blank</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-U</span>, <span class="option">--unified</span></kbd></td>
<td>number of lines of context to show</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--stat</span></kbd></td>
<td>output diffstat-style summary of changes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-S</span>, <span class="option">--subrepos</span></kbd></td>
<td>recurse into subrepositories</td></tr>
</tbody>
</table>
</div>
<div class="section" id="export">
<h2>export</h2>
<pre class="literal-block">
hg export [OPTION]... [-o OUTFILESPEC] REV...
</pre>
<p>Print the changeset header and diffs for one or more revisions.</p>
<p>The information shown in the changeset header is: author, date,
branch name (if non-default), changeset hash, parent(s) and commit
comment.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">export may generate unexpected diff output for merge
changesets, as it will compare the merge changeset against its
first parent only.</p>
</div>
<p>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:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name"><tt class="docutils literal">%%</tt>:</th><td class="field-body">literal "%" character</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">%H</tt>:</th><td class="field-body">changeset hash (40 hexadecimal digits)</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">%N</tt>:</th><td class="field-body">number of patches being generated</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">%R</tt>:</th><td class="field-body">changeset revision number</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">%b</tt>:</th><td class="field-body">basename of the exporting repository</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">%h</tt>:</th><td class="field-body">short-form changeset hash (12 hexadecimal digits)</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">%n</tt>:</th><td class="field-body">zero-padded sequence number, starting at 1</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">%r</tt>:</th><td class="field-body">zero-padded changeset revision number</td>
</tr>
</tbody>
</table>
<p>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.</p>
<p>Use the -g/--git option to generate diffs in the git extended diff
format. See <a class="reference external" href="hg.1.html#diffs"><tt class="docutils literal">hg help diffs</tt></a> for more information.</p>
<p>With the --switch-parent option, the diff will be against the
second parent. It can be useful to review a merge.</p>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-o</span>, <span class="option">--output</span></kbd></td>
<td>print output to file with formatted name</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--switch-parent</span></kbd></td>
</tr>
<tr><td> </td><td>diff against the second parent</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>revisions to export</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--text</span></kbd></td>
<td>treat all files as text</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td>
<td>use git extended diff format</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--nodates</span></kbd></td>
<td>omit dates from diff headers</td></tr>
</tbody>
</table>
</div>
<div class="section" id="forget">
<h2>forget</h2>
<pre class="literal-block">
hg forget [OPTION]... FILE...
</pre>
<p>Mark the specified files so they will no longer be tracked
after the next commit.</p>
<p>This only removes files from the current branch, not from the
entire project history, and it does not delete them from the
working directory.</p>
<p>To undo a forget before the next commit, see <a class="reference external" href="hg.1.html#add"><tt class="docutils literal">hg add</tt></a>.</p>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
</div>
<div class="section" id="grep">
<h2>grep</h2>
<pre class="literal-block">
hg grep [OPTION]... PATTERN [FILE]...
</pre>
<p>Search revisions of files for a regular expression.</p>
<p>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.</p>
<p>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.</p>
<p>Returns 0 if a match is found, 1 otherwise.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-0</span>, <span class="option">--print0</span></kbd></td>
<td>end fields with NUL</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--all</span></kbd></td>
<td>print all revisions that match</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--follow</span></kbd></td>
<td>follow changeset history, or file history across copies and renames</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-i</span>, <span class="option">--ignore-case</span></kbd></td>
</tr>
<tr><td> </td><td>ignore case when matching</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-l</span>, <span class="option">--files-with-matches</span></kbd></td>
</tr>
<tr><td> </td><td>print only filenames and revisions that match</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-n</span>, <span class="option">--line-number</span></kbd></td>
</tr>
<tr><td> </td><td>print matching line numbers</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>only search files changed within revision range</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td>list the author (long with -v)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>list the date (short with -q)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
</div>
<div class="section" id="heads">
<h2>heads</h2>
<pre class="literal-block">
hg heads [-ac] [-r STARTREV] [REV]...
</pre>
<p>With no arguments, show all repository branch heads.</p>
<p>Repository "heads" are changesets with no child changesets. They are
where development generally takes place and are the usual targets
for update and merge operations. Branch heads are changesets that have
no child changeset on the same branch.</p>
<p>If one or more REVs are given, only branch heads on the branches
associated with the specified changesets are shown.</p>
<p>If -c/--closed is specified, also show branch heads marked closed
(see <a class="reference external" href="hg.1.html#commit"><tt class="docutils literal">hg commit <span class="pre">--close-branch</span></tt></a>).</p>
<p>If STARTREV is specified, only those heads that are descendants of
STARTREV will be displayed.</p>
<p>If -t/--topo is specified, named branch mechanics will be ignored and only
changesets without children will be shown.</p>
<p>Returns 0 if matching heads are found, 1 if not.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>show only heads which are descendants of STARTREV</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-t</span>, <span class="option">--topo</span></kbd></td>
<td>show topological heads only</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--active</span></kbd></td>
<td>show active branchheads only (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-c</span>, <span class="option">--closed</span></kbd></td>
<td>show normal and closed branch heads</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--style</span></kbd></td>
<td>display using template map file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--template</span></kbd></td>
<td>display with template</td></tr>
</tbody>
</table>
</div>
<div class="section" id="help">
<h2>help</h2>
<pre class="literal-block">
hg help [TOPIC]
</pre>
<p>With no arguments, print a list of commands with short help messages.</p>
<p>Given a topic, extension, or command name, print help for that
topic.</p>
<p>Returns 0 if successful.</p>
</div>
<div class="section" id="identify">
<h2>identify</h2>
<pre class="literal-block">
hg identify [-nibt] [-r REV] [SOURCE]
</pre>
<p>With no revision, print a summary of the current state of the
repository.</p>
<p>Specifying a path to a repository root or Mercurial bundle will
cause lookup to operate on that repository/bundle.</p>
<p>This summary identifies the repository state using one or two
parent hash identifiers, followed by a "+" if there are
uncommitted changes in the working directory, a list of tags for
this revision and a branch name for non-default branches.</p>
<p>Returns 0 if successful.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>identify the specified revision</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--num</span></kbd></td>
<td>show local revision number</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-i</span>, <span class="option">--id</span></kbd></td>
<td>show global revision id</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td>
<td>show branch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-t</span>, <span class="option">--tags</span></kbd></td>
<td><p class="first">show tags</p>
<p class="last">aliases: id</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="import">
<h2>import</h2>
<pre class="literal-block">
hg import [OPTION]... PATCH...
</pre>
<p>Import a list of patches and commit them individually (unless
--no-commit is specified).</p>
<p>If there are outstanding changes in the working directory, import
will abort unless given the -f/--force flag.</p>
<p>You can import a patch straight from a mail message. Even patches
as attachments work (to use the body part, it must have type
text/plain or text/x-patch). From and Subject headers of email
message are used as default committer and commit message. All
text/plain body parts before first diff are added to commit
message.</p>
<p>If the imported patch was generated by <a class="reference external" href="hg.1.html#export"><tt class="docutils literal">hg export</tt></a>, user and
description from patch override values from message headers and
body. Values given on command line with -m/--message and -u/--user
override these.</p>
<p>If --exact is specified, import will set the working directory to
the parent of each patch before applying it, and will abort if the
resulting changeset has a different ID than the one recorded in
the patch. This may happen due to character set problems or other
deficiencies in the text patch format.</p>
<p>With -s/--similarity, hg will attempt to discover renames and
copies in the patch in the same way as 'addremove'.</p>
<p>To read a patch from standard input, use "-" as the patch name. If
a URL is specified, the patch will be downloaded from it.
See <a class="reference external" href="hg.1.html#dates"><tt class="docutils literal">hg help dates</tt></a> for a list of formats valid for -d/--date.</p>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-p</span>, <span class="option">--strip</span></kbd></td>
<td>directory strip option for patch. This has the same meaning as the corresponding patch option (default: 1)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--base</span></kbd></td>
<td>base path</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>skip check for outstanding uncommitted changes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--no-commit</span></kbd></td>
<td>don't commit, just update the working directory</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--exact</span></kbd></td>
<td>apply patch to the nodes from which it was generated</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--import-branch</span></kbd></td>
</tr>
<tr><td> </td><td>use any branch information in patch (implied by --exact)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td>
<td>use text as commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td>
<td>read commit message from file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>record datecode as commit date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td>record the specified user as committer</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-s</span>, <span class="option">--similarity</span></kbd></td>
</tr>
<tr><td> </td><td><p class="first">guess renamed files by similarity (0<=s<=100)</p>
<p class="last">aliases: patch</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="incoming">
<h2>incoming</h2>
<pre class="literal-block">
hg incoming [-p] [-n] [-M] [-f] [-r REV]... [--bundle FILENAME] [SOURCE]
</pre>
<p>Show new changesets found in the specified path/URL or the default
pull location. These are the changesets that would have been pulled
if a pull at the time you issued this command.</p>
<p>For remote repository, using --bundle avoids downloading the
changesets twice if the incoming is followed by a pull.</p>
<p>See pull for valid source format details.</p>
<p>Returns 0 if there are incoming changes, 1 otherwise.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>run even if remote repository is unrelated</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-n</span>, <span class="option">--newest-first</span></kbd></td>
</tr>
<tr><td> </td><td>show newest record first</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--bundle</span></kbd></td>
<td>file to store the bundles into</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>a remote changeset intended to be added</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td>
<td>a specific branch you would like to pull</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-p</span>, <span class="option">--patch</span></kbd></td>
<td>show patch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td>
<td>use git extended diff format</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--limit</span></kbd></td>
<td>limit number of changes displayed</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-M</span>, <span class="option">--no-merges</span></kbd></td>
</tr>
<tr><td> </td><td>do not show merges</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--stat</span></kbd></td>
<td>output diffstat-style summary of changes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--style</span></kbd></td>
<td>display using template map file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--template</span></kbd></td>
<td>display with template</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td>
<td>specify ssh command to use</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--remotecmd</span></kbd></td>
<td>specify hg command to run on the remote side</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-S</span>, <span class="option">--subrepos</span></kbd></td>
<td><p class="first">recurse into subrepositories</p>
<p class="last">aliases: in</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="init">
<h2>init</h2>
<pre class="literal-block">
hg init [-e CMD] [--remotecmd CMD] [DEST]
</pre>
<p>Initialize a new repository in the given directory. If the given
directory does not exist, it will be created.</p>
<p>If no directory is given, the current directory is used.</p>
<p>It is possible to specify an <tt class="docutils literal"><span class="pre">ssh://</span></tt> URL as the destination.
See <a class="reference external" href="hg.1.html#urls"><tt class="docutils literal">hg help urls</tt></a> for more information.</p>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td>
<td>specify ssh command to use</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--remotecmd</span></kbd></td>
<td>specify hg command to run on the remote side</td></tr>
</tbody>
</table>
</div>
<div class="section" id="locate">
<h2>locate</h2>
<pre class="literal-block">
hg locate [OPTION]... [PATTERN]...
</pre>
<p>Print files under Mercurial control in the working directory whose
names match the given patterns.</p>
<p>By default, this command searches all directories in the working
directory. To search just the current directory and its
subdirectories, use "--include .".</p>
<p>If no patterns are given to match, this command prints the names
of all files under Mercurial control in the working directory.</p>
<p>If you want to feed the output of this command into the "xargs"
command, use the -0 option to both this command and "xargs". This
will avoid the problem of "xargs" treating single filenames that
contain whitespace as multiple filenames.</p>
<p>Returns 0 if a match is found, 1 otherwise.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>search the repository as it is in REV</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-0</span>, <span class="option">--print0</span></kbd></td>
<td>end filenames with NUL, for use with xargs</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--fullpath</span></kbd></td>
<td>print complete paths from the filesystem root</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
</div>
<div class="section" id="log">
<h2>log</h2>
<pre class="literal-block">
hg log [OPTION]... [FILE]
</pre>
<p>Print the revision history of the specified files or the entire
project.</p>
<p>File history is shown without following rename or copy history of
files. Use -f/--follow with a filename to follow history across
renames and copies. --follow without a filename will only show
ancestors or descendants of the starting revision. --follow-first
only follows the first parent of merge revisions.</p>
<p>If no revision range is specified, the default is <tt class="docutils literal">tip:0</tt> unless
--follow is set, in which case the working directory parent is
used as the starting revision. You can specify a revision set for
log, see <a class="reference external" href="hg.1.html#revsets"><tt class="docutils literal">hg help revsets</tt></a> for more information.</p>
<p>See <a class="reference external" href="hg.1.html#dates"><tt class="docutils literal">hg help dates</tt></a> for a list of formats valid for -d/--date.</p>
<p>By default this command prints revision number and changeset id,
tags, non-trivial parents, user, date and time, and a summary for
each commit. When the -v/--verbose switch is used, the list of
changed files and full commit message are shown.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">log -p/--patch may generate unexpected diff output for merge
changesets, as it will only compare the merge changeset against
its first parent. Also, only files different from BOTH parents
will appear in files:.</p>
</div>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--follow</span></kbd></td>
<td>follow changeset history, or file history across copies and renames</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--follow-first</span></kbd></td>
<td>only follow the first parent of merge changesets</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>show revisions matching date spec</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-C</span>, <span class="option">--copies</span></kbd></td>
<td>show copied files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-k</span>, <span class="option">--keyword</span></kbd></td>
<td>do case-insensitive search for a given text</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>show the specified revision or range</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--removed</span></kbd></td>
<td>include revisions where files were removed</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-m</span>, <span class="option">--only-merges</span></kbd></td>
</tr>
<tr><td> </td><td>show only merges</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td>revisions committed by user</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--only-branch</span></kbd></td>
<td>show only changesets within the given named branch (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td>
<td>show changesets within the given named branch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-P</span>, <span class="option">--prune</span></kbd></td>
<td>do not display revision or any of its ancestors</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-p</span>, <span class="option">--patch</span></kbd></td>
<td>show patch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td>
<td>use git extended diff format</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--limit</span></kbd></td>
<td>limit number of changes displayed</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-M</span>, <span class="option">--no-merges</span></kbd></td>
</tr>
<tr><td> </td><td>do not show merges</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--stat</span></kbd></td>
<td>output diffstat-style summary of changes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--style</span></kbd></td>
<td>display using template map file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--template</span></kbd></td>
<td>display with template</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td><p class="first">exclude names matching the given patterns</p>
<p class="last">aliases: history</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="manifest">
<h2>manifest</h2>
<pre class="literal-block">
hg manifest [-r REV]
</pre>
<p>Print a list of version controlled files for the given revision.
If no revision is given, the first parent of the working directory
is used, or the null revision if no revision is checked out.</p>
<p>With -v, print file permissions, symlink and executable bits.
With --debug, print file revision hashes.</p>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>revision to display</td></tr>
</tbody>
</table>
</div>
<div class="section" id="merge">
<h2>merge</h2>
<pre class="literal-block">
hg merge [-P] [-f] [[-r] REV]
</pre>
<p>The current working directory is updated with all changes made in
the requested revision since the last common predecessor revision.</p>
<p>Files that changed between either parent are marked as changed for
the next commit and a commit must be performed before any further
updates to the repository are allowed. The next commit will have
two parents.</p>
<p><tt class="docutils literal"><span class="pre">--tool</span></tt> can be used to specify the merge tool used for file
merges. It overrides the HGMERGE environment variable and your
configuration files.</p>
<p>If no revision is specified, the working directory's parent is a
head revision, and the current branch contains exactly one other
head, the other head is merged with by default. Otherwise, an
explicit revision with which to merge with must be provided.</p>
<p><a class="reference external" href="hg.1.html#resolve"><tt class="docutils literal">hg resolve</tt></a> must be used to resolve unresolved files.</p>
<p>To undo an uncommitted merge, use <a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update <span class="pre">--clean</span> .</tt></a> which
will check out a clean copy of the original merge parent, losing
all changes.</p>
<p>Returns 0 on success, 1 if there are unresolved files.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>force a merge with outstanding changes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-t</span>, <span class="option">--tool</span></kbd></td>
<td>specify merge tool</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>revision to merge</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-P</span>, <span class="option">--preview</span></kbd></td>
<td>review revisions to merge (no merge is performed)</td></tr>
</tbody>
</table>
</div>
<div class="section" id="outgoing">
<h2>outgoing</h2>
<pre class="literal-block">
hg outgoing [-M] [-p] [-n] [-f] [-r REV]... [DEST]
</pre>
<p>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.</p>
<p>See pull for details of valid destination formats.</p>
<p>Returns 0 if there are outgoing changes, 1 otherwise.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>run even when the destination is unrelated</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>a changeset intended to be included in the destination</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-n</span>, <span class="option">--newest-first</span></kbd></td>
</tr>
<tr><td> </td><td>show newest record first</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td>
<td>a specific branch you would like to push</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-p</span>, <span class="option">--patch</span></kbd></td>
<td>show patch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td>
<td>use git extended diff format</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--limit</span></kbd></td>
<td>limit number of changes displayed</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-M</span>, <span class="option">--no-merges</span></kbd></td>
</tr>
<tr><td> </td><td>do not show merges</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--stat</span></kbd></td>
<td>output diffstat-style summary of changes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--style</span></kbd></td>
<td>display using template map file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--template</span></kbd></td>
<td>display with template</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td>
<td>specify ssh command to use</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--remotecmd</span></kbd></td>
<td>specify hg command to run on the remote side</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-S</span>, <span class="option">--subrepos</span></kbd></td>
<td><p class="first">recurse into subrepositories</p>
<p class="last">aliases: out</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="parents">
<h2>parents</h2>
<pre class="literal-block">
hg parents [-r REV] [FILE]
</pre>
<p>Print the working directory's parent revisions. If a revision is
given via -r/--rev, the parent of that revision will be printed.
If a file argument is given, the revision in which the file was
last changed (before the working directory revision or the
argument to --rev if given) is printed.</p>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>show parents of the specified revision</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--style</span></kbd></td>
<td>display using template map file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--template</span></kbd></td>
<td>display with template</td></tr>
</tbody>
</table>
</div>
<div class="section" id="paths">
<h2>paths</h2>
<pre class="literal-block">
hg paths [NAME]
</pre>
<p>Show definition of symbolic path name NAME. If no name is given,
show definition of all available names.</p>
<p>Path names are defined in the [paths] section of your
configuration file and in <tt class="docutils literal">/etc/mercurial/hgrc</tt>. If run inside a
repository, <tt class="docutils literal">.hg/hgrc</tt> is used, too.</p>
<p>The path names <tt class="docutils literal">default</tt> and <tt class="docutils literal"><span class="pre">default-push</span></tt> have a special
meaning. When performing a push or pull operation, they are used
as fallbacks if no location is specified on the command-line.
When <tt class="docutils literal"><span class="pre">default-push</span></tt> is set, it will be used for push and
<tt class="docutils literal">default</tt> will be used for pull; otherwise <tt class="docutils literal">default</tt> is used
as the fallback for both. When cloning a repository, the clone
source is written as <tt class="docutils literal">default</tt> in <tt class="docutils literal">.hg/hgrc</tt>. Note that
<tt class="docutils literal">default</tt> and <tt class="docutils literal"><span class="pre">default-push</span></tt> apply to all inbound (e.g.
<a class="reference external" href="hg.1.html#incoming"><tt class="docutils literal">hg incoming</tt></a>) and outbound (e.g. <a class="reference external" href="hg.1.html#outgoing"><tt class="docutils literal">hg outgoing</tt></a>, <a class="reference external" href="hg.1.html#email"><tt class="docutils literal">hg email</tt></a> and
<a class="reference external" href="hg.1.html#bundle"><tt class="docutils literal">hg bundle</tt></a>) operations.</p>
<p>See <a class="reference external" href="hg.1.html#urls"><tt class="docutils literal">hg help urls</tt></a> for more information.</p>
<p>Returns 0 on success.</p>
</div>
<div class="section" id="pull">
<h2>pull</h2>
<pre class="literal-block">
hg pull [-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [SOURCE]
</pre>
<p>Pull changes from a remote repository to a local one.</p>
<p>This finds all changes from the repository at the specified path
or URL and adds them to a local repository (the current one unless
-R is specified). By default, this does not update the copy of the
project in the working directory.</p>
<p>Use <a class="reference external" href="hg.1.html#incoming"><tt class="docutils literal">hg incoming</tt></a> if you want to see what would have been added
by a pull at the time you issued this command. If you then decide
to add those changes to the repository, you should use <a class="reference external" href="hg.1.html#pull"><tt class="docutils literal">hg pull
<span class="pre">-r</span> X</tt></a> where <tt class="docutils literal">X</tt> is the last changeset listed by <a class="reference external" href="hg.1.html#incoming"><tt class="docutils literal">hg incoming</tt></a>.</p>
<p>If SOURCE is omitted, the 'default' path will be used.
See <a class="reference external" href="hg.1.html#urls"><tt class="docutils literal">hg help urls</tt></a> for more information.</p>
<p>Returns 0 on success, 1 if an update had unresolved files.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--update</span></kbd></td>
<td>update to new branch head if changesets were pulled</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>run even when remote repository is unrelated</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>a remote changeset intended to be added</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td>
<td>a specific branch you would like to pull</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td>
<td>specify ssh command to use</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--remotecmd</span></kbd></td>
<td>specify hg command to run on the remote side</td></tr>
</tbody>
</table>
</div>
<div class="section" id="push">
<h2>push</h2>
<pre class="literal-block">
hg push [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]
</pre>
<p>Push changesets from the local repository to the specified
destination.</p>
<p>This operation is symmetrical to pull: it is identical to a pull
in the destination repository from the current one.</p>
<p>By default, push will not allow creation of new heads at the
destination, since multiple heads would make it unclear which head
to use. In this situation, it is recommended to pull and merge
before pushing.</p>
<p>Use --new-branch if you want to allow push to create a new named
branch that is not present at the destination. This allows you to
only create a new branch without forcing other changes.</p>
<p>Use -f/--force to override the default behavior and push all
changesets on all branches.</p>
<p>If -r/--rev is used, the specified revision and all its ancestors
will be pushed to the remote repository.</p>
<p>Please see <a class="reference external" href="hg.1.html#urls"><tt class="docutils literal">hg help urls</tt></a> for important details about <tt class="docutils literal"><span class="pre">ssh://</span></tt>
URLs. If DESTINATION is omitted, a default path will be used.</p>
<p>Returns 0 if push was successful, 1 if nothing to push.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>force push</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>a changeset intended to be included in the destination</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td>
<td>a specific branch you would like to push</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--new-branch</span></kbd></td>
<td>allow pushing a new branch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td>
<td>specify ssh command to use</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--remotecmd</span></kbd></td>
<td>specify hg command to run on the remote side</td></tr>
</tbody>
</table>
</div>
<div class="section" id="recover">
<h2>recover</h2>
<pre class="literal-block">
hg recover
</pre>
<p>Recover from an interrupted commit or pull.</p>
<p>This command tries to fix the repository status after an
interrupted operation. It should only be necessary when Mercurial
suggests it.</p>
<p>Returns 0 if successful, 1 if nothing to recover or verify fails.</p>
</div>
<div class="section" id="remove">
<h2>remove</h2>
<pre class="literal-block">
hg remove [OPTION]... FILE...
</pre>
<p>Schedule the indicated files for removal from the repository.</p>
<p>This only removes files from the current branch, not from the
entire project history. -A/--after can be used to remove only
files that have already been deleted, -f/--force can be used to
force deletion, and -Af can be used to remove files from the next
revision without deleting them from the working directory.</p>
<p>The following table details the behavior of remove for different
file states (columns) and option combinations (rows). The file
states are Added [A], Clean [C], Modified [M] and Missing [!] (as
reported by <a class="reference external" href="hg.1.html#status"><tt class="docutils literal">hg status</tt></a>). The actions are Warn, Remove (from
branch) and Delete (from disk):</p>
<pre class="literal-block">
A C M !
none W RD W R
-f R RD RD R
-A W W W R
-Af R R R R
</pre>
<p>This command schedules the files to be removed at the next commit.
To undo a remove before that, see <a class="reference external" href="hg.1.html#revert"><tt class="docutils literal">hg revert</tt></a>.</p>
<p>Returns 0 on success, 1 if any warnings encountered.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-A</span>, <span class="option">--after</span></kbd></td>
<td>record delete for missing files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>remove (and delete) file even if added or modified</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td><p class="first">exclude names matching the given patterns</p>
<p class="last">aliases: rm</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="rename">
<h2>rename</h2>
<pre class="literal-block">
hg rename [OPTION]... SOURCE... DEST
</pre>
<p>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.</p>
<p>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.</p>
<p>This command takes effect at the next commit. To undo a rename
before that, see <a class="reference external" href="hg.1.html#revert"><tt class="docutils literal">hg revert</tt></a>.</p>
<p>Returns 0 on success, 1 if errors are encountered.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-A</span>, <span class="option">--after</span></kbd></td>
<td>record a rename that has already occurred</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>forcibly copy over an existing managed file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--dry-run</span></kbd></td>
<td><p class="first">do not perform actions, just print output</p>
<p class="last">aliases: move mv</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="resolve">
<h2>resolve</h2>
<pre class="literal-block">
hg resolve [OPTION]... [FILE]...
</pre>
<p>Merges with unresolved conflicts are often the result of
non-interactive merging using the <tt class="docutils literal">internal:merge</tt> configuration
setting, or a command-line merge tool like <tt class="docutils literal">diff3</tt>. The resolve
command is used to manage the files involved in a merge, after
<a class="reference external" href="hg.1.html#merge"><tt class="docutils literal">hg merge</tt></a> has been run, and before <a class="reference external" href="hg.1.html#commit"><tt class="docutils literal">hg commit</tt></a> is run (i.e. the
working directory must have two parents).</p>
<p>The resolve command can be used in the following ways:</p>
<ul class="simple">
<li><a class="reference external" href="hg.1.html#resolve"><tt class="docutils literal">hg resolve <span class="pre">[--tool</span> TOOL] <span class="pre">FILE...</span></tt></a>: attempt to re-merge the specified
files, discarding any previous merge attempts. Re-merging is not
performed for files already marked as resolved. Use <tt class="docutils literal"><span class="pre">--all/-a</span></tt>
to selects all unresolved files. <tt class="docutils literal"><span class="pre">--tool</span></tt> can be used to specify
the merge tool used for the given files. It overrides the HGMERGE
environment variable and your configuration files.</li>
<li><a class="reference external" href="hg.1.html#resolve"><tt class="docutils literal">hg resolve <span class="pre">-m</span> [FILE]</tt></a>: mark a file as having been resolved
(e.g. after having manually fixed-up the files). The default is
to mark all unresolved files.</li>
<li><a class="reference external" href="hg.1.html#resolve"><tt class="docutils literal">hg resolve <span class="pre">-u</span> <span class="pre">[FILE]...</span></tt></a>: mark a file as unresolved. The
default is to mark all resolved files.</li>
<li><a class="reference external" href="hg.1.html#resolve"><tt class="docutils literal">hg resolve <span class="pre">-l</span></tt></a>: list files which had or still have conflicts.
In the printed list, <tt class="docutils literal">U</tt> = unresolved and <tt class="docutils literal">R</tt> = resolved.</li>
</ul>
<p>Note that Mercurial will not let you commit files with unresolved
merge conflicts. You must use <a class="reference external" href="hg.1.html#resolve"><tt class="docutils literal">hg resolve <span class="pre">-m</span> ...</tt></a> before you can
commit after a conflicting merge.</p>
<p>Returns 0 on success, 1 if any files fail a resolve attempt.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--all</span></kbd></td>
<td>select all unresolved files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--list</span></kbd></td>
<td>list state of files needing merge</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--mark</span></kbd></td>
<td>mark files as resolved</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--unmark</span></kbd></td>
<td>mark files as unresolved</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-t</span>, <span class="option">--tool</span></kbd></td>
<td>specify merge tool</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-n</span>, <span class="option">--no-status</span></kbd></td>
</tr>
<tr><td> </td><td>hide status prefix</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
</div>
<div class="section" id="revert">
<h2>revert</h2>
<pre class="literal-block">
hg revert [OPTION]... [-r REV] [NAME]...
</pre>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">This command is most likely not what you are looking for.
Revert will partially overwrite content in the working
directory without changing the working directory parents. Use
<a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update <span class="pre">-r</span> rev</tt></a> to check out earlier revisions, or
<a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update <span class="pre">--clean</span> .</tt></a> to undo a merge which has added another
parent.</p>
</div>
<p>With no revision specified, revert the named files or directories
to the contents they had in the parent of the working directory.
This restores the contents of the affected files to an unmodified
state and unschedules adds, removes, copies, and renames. If the
working directory has two parents, you must explicitly specify a
revision.</p>
<p>Using the -r/--rev option, revert the given files or directories
to their contents as of a specific revision. This can be helpful
to "roll back" some or all of an earlier change. See <a class="reference external" href="hg.1.html#dates"><tt class="docutils literal">hg help
dates</tt></a> for a list of formats valid for -d/--date.</p>
<p>Revert modifies the working directory. It does not commit any
changes, or change the parent of the working directory. If you
revert to a revision other than the parent of the working
directory, the reverted files will thus appear modified
afterwards.</p>
<p>If a file has been deleted, it is restored. If the executable mode
of a file was changed, it is reset.</p>
<p>If names are given, all files matching the names are reverted.
If no arguments are given, no files are reverted.</p>
<p>Modified files are saved with a .orig suffix before reverting.
To disable these backups, use --no-backup.</p>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--all</span></kbd></td>
<td>revert all changes when no arguments given</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>tipmost revision matching date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>revert to the specified revision</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--no-backup</span></kbd></td>
<td>do not save backup copies of files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--dry-run</span></kbd></td>
<td>do not perform actions, just print output</td></tr>
</tbody>
</table>
</div>
<div class="section" id="rollback">
<h2>rollback</h2>
<pre class="literal-block">
hg rollback
</pre>
<p>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. This command does not alter
the working directory.</p>
<p>Transactions are used to encapsulate the effects of all commands
that create new changesets or propagate existing changesets into a
repository. For example, the following commands are transactional,
and their effects can be rolled back:</p>
<ul class="simple">
<li>commit</li>
<li>import</li>
<li>pull</li>
<li>push (with this repository as the destination)</li>
<li>unbundle</li>
</ul>
<p>This command is not intended for use on public repositories. Once
changes are visible for pull by other users, rolling a transaction
back locally is ineffective (someone else may already have pulled
the changes). Furthermore, a race is possible with readers of the
repository; for example an in-progress pull from the repository
may fail if a rollback is performed.</p>
<p>Returns 0 on success, 1 if no rollback data is available.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--dry-run</span></kbd></td>
<td>do not perform actions, just print output</td></tr>
</tbody>
</table>
</div>
<div class="section" id="root">
<h2>root</h2>
<pre class="literal-block">
hg root
</pre>
<p>Print the root directory of the current repository.</p>
<p>Returns 0 on success.</p>
</div>
<div class="section" id="serve">
<h2>serve</h2>
<pre class="literal-block">
hg serve [OPTION]...
</pre>
<p>Start a local HTTP repository browser and pull server. You can use
this for ad-hoc sharing and browsing of repositories. It is
recommended to use a real web server to serve a repository for
longer periods of time.</p>
<p>Please note that the server does not implement access control.
This means that, by default, anybody can read from the server and
nobody can write to it by default. Set the <tt class="docutils literal">web.allow_push</tt>
option to <tt class="docutils literal">*</tt> to allow everybody to push to the server. You
should use a real web server if you need to authenticate users.</p>
<p>By default, the server logs accesses to stdout and errors to
stderr. Use the -A/--accesslog and -E/--errorlog options to log to
files.</p>
<p>To have the server choose a free port number to listen on, specify
a port number of 0; in this case, the server will print the port
number it uses.</p>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-A</span>, <span class="option">--accesslog</span></kbd></td>
</tr>
<tr><td> </td><td>name of access log file to write to</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--daemon</span></kbd></td>
<td>run server in background</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--daemon-pipefds</span></kbd></td>
</tr>
<tr><td> </td><td>used internally by daemon mode</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-E</span>, <span class="option">--errorlog</span></kbd></td>
<td>name of error log file to write to</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-p</span>, <span class="option">--port</span></kbd></td>
<td>port to listen on (default: 8000)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--address</span></kbd></td>
<td>address to listen on (default: all interfaces)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--prefix</span></kbd></td>
<td>prefix path to serve from (default: server root)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--name</span></kbd></td>
<td>name to show in web pages (default: working directory)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--web-conf</span></kbd></td>
<td>name of the hgweb config file (see "hg help hgweb")</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--webdir-conf</span></kbd></td>
<td>name of the hgweb config file (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--pid-file</span></kbd></td>
<td>name of file to write process ID to</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--stdio</span></kbd></td>
<td>for remote clients</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-t</span>, <span class="option">--templates</span></kbd></td>
</tr>
<tr><td> </td><td>web templates to use</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--style</span></kbd></td>
<td>template style to use</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-6</span>, <span class="option">--ipv6</span></kbd></td>
<td>use IPv6 in addition to IPv4</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--certificate</span></kbd></td>
<td>SSL certificate file</td></tr>
</tbody>
</table>
</div>
<div class="section" id="showconfig">
<h2>showconfig</h2>
<pre class="literal-block">
hg showconfig [-u] [NAME]...
</pre>
<p>With no arguments, print names and values of all config items.</p>
<p>With one argument of the form section.name, print just the value
of that config item.</p>
<p>With multiple arguments, print names and values of all config
items with matching section names.</p>
<p>With --debug, the source (filename and line number) is printed
for each config item.</p>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-u</span>, <span class="option">--untrusted</span></kbd></td>
</tr>
<tr><td> </td><td><p class="first">show untrusted configuration options</p>
<p class="last">aliases: debugconfig</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="status">
<h2>status</h2>
<pre class="literal-block">
hg status [OPTION]... [FILE]...
</pre>
<p>Show status of files in the repository. If names are given, only
files that match are shown. Files that are clean or ignored or
the source of a copy/move operation, are not listed unless
-c/--clean, -i/--ignored, -C/--copies or -A/--all are given.
Unless options described with "show only ..." are given, the
options -mardu are used.</p>
<p>Option -q/--quiet hides untracked (unknown and ignored) files
unless explicitly requested with -u/--unknown or -i/--ignored.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">status may appear to disagree with diff if permissions have
changed or a merge has occurred. The standard diff format does
not report permission changes and diff only reports changes
relative to one merge parent.</p>
</div>
<p>If one revision is given, it is used as the base revision.
If two revisions are given, the differences between them are
shown. The --change option can also be used as a shortcut to list
the changed files of a revision from its first parent.</p>
<p>The codes used to show the status of files are:</p>
<pre class="literal-block">
M = modified
A = added
R = removed
C = clean
! = missing (deleted by non-hg command, but still tracked)
? = not tracked
I = ignored
= origin of the previous file listed as A (added)
</pre>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-A</span>, <span class="option">--all</span></kbd></td>
<td>show status of all files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--modified</span></kbd></td>
<td>show only modified files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--added</span></kbd></td>
<td>show only added files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--removed</span></kbd></td>
<td>show only removed files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--deleted</span></kbd></td>
<td>show only deleted (but tracked) files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-c</span>, <span class="option">--clean</span></kbd></td>
<td>show only files without changes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--unknown</span></kbd></td>
<td>show only unknown (not tracked) files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-i</span>, <span class="option">--ignored</span></kbd></td>
<td>show only ignored files</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-n</span>, <span class="option">--no-status</span></kbd></td>
</tr>
<tr><td> </td><td>hide status prefix</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-C</span>, <span class="option">--copies</span></kbd></td>
<td>show source of copied files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-0</span>, <span class="option">--print0</span></kbd></td>
<td>end filenames with NUL, for use with xargs</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--rev</span></kbd></td>
<td>show difference from revision</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--change</span></kbd></td>
<td>list the changed files of a revision</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-S</span>, <span class="option">--subrepos</span></kbd></td>
<td><p class="first">recurse into subrepositories</p>
<p class="last">aliases: st</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="summary">
<h2>summary</h2>
<pre class="literal-block">
hg summary [--remote]
</pre>
<p>This generates a brief summary of the working directory state,
including parents, branch, commit status, and available updates.</p>
<p>With the --remote option, this will check the default paths for
incoming and outgoing changes. This can be time-consuming.</p>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">--remote</span></kbd></td>
<td><p class="first">check for push and pull</p>
<p class="last">aliases: sum</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="tag">
<h2>tag</h2>
<pre class="literal-block">
hg tag [-f] [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME...
</pre>
<p>Name a particular revision using <name>.</p>
<p>Tags are used to name particular revisions of the repository and are
very useful to compare different revisions, to go back to significant
earlier versions or to mark branch points as releases, etc. Changing
an existing tag is normally disallowed; use -f/--force to override.</p>
<p>If no revision is given, the parent of the working directory is
used, or tip if no revision is checked out.</p>
<p>To facilitate version control, distribution, and merging of tags,
they are stored as a file named ".hgtags" which is managed similarly
to other project files and can be hand-edited if necessary. This
also means that tagging creates a new commit. The file
".hg/localtags" is used for local tags (not shared among
repositories).</p>
<p>Tag commits are usually made at the head of a branch. If the parent
of the working directory is not a branch head, <a class="reference external" href="hg.1.html#tag"><tt class="docutils literal">hg tag</tt></a> aborts; use
-f/--force to force the tag commit to be based on a non-head
changeset.</p>
<p>See <a class="reference external" href="hg.1.html#dates"><tt class="docutils literal">hg help dates</tt></a> for a list of formats valid for -d/--date.</p>
<p>Since tag names have priority over branch names during revision
lookup, using an existing branch name as a tag name is discouraged.</p>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>force tag</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--local</span></kbd></td>
<td>make the tag local</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>revision to tag</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--remove</span></kbd></td>
<td>remove a tag</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td>
<td>edit commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td>
<td>use <text> as commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>record datecode as commit date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td>record the specified user as committer</td></tr>
</tbody>
</table>
</div>
<div class="section" id="tags">
<h2>tags</h2>
<pre class="literal-block">
hg tags
</pre>
<p>This lists both regular and local tags. When the -v/--verbose
switch is used, a third column "local" is printed for local tags.</p>
<p>Returns 0 on success.</p>
</div>
<div class="section" id="tip">
<h2>tip</h2>
<pre class="literal-block">
hg tip [-p] [-g]
</pre>
<p>The tip revision (usually just called the tip) is the changeset
most recently added to the repository (and therefore the most
recently changed head).</p>
<p>If you have just made a commit, that commit will be the tip. If
you have just pulled changes from another repository, the tip of
that repository becomes the current tip. The "tip" tag is special
and cannot be renamed or assigned to a different changeset.</p>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-p</span>, <span class="option">--patch</span></kbd></td>
<td>show patch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td>
<td>use git extended diff format</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--style</span></kbd></td>
<td>display using template map file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--template</span></kbd></td>
<td>display with template</td></tr>
</tbody>
</table>
</div>
<div class="section" id="unbundle">
<h2>unbundle</h2>
<pre class="literal-block">
hg unbundle [-u] FILE...
</pre>
<p>Apply one or more compressed changegroup files generated by the
bundle command.</p>
<p>Returns 0 on success, 1 if an update has unresolved files.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--update</span></kbd></td>
<td>update to new branch head if changesets were unbundled</td></tr>
</tbody>
</table>
</div>
<div class="section" id="update">
<h2>update</h2>
<pre class="literal-block">
hg update [-c] [-C] [-d DATE] [[-r] REV]
</pre>
<p>Update the repository's working directory to the specified
changeset. If no changeset is specified, update to the tip of the
current named branch.</p>
<p>If the changeset is not a descendant of the working directory's
parent, the update is aborted. With the -c/--check option, the
working directory is checked for uncommitted changes; if none are
found, the working directory is updated to the specified
changeset.</p>
<p>The following rules apply when the working directory contains
uncommitted changes:</p>
<ol class="arabic simple">
<li>If neither -c/--check nor -C/--clean is specified, and if
the requested changeset is an ancestor or descendant of
the working directory's parent, the uncommitted changes
are merged into the requested changeset and the merged
result is left uncommitted. If the requested changeset is
not an ancestor or descendant (that is, it is on another
branch), the update is aborted and the uncommitted changes
are preserved.</li>
<li>With the -c/--check option, the update is aborted and the
uncommitted changes are preserved.</li>
<li>With the -C/--clean option, uncommitted changes are discarded and
the working directory is updated to the requested changeset.</li>
</ol>
<p>Use null as the changeset to remove the working directory (like
<a class="reference external" href="hg.1.html#clone"><tt class="docutils literal">hg clone <span class="pre">-U</span></tt></a>).</p>
<p>If you want to update just one file to an older changeset, use
<a class="reference external" href="hg.1.html#revert"><tt class="docutils literal">hg revert</tt></a>.</p>
<p>See <a class="reference external" href="hg.1.html#dates"><tt class="docutils literal">hg help dates</tt></a> for a list of formats valid for -d/--date.</p>
<p>Returns 0 on success, 1 if there are unresolved files.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-C</span>, <span class="option">--clean</span></kbd></td>
<td>discard uncommitted changes (no backup)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-c</span>, <span class="option">--check</span></kbd></td>
<td>update across branches if no uncommitted changes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>tipmost revision matching date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td><p class="first">revision</p>
<p class="last">aliases: up checkout co</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="verify">
<h2>verify</h2>
<pre class="literal-block">
hg verify
</pre>
<p>Verify the integrity of the current repository.</p>
<p>This will perform an extensive check of the repository's
integrity, validating the hashes and checksums of each entry in
the changelog, manifest, and tracked files, as well as the
integrity of their crosslinks and indices.</p>
<p>Returns 0 on success, 1 if errors are encountered.</p>
</div>
<div class="section" id="version">
<h2>version</h2>
<pre class="literal-block">
hg version
</pre>
<p>output version and copyright information</p>
</div>
</div>
<div class="section" id="configuration-files">
<span id="hgrc"></span><span id="config"></span><h1><a class="toc-backref" href="#contents">Configuration Files</a></h1>
<p>Mercurial reads configuration data from several files, if they exist.
Below we list the most specific file first.</p>
<p>On Windows, these configuration files are read:</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre"><repo>\.hg\hgrc</span></tt></li>
<li><tt class="docutils literal"><span class="pre">%USERPROFILE%\.hgrc</span></tt></li>
<li><tt class="docutils literal"><span class="pre">%USERPROFILE%\mercurial.ini</span></tt></li>
<li><tt class="docutils literal"><span class="pre">%HOME%\.hgrc</span></tt></li>
<li><tt class="docutils literal"><span class="pre">%HOME%\mercurial.ini</span></tt></li>
<li><tt class="docutils literal"><span class="pre">C:\mercurial\mercurial.ini</span></tt> (unless regkey or hgrc.dor mercurial.ini found)</li>
<li><tt class="docutils literal">HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial</tt> (unless hgrc.dor mercurial.ini found)</li>
<li><tt class="docutils literal"><span class="pre"><hg.exe-dir>\hgrc.d\*.rc</span></tt> (unless mercurial.ini found)</li>
<li><tt class="docutils literal"><span class="pre"><hg.exe-dir>\mercurial.ini</span></tt></li>
</ul>
<p>On Unix, these files are read:</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre"><repo>/.hg/hgrc</span></tt></li>
<li><tt class="docutils literal"><span class="pre">$HOME/.hgrc</span></tt></li>
<li><tt class="docutils literal">/etc/mercurial/hgrc</tt></li>
<li><tt class="docutils literal"><span class="pre">/etc/mercurial/hgrc.d/*.rc</span></tt></li>
<li><tt class="docutils literal"><span class="pre"><install-root>/etc/mercurial/hgrc</span></tt></li>
<li><tt class="docutils literal"><span class="pre"><install-root>/etc/mercurial/hgrc.d/*.rc</span></tt></li>
</ul>
<p>If there is a per-repository configuration file which is not owned by
the active user, Mercurial will warn you that the file is skipped:</p>
<pre class="literal-block">
not trusting file <repo>/.hg/hgrc from untrusted user USER, group GROUP
</pre>
<p>If this bothers you, the warning can be silenced (the file would still
be ignored) or trust can be established. Use one of the following
settings, the syntax is explained below:</p>
<ul class="simple">
<li><tt class="docutils literal">ui.report_untrusted = False</tt></li>
<li><tt class="docutils literal">trusted.users = USER</tt></li>
<li><tt class="docutils literal">trusted.groups = GROUP</tt></li>
</ul>
<p>The configuration files for Mercurial use a simple ini-file format. A
configuration file consists of sections, led by a <tt class="docutils literal">[section]</tt> header
and followed by <tt class="docutils literal">name = value</tt> entries:</p>
<pre class="literal-block">
[ui]
username = Firstname Lastname <firstname.lastname@example.net>
verbose = True
</pre>
<p>The above entries will be referred to as <tt class="docutils literal">ui.username</tt> and
<tt class="docutils literal">ui.verbose</tt>, respectively. Please see the hgrc man page for a full
description of the possible configuration values:</p>
<ul class="simple">
<li>on Unix-like systems: <tt class="docutils literal">man hgrc</tt></li>
<li>online: <a class="reference external" href="http://www.selenic.com/mercurial/hgrc.5.html">http://www.selenic.com/mercurial/hgrc.5.html</a></li>
</ul>
</div>
<div class="section" id="date-formats">
<span id="dates"></span><h1><a class="toc-backref" href="#contents">Date Formats</a></h1>
<p>Some commands allow the user to specify a date, e.g.:</p>
<ul class="simple">
<li>backout, commit, import, tag: Specify the commit date.</li>
<li>log, revert, update: Select revision(s) by date.</li>
</ul>
<p>Many date formats are valid. Here are some examples:</p>
<ul class="simple">
<li><tt class="docutils literal">Wed Dec 6 13:18:29 2006</tt> (local timezone assumed)</li>
<li><tt class="docutils literal">Dec 6 13:18 <span class="pre">-0600</span></tt> (year assumed, time offset provided)</li>
<li><tt class="docutils literal">Dec 6 13:18 UTC</tt> (UTC and GMT are aliases for +0000)</li>
<li><tt class="docutils literal">Dec 6</tt> (midnight)</li>
<li><tt class="docutils literal">13:18</tt> (today assumed)</li>
<li><tt class="docutils literal">3:39</tt> (3:39AM assumed)</li>
<li><tt class="docutils literal">3:39pm</tt> (15:39)</li>
<li><tt class="docutils literal"><span class="pre">2006-12-06</span> 13:18:29</tt> (ISO 8601 format)</li>
<li><tt class="docutils literal"><span class="pre">2006-12-6</span> 13:18</tt></li>
<li><tt class="docutils literal"><span class="pre">2006-12-6</span></tt></li>
<li><tt class="docutils literal"><span class="pre">12-6</span></tt></li>
<li><tt class="docutils literal">12/6</tt></li>
<li><tt class="docutils literal">12/6/6</tt> (Dec 6 2006)</li>
</ul>
<p>Lastly, there is Mercurial's internal format:</p>
<ul class="simple">
<li><tt class="docutils literal">1165432709 0</tt> (Wed Dec 6 13:18:29 2006 UTC)</li>
</ul>
<p>This is the internal representation format for dates. unixtime is the
number of seconds since the epoch (1970-01-01 00:00 UTC). offset is
the offset of the local timezone, in seconds west of UTC (negative if
the timezone is east of UTC).</p>
<p>The log command also accepts date ranges:</p>
<ul class="simple">
<li><tt class="docutils literal"><{datetime}</tt> - at or before a given date/time</li>
<li><tt class="docutils literal">>{datetime}</tt> - on or after a given date/time</li>
<li><tt class="docutils literal">{datetime} to {datetime}</tt> - a date range, inclusive</li>
<li><tt class="docutils literal"><span class="pre">-{days}</span></tt> - within a given number of days of today</li>
</ul>
</div>
<div class="section" id="file-name-patterns">
<span id="patterns"></span><h1><a class="toc-backref" href="#contents">File Name Patterns</a></h1>
<p>Mercurial accepts several notations for identifying one or more files
at a time.</p>
<p>By default, Mercurial treats filenames as shell-style extended glob
patterns.</p>
<p>Alternate pattern notations must be specified explicitly.</p>
<p>To use a plain path name without any pattern matching, start it with
<tt class="docutils literal">path:</tt>. These path names must completely match starting at the
current repository root.</p>
<p>To use an extended glob, start a name with <tt class="docutils literal">glob:</tt>. Globs are rooted
at the current directory; a glob such as <tt class="docutils literal">*.c</tt> will only match files
in the current directory ending with <tt class="docutils literal">.c</tt>.</p>
<p>The supported glob syntax extensions are <tt class="docutils literal">**</tt> to match any string
across path separators and <tt class="docutils literal">{a,b}</tt> to mean "a or b".</p>
<p>To use a Perl/Python regular expression, start a name with <tt class="docutils literal">re:</tt>.
Regexp pattern matching is anchored at the root of the repository.</p>
<p>Plain examples:</p>
<pre class="literal-block">
path:foo/bar a name bar in a directory named foo in the root
of the repository
path:path:name a file or directory named "path:name"
</pre>
<p>Glob examples:</p>
<pre class="literal-block">
glob:*.c any name ending in ".c" in the current directory
*.c any name ending in ".c" in the current directory
**.c any name ending in ".c" in any subdirectory of the
current directory including itself.
foo/*.c any name ending in ".c" in the directory foo
foo/**.c any name ending in ".c" in any subdirectory of foo
including itself.
</pre>
<p>Regexp examples:</p>
<pre class="literal-block">
re:.*\.c$ any name ending in ".c", anywhere in the repository
</pre>
</div>
<div class="section" id="environment-variables">
<span id="env"></span><span id="environment"></span><h1><a class="toc-backref" href="#contents">Environment Variables</a></h1>
<dl class="docutils">
<dt>HG</dt>
<dd>Path to the 'hg' executable, automatically passed when running
hooks, extensions or external tools. If unset or empty, this is
the hg executable's name if it's frozen, or an executable named
'hg' (with %PATHEXT% [defaulting to COM/EXE/BAT/CMD] extensions on
Windows) is searched.</dd>
<dt>HGEDITOR</dt>
<dd><p class="first">This is the name of the editor to run when committing. See EDITOR.</p>
<p class="last">(deprecated, use configuration file)</p>
</dd>
<dt>HGENCODING</dt>
<dd>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.</dd>
<dt>HGENCODINGMODE</dt>
<dd>This sets Mercurial's behavior for handling unknown characters
while transcoding user input. The default is "strict", which
causes Mercurial to abort if it can't map 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.</dd>
<dt>HGENCODINGAMBIGUOUS</dt>
<dd>This sets Mercurial's behavior for handling characters with
"ambiguous" widths like accented Latin characters with East Asian
fonts. By default, Mercurial assumes ambiguous characters are
narrow, set this variable to "wide" if such characters cause
formatting problems.</dd>
<dt>HGMERGE</dt>
<dd><p class="first">An executable to use for resolving merge conflicts. The program
will be executed with three arguments: local file, remote file,
ancestor file.</p>
<p class="last">(deprecated, use configuration file)</p>
</dd>
<dt>HGRCPATH</dt>
<dd><p class="first">A list of files or directories to search for configuration
files. Item separator is ":" on Unix, ";" on Windows. If HGRCPATH
is not set, platform default search path is used. If empty, only
the .hg/hgrc from the current repository is read.</p>
<p>For each element in HGRCPATH:</p>
<ul class="last simple">
<li>if it's a directory, all files ending with .rc are added</li>
<li>otherwise, the file itself will be added</li>
</ul>
</dd>
<dt>HGPLAIN</dt>
<dd><p class="first">When set, this disables any configuration settings that might
change Mercurial's default output. This includes encoding,
defaults, verbose mode, debug mode, quiet mode, tracebacks, and
localization. This can be useful when scripting against Mercurial
in the face of existing user configuration.</p>
<p class="last">Equivalent options set via command line flags or environment
variables are not overridden.</p>
</dd>
<dt>HGUSER</dt>
<dd><p class="first">This is the string used as the author of a commit. If not set,
available values will be considered in this order:</p>
<ul class="simple">
<li>HGUSER (deprecated)</li>
<li>configuration files from the HGRCPATH</li>
<li>EMAIL</li>
<li>interactive prompt</li>
<li>LOGNAME (with <tt class="docutils literal">@hostname</tt> appended)</li>
</ul>
<p class="last">(deprecated, use configuration file)</p>
</dd>
<dt>EMAIL</dt>
<dd>May be used as the author of a commit; see HGUSER.</dd>
<dt>LOGNAME</dt>
<dd>May be used as the author of a commit; see HGUSER.</dd>
<dt>VISUAL</dt>
<dd>This is the name of the editor to use when committing. See EDITOR.</dd>
<dt>EDITOR</dt>
<dd>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 'vi'.</dd>
<dt>PYTHONPATH</dt>
<dd>This is used by Python to find imported modules and may need to be
set appropriately if this Mercurial is not installed system-wide.</dd>
</dl>
</div>
<div class="section" id="specifying-single-revisions">
<span id="revisions"></span><span id="revs"></span><h1><a class="toc-backref" href="#contents">Specifying Single Revisions</a></h1>
<p>Mercurial supports several ways to specify individual revisions.</p>
<p>A plain integer is treated as a revision number. Negative integers are
treated as sequential offsets from the tip, with -1 denoting the tip,
-2 denoting the revision prior to the tip, and so forth.</p>
<p>A 40-digit hexadecimal string is treated as a unique revision
identifier.</p>
<p>A hexadecimal string less than 40 characters long is treated as a
unique revision identifier and is referred to as a short-form
identifier. A short-form identifier is only valid if it is the prefix
of exactly one full-length identifier.</p>
<p>Any other string is treated as a tag or branch name. A tag name is a
symbolic name associated with a revision identifier. A branch name
denotes the tipmost revision of that branch. Tag and branch names must
not contain the ":" character.</p>
<p>The reserved name "tip" is a special tag that always identifies the
most recent revision.</p>
<p>The reserved name "null" indicates the null revision. This is the
revision of an empty repository, and the parent of revision 0.</p>
<p>The reserved name "." indicates the working directory parent. If no
working directory is checked out, it is equivalent to null. If an
uncommitted merge is in progress, "." is the revision of the first
parent.</p>
</div>
<div class="section" id="specifying-multiple-revisions">
<span id="multirevs"></span><span id="mrevs"></span><h1><a class="toc-backref" href="#contents">Specifying Multiple Revisions</a></h1>
<p>When Mercurial accepts more than one revision, they may be specified
individually, or provided as a topologically continuous range,
separated by the ":" character.</p>
<p>The syntax of range notation is [BEGIN]:[END], where BEGIN and END are
revision identifiers. Both BEGIN and END are optional. If BEGIN is not
specified, it defaults to revision number 0. If END is not specified,
it defaults to the tip. The range ":" thus means "all revisions".</p>
<p>If BEGIN is greater than END, revisions are treated in reverse order.</p>
<p>A range acts as a closed interval. This means that a range of 3:5
gives 3, 4 and 5. Similarly, a range of 9:6 gives 9, 8, 7, and 6.</p>
</div>
<div class="section" id="specifying-revision-sets">
<span id="revsets"></span><span id="revset"></span><h1><a class="toc-backref" href="#contents">Specifying Revision Sets</a></h1>
<p>Mercurial supports a functional language for selecting a set of
revisions.</p>
<p>The language supports a number of predicates which are joined by infix
operators. Parenthesis can be used for grouping.</p>
<p>Identifiers such as branch names must be quoted with single or double
quotes if they contain characters outside of
<tt class="docutils literal"><span class="pre">[._a-zA-Z0-9\x80-\xff]</span></tt> or if they match one of the predefined
predicates.</p>
<p>Special characters can be used in quoted identifiers by escaping them,
e.g., <tt class="docutils literal">\n</tt> is interpreted as a newline. To prevent them from being
interpreted, strings can be prefixed with <tt class="docutils literal">r</tt>, e.g. <tt class="docutils literal"><span class="pre">r'...'</span></tt>.</p>
<p>There is a single prefix operator:</p>
<dl class="docutils">
<dt><tt class="docutils literal">not x</tt></dt>
<dd>Changesets not in x. Short form is <tt class="docutils literal">! x</tt>.</dd>
</dl>
<p>These are the supported infix operators:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">x::y</span></tt></dt>
<dd><p class="first">A DAG range, meaning all changesets that are descendants of x and
ancestors of y, including x and y themselves. If the first endpoint
is left out, this is equivalent to <tt class="docutils literal">ancestors(y)</tt>, if the second
is left out it is equivalent to <tt class="docutils literal">descendants(x)</tt>.</p>
<p class="last">An alternative syntax is <tt class="docutils literal"><span class="pre">x..y</span></tt>.</p>
</dd>
<dt><tt class="docutils literal">x:y</tt></dt>
<dd>All changesets with revision numbers between x and y, both
inclusive. Either endpoint can be left out, they default to 0 and
tip.</dd>
<dt><tt class="docutils literal">x and y</tt></dt>
<dd>The intersection of changesets in x and y. Short form is <tt class="docutils literal">x & y</tt>.</dd>
<dt><tt class="docutils literal">x or y</tt></dt>
<dd>The union of changesets in x and y. There are two alternative short
forms: <tt class="docutils literal">x | y</tt> and <tt class="docutils literal">x + y</tt>.</dd>
<dt><tt class="docutils literal">x - y</tt></dt>
<dd>Changesets in x but not in y.</dd>
</dl>
<p>The following predicates are supported:</p>
<!-- predicatesmarker -->
<p>Command line equivalents for <a class="reference external" href="hg.1.html#log"><tt class="docutils literal">hg log</tt></a>:</p>
<pre class="literal-block">
-f -> ::.
-d x -> date(x)
-k x -> keyword(x)
-m -> merge()
-u x -> user(x)
-b x -> branch(x)
-P x -> !::x
-l x -> limit(expr, x)
</pre>
<p>Some sample queries:</p>
<ul>
<li><p class="first">Changesets on the default branch:</p>
<pre class="literal-block">
hg log -r "branch(default)"
</pre>
</li>
<li><p class="first">Changesets on the default branch since tag 1.5 (excluding merges):</p>
<pre class="literal-block">
hg log -r "branch(default) and 1.5:: and not merge()"
</pre>
</li>
<li><p class="first">Open branch heads:</p>
<pre class="literal-block">
hg log -r "head() and not closed()"
</pre>
</li>
<li><p class="first">Changesets between tags 1.3 and 1.5 mentioning "bug" that affect
<tt class="docutils literal">hgext/*</tt>:</p>
<pre class="literal-block">
hg log -r "1.3::1.5 and keyword(bug) and file('hgext/*')"
</pre>
</li>
<li><p class="first">Changesets in committed May 2008, sorted by user:</p>
<pre class="literal-block">
hg log -r "sort(date('May 2008'), user)"
</pre>
</li>
<li><p class="first">Changesets mentioning "bug" or "issue" that are not in a tagged
release:</p>
<pre class="literal-block">
hg log -r "(keyword(bug) or keyword(issue)) and not ancestors(tagged())"
</pre>
</li>
</ul>
</div>
<div class="section" id="diff-formats">
<span id="diffs"></span><h1><a class="toc-backref" href="#contents">Diff Formats</a></h1>
<p>Mercurial's default format for showing changes between two versions of
a file is compatible with the unified format of GNU diff, which can be
used by GNU patch and many other standard tools.</p>
<p>While this standard format is often enough, it does not encode the
following information:</p>
<ul class="simple">
<li>executable status and other permission bits</li>
<li>copy or rename information</li>
<li>changes in binary files</li>
<li>creation or deletion of empty files</li>
</ul>
<p>Mercurial also supports the extended diff format from the git VCS
which addresses these limitations. The git diff format is not produced
by default because a few widespread tools still do not understand this
format.</p>
<p>This means that when generating diffs from a Mercurial repository
(e.g. with <a class="reference external" href="hg.1.html#export"><tt class="docutils literal">hg export</tt></a>), you should be careful about things like file
copies and renames or other things mentioned above, because when
applying a standard diff to a different repository, this extra
information is lost. Mercurial's internal operations (like push and
pull) are not affected by this, because they use an internal binary
format for communicating changes.</p>
<p>To make Mercurial produce the git extended diff format, use the --git
option available for many commands, or set 'git = True' in the [diff]
section of your configuration file. You do not need to set this option
when importing diffs in this format or using them in the mq extension.</p>
</div>
<div class="section" id="id1">
<span id="merge-tools"></span><h1><a class="toc-backref" href="#contents">Merge Tools</a></h1>
<p>To merge files Mercurial uses merge tools.</p>
<p>A merge tool combines two different versions of a file into a merged
file. Merge tools are given the two files and the greatest common
ancestor of the two file versions, so they can determine the changes
made on both branches.</p>
<p>Merge tools are used both for <a class="reference external" href="hg.1.html#resolve"><tt class="docutils literal">hg resolve</tt></a>, <a class="reference external" href="hg.1.html#merge"><tt class="docutils literal">hg merge</tt></a>, <a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update</tt></a>,
<a class="reference external" href="hg.1.html#backout"><tt class="docutils literal">hg backout</tt></a> and in several extensions.</p>
<p>Usually, the merge tool tries to automatically reconcile the files by
combining all non-overlapping changes that occurred separately in
the two different evolutions of the same initial base file. Furthermore, some
interactive merge programs make it easier to manually resolve
conflicting merges, either in a graphical way, or by inserting some
conflict markers. Mercurial does not include any interactive merge
programs but relies on external tools for that.</p>
<div class="section" id="available-merge-tools">
<h2>Available merge tools</h2>
<p>External merge tools and their properties are configured in the
merge-tools configuration section - see hgrc(5) - but they can often just
be named by their executable.</p>
<p>A merge tool is generally usable if its executable can be found on the
system and if it can handle the merge. The executable is found if it
is an absolute or relative executable path or the name of an
application in the executable search path. The tool is assumed to be
able to handle the merge if it can handle symlinks if the file is a
symlink, if it can handle binary files if the file is binary, and if a
GUI is available if the tool requires a GUI.</p>
<p>There are some internal merge tools which can be used. The internal
merge tools are:</p>
<dl class="docutils">
<dt><tt class="docutils literal">internal:merge</tt></dt>
<dd>Uses the internal non-interactive simple merge algorithm for merging
files. It will fail if there are any conflicts and leave markers in
the partially merged file.</dd>
<dt><tt class="docutils literal">internal:fail</tt></dt>
<dd>Rather than attempting to merge files that were modified on both
branches, it marks them as unresolved. The resolve command must be
used to resolve these conflicts.</dd>
<dt><tt class="docutils literal">internal:local</tt></dt>
<dd>Uses the local version of files as the merged version.</dd>
<dt><tt class="docutils literal">internal:other</tt></dt>
<dd>Uses the other version of files as the merged version.</dd>
<dt><tt class="docutils literal">internal:prompt</tt></dt>
<dd>Asks the user which of the local or the other version to keep as
the merged version.</dd>
<dt><tt class="docutils literal">internal:dump</tt></dt>
<dd>Creates three versions of the files to merge, containing the
contents of local, other and base. These files can then be used to
perform a merge manually. If the file to be merged is named
<tt class="docutils literal">a.txt</tt>, these files will accordingly be named <tt class="docutils literal">a.txt.local</tt>,
<tt class="docutils literal">a.txt.other</tt> and <tt class="docutils literal">a.txt.base</tt> and they will be placed in the
same directory as <tt class="docutils literal">a.txt</tt>.</dd>
</dl>
<p>Internal tools are always available and do not require a GUI but will by default
not handle symlinks or binary files.</p>
</div>
<div class="section" id="choosing-a-merge-tool">
<h2>Choosing a merge tool</h2>
<p>Mercurial uses these rules when deciding which merge tool to use:</p>
<ol class="arabic simple">
<li>If a tool has been specified with the --tool option to merge or resolve, it
is used. If it is the name of a tool in the merge-tools configuration, its
configuration is used. Otherwise the specified tool must be executable by
the shell.</li>
<li>If the <tt class="docutils literal">HGMERGE</tt> environment variable is present, its value is used and
must be executable by the shell.</li>
<li>If the filename of the file to be merged matches any of the patterns in the
merge-patterns configuration section, the first usable merge tool
corresponding to a matching pattern is used. Here, binary capabilities of the
merge tool are not considered.</li>
<li>If ui.merge is set it will be considered next. If the value is not the name
of a configured tool, the specified value is used and must be executable by
the shell. Otherwise the named tool is used if it is usable.</li>
<li>If any usable merge tools are present in the merge-tools configuration
section, the one with the highest priority is used.</li>
<li>If a program named <tt class="docutils literal">hgmerge</tt> can be found on the system, it is used - but
it will by default not be used for symlinks and binary files.</li>
<li>If the file to be merged is not binary and is not a symlink, then
<tt class="docutils literal">internal:merge</tt> is used.</li>
<li>The merge of the file fails and must be resolved before commit.</li>
</ol>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">After selecting a merge program, Mercurial will by default attempt
to merge the files using a simple merge algorithm first. Only if it doesn't
succeed because of conflicting changes Mercurial will actually execute the
merge program. Whether to use the simple merge algorithm first can be
controlled by the premerge setting of the merge tool. Premerge is enabled by
default unless the file is binary or a symlink.</p>
</div>
<p>See the merge-tools and ui sections of hgrc(5) for details on the
configuration of merge tools.</p>
</div>
</div>
<div class="section" id="template-usage">
<span id="templates"></span><span id="templating"></span><h1><a class="toc-backref" href="#contents">Template Usage</a></h1>
<p>Mercurial allows you to customize output of commands through
templates. You can either pass in a template from the command
line, via the --template option, or select an existing
template-style (--style).</p>
<p>You can customize output for any "log-like" command: log,
outgoing, incoming, tip, parents, heads and glog.</p>
<p>Four styles are packaged with Mercurial: default (the style used
when no explicit preference is passed), compact, changelog,
and xml.
Usage:</p>
<pre class="literal-block">
$ hg log -r1 --style changelog
</pre>
<p>A template is a piece of text, with markup to invoke variable
expansion:</p>
<pre class="literal-block">
$ hg log -r1 --template "{node}\n"
b56ce7b07c52de7d5fd79fb89701ea538af65746
</pre>
<p>Strings in curly braces are called keywords. The availability of
keywords depends on the exact context of the templater. These
keywords are usually available for templating a log-like command:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">author:</th><td class="field-body">String. The unmodified author of the changeset.</td>
</tr>
<tr class="field"><th class="field-name">branches:</th><td class="field-body">List of strings. The name of the branch on which the
changeset was committed. Will be empty if the branch name was
default.</td>
</tr>
<tr class="field"><th class="field-name">children:</th><td class="field-body">List of strings. The children of the changeset.</td>
</tr>
<tr class="field"><th class="field-name">date:</th><td class="field-body">Date information. The date when the changeset was committed.</td>
</tr>
<tr class="field"><th class="field-name">desc:</th><td class="field-body">String. The text of the changeset description.</td>
</tr>
<tr class="field"><th class="field-name">diffstat:</th><td class="field-body">String. Statistics of changes with the following format:
"modified files: +added/-removed lines"</td>
</tr>
<tr class="field"><th class="field-name">files:</th><td class="field-body">List of strings. All files modified, added, or removed by this
changeset.</td>
</tr>
<tr class="field"><th class="field-name">file_adds:</th><td class="field-body">List of strings. Files added by this changeset.</td>
</tr>
<tr class="field"><th class="field-name">file_copies:</th><td class="field-body">List of strings. Files copied in this changeset with
their sources.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">file_copies_switch:</th></tr>
<tr><td> </td><td class="field-body">List of strings. Like "file_copies" but displayed
only if the --copied switch is set.</td>
</tr>
<tr class="field"><th class="field-name">file_mods:</th><td class="field-body">List of strings. Files modified by this changeset.</td>
</tr>
<tr class="field"><th class="field-name">file_dels:</th><td class="field-body">List of strings. Files removed by this changeset.</td>
</tr>
<tr class="field"><th class="field-name">node:</th><td class="field-body">String. The changeset identification hash, as a 40 hexadecimal
digit string.</td>
</tr>
<tr class="field"><th class="field-name">parents:</th><td class="field-body">List of strings. The parents of the changeset.</td>
</tr>
<tr class="field"><th class="field-name">rev:</th><td class="field-body">Integer. The repository-local changeset revision number.</td>
</tr>
<tr class="field"><th class="field-name">tags:</th><td class="field-body">List of strings. Any tags associated with the changeset.</td>
</tr>
<tr class="field"><th class="field-name">latesttag:</th><td class="field-body">String. Most recent global tag in the ancestors of this
changeset.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">latesttagdistance:</th></tr>
<tr><td> </td><td class="field-body">Integer. Longest path to the latest tag.</td>
</tr>
</tbody>
</table>
<p>The "date" keyword does not produce human-readable output. If you
want to use a date in your output, you can use a filter to process
it. Filters are functions which return a string based on the input
variable. Be sure to use the stringify filter first when you're
applying a string-input filter to a list-like input variable.
You can also use a chain of filters to get the desired output:</p>
<pre class="literal-block">
$ hg tip --template "{date|isodate}\n"
2008-08-21 18:22 +0000
</pre>
<p>List of filters:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">addbreaks:</th><td class="field-body">Any text. Add an XHTML "<br />" tag before the end of
every line except the last.</td>
</tr>
<tr class="field"><th class="field-name">age:</th><td class="field-body">Date. Returns a human-readable date/time difference between the
given date/time and the current date/time.</td>
</tr>
<tr class="field"><th class="field-name">basename:</th><td class="field-body">Any text. Treats the text as a path, and returns the last
component of the path after splitting by the path separator
(ignoring trailing separators). For example, "foo/bar/baz" becomes
"baz" and "foo/bar//" becomes "bar".</td>
</tr>
<tr class="field"><th class="field-name">stripdir:</th><td class="field-body">Treat the text as path and strip a directory level, if
possible. For example, "foo" and "foo/bar" becomes "foo".</td>
</tr>
<tr class="field"><th class="field-name">date:</th><td class="field-body">Date. Returns a date in a Unix date format, including the
timezone: "Mon Sep 04 15:13:13 2006 0700".</td>
</tr>
<tr class="field"><th class="field-name">domain:</th><td class="field-body">Any text. Finds the first string that looks like an email
address, and extracts just the domain component. Example: <tt class="docutils literal">User
<user@example.com></tt> becomes <tt class="docutils literal">example.com</tt>.</td>
</tr>
<tr class="field"><th class="field-name">email:</th><td class="field-body">Any text. Extracts the first string that looks like an email
address. Example: <tt class="docutils literal">User <user@example.com></tt> becomes
<tt class="docutils literal">user@example.com</tt>.</td>
</tr>
<tr class="field"><th class="field-name">escape:</th><td class="field-body">Any text. Replaces the special XML/XHTML characters "&", "<"
and ">" with XML entities.</td>
</tr>
<tr class="field"><th class="field-name">hex:</th><td class="field-body">Any text. Convert a binary Mercurial node identifier into
its long hexadecimal representation.</td>
</tr>
<tr class="field"><th class="field-name">fill68:</th><td class="field-body">Any text. Wraps the text to fit in 68 columns.</td>
</tr>
<tr class="field"><th class="field-name">fill76:</th><td class="field-body">Any text. Wraps the text to fit in 76 columns.</td>
</tr>
<tr class="field"><th class="field-name">firstline:</th><td class="field-body">Any text. Returns the first line of text.</td>
</tr>
<tr class="field"><th class="field-name">nonempty:</th><td class="field-body">Any text. Returns '(none)' if the string is empty.</td>
</tr>
<tr class="field"><th class="field-name">hgdate:</th><td class="field-body">Date. Returns the date as a pair of numbers: "1157407993
25200" (Unix timestamp, timezone offset).</td>
</tr>
<tr class="field"><th class="field-name">isodate:</th><td class="field-body">Date. Returns the date in ISO 8601 format: "2009-08-18 13:00
+0200".</td>
</tr>
<tr class="field"><th class="field-name">isodatesec:</th><td class="field-body">Date. Returns the date in ISO 8601 format, including
seconds: "2009-08-18 13:00:13 +0200". See also the rfc3339date
filter.</td>
</tr>
<tr class="field"><th class="field-name">localdate:</th><td class="field-body">Date. Converts a date to local date.</td>
</tr>
<tr class="field"><th class="field-name">obfuscate:</th><td class="field-body">Any text. Returns the input text rendered as a sequence of
XML entities.</td>
</tr>
<tr class="field"><th class="field-name">person:</th><td class="field-body">Any text. Returns the text before an email address.</td>
</tr>
<tr class="field"><th class="field-name">rfc822date:</th><td class="field-body">Date. Returns a date using the same format used in email
headers: "Tue, 18 Aug 2009 13:00:13 +0200".</td>
</tr>
<tr class="field"><th class="field-name">rfc3339date:</th><td class="field-body">Date. Returns a date using the Internet date format
specified in RFC 3339: "2009-08-18T13:00:13+02:00".</td>
</tr>
<tr class="field"><th class="field-name">short:</th><td class="field-body">Changeset hash. Returns the short form of a changeset hash,
i.e. a 12 hexadecimal digit string.</td>
</tr>
<tr class="field"><th class="field-name">shortdate:</th><td class="field-body">Date. Returns a date like "2006-09-18".</td>
</tr>
<tr class="field"><th class="field-name">stringify:</th><td class="field-body">Any type. Turns the value into text by converting values into
text and concatenating them.</td>
</tr>
<tr class="field"><th class="field-name">strip:</th><td class="field-body">Any text. Strips all leading and trailing whitespace.</td>
</tr>
<tr class="field"><th class="field-name">tabindent:</th><td class="field-body">Any text. Returns the text, with every line except the
first starting with a tab character.</td>
</tr>
<tr class="field"><th class="field-name">urlescape:</th><td class="field-body">Any text. Escapes all "special" characters. For example,
"foo bar" becomes "foo%20bar".</td>
</tr>
<tr class="field"><th class="field-name">user:</th><td class="field-body">Any text. Returns the user portion of an email address.</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="url-paths">
<span id="urls"></span><h1><a class="toc-backref" href="#contents">URL Paths</a></h1>
<p>Valid URLs are of the form:</p>
<pre class="literal-block">
local/filesystem/path[#revision]
file://local/filesystem/path[#revision]
http://[user[:pass]@]host[:port]/[path][#revision]
https://[user[:pass]@]host[:port]/[path][#revision]
ssh://[user[:pass]@]host[:port]/[path][#revision]
</pre>
<p>Paths in the local filesystem can either point to Mercurial
repositories or to bundle files (as created by <a class="reference external" href="hg.1.html#bundle"><tt class="docutils literal">hg bundle</tt></a> or :hg:`
incoming --bundle`). See also <a class="reference external" href="hg.1.html#paths"><tt class="docutils literal">hg help paths</tt></a>.</p>
<p>An optional identifier after # indicates a particular branch, tag, or
changeset to use from the remote repository. See also <a class="reference external" href="hg.1.html#revisions"><tt class="docutils literal">hg help
revisions</tt></a>.</p>
<p>Some features, such as pushing to <a class="reference external" href="http://">http://</a> and <a class="reference external" href="https://">https://</a> URLs are only
possible if the feature is explicitly enabled on the remote Mercurial
server.</p>
<p>Note that the security of HTTPS URLs depends on proper configuration of
web.cacerts.</p>
<p>Some notes about using SSH with Mercurial:</p>
<ul>
<li><p class="first">SSH requires an accessible shell account on the destination machine
and a copy of hg in the remote path or specified with as remotecmd.</p>
</li>
<li><p class="first">path is relative to the remote user's home directory by default. Use
an extra slash at the start of a path to specify an absolute path:</p>
<pre class="literal-block">
ssh://example.com//tmp/repository
</pre>
</li>
<li><p class="first">Mercurial doesn't use its own compression via SSH; the right thing
to do is to configure it in your ~/.ssh/config, e.g.:</p>
<pre class="literal-block">
Host *.mylocalnetwork.example.com
Compression no
Host *
Compression yes
</pre>
<p>Alternatively specify "ssh -C" as your ssh command in your
configuration file or with the --ssh command line option.</p>
</li>
</ul>
<p>These URLs can all be stored in your configuration file with path
aliases under the [paths] section like so:</p>
<pre class="literal-block">
[paths]
alias1 = URL1
alias2 = URL2
...
</pre>
<p>You can then use the alias for any command that uses a URL (for
example <a class="reference external" href="hg.1.html#pull"><tt class="docutils literal">hg pull alias1</tt></a> will be treated as <a class="reference external" href="hg.1.html#pull"><tt class="docutils literal">hg pull URL1</tt></a>).</p>
<p>Two path aliases are special because they are used as defaults when
you do not provide the URL to a command:</p>
<dl class="docutils">
<dt>default:</dt>
<dd>When you create a repository with hg clone, the clone command saves
the location of the source repository as the new repository's
'default' path. This is then used when you omit path from push- and
pull-like commands (including incoming and outgoing).</dd>
<dt>default-push:</dt>
<dd>The push command will look for a path named 'default-push', and
prefer it over 'default' if both are defined.</dd>
</dl>
</div>
<div class="section" id="using-additional-features">
<span id="extensions"></span><h1><a class="toc-backref" href="#contents">Using additional features</a></h1>
<p>Mercurial has the ability to add new features through the use of
extensions. Extensions may add new commands, add options to
existing commands, change the default behavior of commands, or
implement hooks.</p>
<p>Extensions are not loaded by default for a variety of reasons:
they can increase startup overhead; they may be meant for advanced
usage only; they may provide potentially dangerous abilities (such
as letting you destroy or modify history); they might not be ready
for prime time; or they may alter some usual behaviors of stock
Mercurial. It is thus up to the user to activate extensions as
needed.</p>
<p>To enable the "foo" extension, either shipped with Mercurial or in the
Python search path, create an entry for it in your configuration file,
like this:</p>
<pre class="literal-block">
[extensions]
foo =
</pre>
<p>You may also specify the full path to an extension:</p>
<pre class="literal-block">
[extensions]
myfeature = ~/.hgext/myfeature.py
</pre>
<p>To explicitly disable an extension enabled in a configuration file of
broader scope, prepend its path with !:</p>
<pre class="literal-block">
[extensions]
# disabling extension bar residing in /path/to/extension/bar.py
bar = !/path/to/extension/bar.py
# ditto, but no path was supplied for extension baz
baz = !
</pre>
<p>disabled extensions:</p>
<blockquote>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">acl:</th><td class="field-body">hooks for controlling repository access</td>
</tr>
<tr class="field"><th class="field-name">bookmarks:</th><td class="field-body">track a line of development with movable markers</td>
</tr>
<tr class="field"><th class="field-name">bugzilla:</th><td class="field-body">hooks for integrating with the Bugzilla bug tracker</td>
</tr>
<tr class="field"><th class="field-name">children:</th><td class="field-body">command to display child changesets</td>
</tr>
<tr class="field"><th class="field-name">churn:</th><td class="field-body">command to display statistics about repository history</td>
</tr>
<tr class="field"><th class="field-name">color:</th><td class="field-body">colorize output from some commands</td>
</tr>
<tr class="field"><th class="field-name">convert:</th><td class="field-body">import revisions from foreign VCS repositories into Mercurial</td>
</tr>
<tr class="field"><th class="field-name">eol:</th><td class="field-body">automatically manage newlines in repository files</td>
</tr>
<tr class="field"><th class="field-name">extdiff:</th><td class="field-body">command to allow external programs to compare revisions</td>
</tr>
<tr class="field"><th class="field-name">fetch:</th><td class="field-body">pull, update and merge in one command</td>
</tr>
<tr class="field"><th class="field-name">gpg:</th><td class="field-body">commands to sign and verify changesets</td>
</tr>
<tr class="field"><th class="field-name">graphlog:</th><td class="field-body">command to view revision graphs from a shell</td>
</tr>
<tr class="field"><th class="field-name">hgcia:</th><td class="field-body">hooks for integrating with the CIA.vc notification service</td>
</tr>
<tr class="field"><th class="field-name">hgk:</th><td class="field-body">browse the repository in a graphical way</td>
</tr>
<tr class="field"><th class="field-name">highlight:</th><td class="field-body">syntax highlighting for hgweb (requires Pygments)</td>
</tr>
<tr class="field"><th class="field-name">inotify:</th><td class="field-body">accelerate status report using Linux's inotify service</td>
</tr>
<tr class="field"><th class="field-name">interhg:</th><td class="field-body">expand expressions into changelog and summaries</td>
</tr>
<tr class="field"><th class="field-name">keyword:</th><td class="field-body">expand keywords in tracked files</td>
</tr>
<tr class="field"><th class="field-name">mq:</th><td class="field-body">manage a stack of patches</td>
</tr>
<tr class="field"><th class="field-name">notify:</th><td class="field-body">hooks for sending email notifications at commit/push time</td>
</tr>
<tr class="field"><th class="field-name">pager:</th><td class="field-body">browse command output with an external pager</td>
</tr>
<tr class="field"><th class="field-name">parentrevspec:</th><td class="field-body">interpret suffixes to refer to ancestor revisions</td>
</tr>
<tr class="field"><th class="field-name">patchbomb:</th><td class="field-body">command to send changesets as (a series of) patch emails</td>
</tr>
<tr class="field"><th class="field-name">progress:</th><td class="field-body">show progress bars for some actions</td>
</tr>
<tr class="field"><th class="field-name">purge:</th><td class="field-body">command to delete untracked files from the working directory</td>
</tr>
<tr class="field"><th class="field-name">rebase:</th><td class="field-body">command to move sets of revisions to a different ancestor</td>
</tr>
<tr class="field"><th class="field-name">record:</th><td class="field-body">commands to interactively select changes for commit/qrefresh</td>
</tr>
<tr class="field"><th class="field-name">relink:</th><td class="field-body">recreates hardlinks between repository clones</td>
</tr>
<tr class="field"><th class="field-name">schemes:</th><td class="field-body">extend schemes with shortcuts to repository swarms</td>
</tr>
<tr class="field"><th class="field-name">share:</th><td class="field-body">share a common history between several working directories</td>
</tr>
<tr class="field"><th class="field-name">transplant:</th><td class="field-body">command to transplant changesets from another branch</td>
</tr>
<tr class="field"><th class="field-name">win32mbcs:</th><td class="field-body">allow the use of MBCS paths with problematic encodings</td>
</tr>
<tr class="field"><th class="field-name">win32text:</th><td class="field-body">perform automatic newline conversion</td>
</tr>
<tr class="field"><th class="field-name">zeroconf:</th><td class="field-body">discover and advertise repositories on the local network</td>
</tr>
</tbody>
</table>
</blockquote>
</div>
<div class="section" id="subrepositories">
<span id="subrepos"></span><span id="subrepo"></span><h1><a class="toc-backref" href="#contents">Subrepositories</a></h1>
<p>Subrepositories let you nest external repositories or projects into a
parent Mercurial repository, and make commands operate on them as a
group. External Mercurial and Subversion projects are currently
supported.</p>
<p>Subrepositories are made of three components:</p>
<ol class="arabic">
<li><p class="first">Nested repository checkouts. They can appear anywhere in the
parent working directory, and are Mercurial clones or Subversion
checkouts.</p>
</li>
<li><p class="first">Nested repository references. They are defined in <tt class="docutils literal">.hgsub</tt> and
tell where the subrepository checkouts come from. Mercurial
subrepositories are referenced like:</p>
<blockquote>
<p>path/to/nested = <a class="reference external" href="https://example.com/nested/repo/path">https://example.com/nested/repo/path</a></p>
</blockquote>
<p>where <tt class="docutils literal">path/to/nested</tt> is the checkout location relatively to the
parent Mercurial root, and <tt class="docutils literal"><span class="pre">https://example.com/nested/repo/path</span></tt>
is the source repository path. The source can also reference a
filesystem path. Subversion repositories are defined with:</p>
<blockquote>
<p>path/to/nested = [svn]https://example.com/nested/trunk/path</p>
</blockquote>
<p>Note that <tt class="docutils literal">.hgsub</tt> does not exist by default in Mercurial
repositories, you have to create and add it to the parent
repository before using subrepositories.</p>
</li>
<li><p class="first">Nested repository states. They are defined in <tt class="docutils literal">.hgsubstate</tt> and
capture whatever information is required to restore the
subrepositories to the state they were committed in a parent
repository changeset. Mercurial automatically record the nested
repositories states when committing in the parent repository.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">The <tt class="docutils literal">.hgsubstate</tt> file should not be edited manually.</p>
</div>
</li>
</ol>
</div>
<div class="section" id="adding-a-subrepository">
<h1><a class="toc-backref" href="#contents">Adding a Subrepository</a></h1>
<p>If <tt class="docutils literal">.hgsub</tt> does not exist, create it and add it to the parent
repository. Clone or checkout the external projects where you want it
to live in the parent repository. Edit <tt class="docutils literal">.hgsub</tt> and add the
subrepository entry as described above. At this point, the
subrepository is tracked and the next commit will record its state in
<tt class="docutils literal">.hgsubstate</tt> and bind it to the committed changeset.</p>
</div>
<div class="section" id="synchronizing-a-subrepository">
<h1><a class="toc-backref" href="#contents">Synchronizing a Subrepository</a></h1>
<p>Subrepos do not automatically track the latest changeset of their
sources. Instead, they are updated to the changeset that corresponds
with the changeset checked out in the top-level changeset. This is so
developers always get a consistent set of compatible code and
libraries when they update.</p>
<p>Thus, updating subrepos is a manual process. Simply check out target
subrepo at the desired revision, test in the top-level repo, then
commit in the parent repository to record the new combination.</p>
</div>
<div class="section" id="deleting-a-subrepository">
<h1><a class="toc-backref" href="#contents">Deleting a Subrepository</a></h1>
<p>To remove a subrepository from the parent repository, delete its
reference from <tt class="docutils literal">.hgsub</tt>, then remove its files.</p>
</div>
<div class="section" id="interaction-with-mercurial-commands">
<h1><a class="toc-backref" href="#contents">Interaction with Mercurial Commands</a></h1>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">add:</th><td class="field-body">add does not recurse in subrepos unless -S/--subrepos is
specified. Subversion subrepositories are currently silently
ignored.</td>
</tr>
<tr class="field"><th class="field-name">archive:</th><td class="field-body">archive does not recurse in subrepositories unless
-S/--subrepos is specified.</td>
</tr>
<tr class="field"><th class="field-name">commit:</th><td class="field-body">commit creates a consistent snapshot of the state of the
entire project and its subrepositories. It does this by first
attempting to commit all modified subrepositories, then recording
their state and finally committing it in the parent repository.</td>
</tr>
<tr class="field"><th class="field-name">diff:</th><td class="field-body">diff does not recurse in subrepos unless -S/--subrepos is
specified. Changes are displayed as usual, on the subrepositories
elements. Subversion subrepositories are currently silently
ignored.</td>
</tr>
<tr class="field"><th class="field-name">incoming:</th><td class="field-body">incoming does not recurse in subrepos unless -S/--subrepos
is specified. Subversion subrepositories are currently silently
ignored.</td>
</tr>
<tr class="field"><th class="field-name">outgoing:</th><td class="field-body">outgoing does not recurse in subrepos unless -S/--subrepos
is specified. Subversion subrepositories are currently silently
ignored.</td>
</tr>
<tr class="field"><th class="field-name">pull:</th><td class="field-body">pull is not recursive since it is not clear what to pull prior
to running <a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update</tt></a>. Listing and retrieving all
subrepositories changes referenced by the parent repository pulled
changesets is expensive at best, impossible in the Subversion
case.</td>
</tr>
<tr class="field"><th class="field-name">push:</th><td class="field-body">Mercurial will automatically push all subrepositories first
when the parent repository is being pushed. This ensures new
subrepository changes are available when referenced by top-level
repositories.</td>
</tr>
<tr class="field"><th class="field-name">status:</th><td class="field-body">status does not recurse into subrepositories unless
-S/--subrepos is specified. Subrepository changes are displayed as
regular Mercurial changes on the subrepository
elements. Subversion subrepositories are currently silently
ignored.</td>
</tr>
<tr class="field"><th class="field-name">update:</th><td class="field-body">update restores the subrepos in the state they were
originally committed in target changeset. If the recorded
changeset is not available in the current subrepository, Mercurial
will pull it in first before updating. This means that updating
can require network access when using subrepositories.</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="remapping-subrepositories-sources">
<h1><a class="toc-backref" href="#contents">Remapping Subrepositories Sources</a></h1>
<p>A subrepository source location may change during a project life,
invalidating references stored in the parent repository history. To
fix this, rewriting rules can be defined in parent repository <tt class="docutils literal">hgrc</tt>
file or in Mercurial configuration. See the <tt class="docutils literal">[subpaths]</tt> section in
hgrc(5) for more details.</p>
</div>
<div class="section" id="configuring-hgweb">
<span id="hgweb"></span><h1><a class="toc-backref" href="#contents">Configuring hgweb</a></h1>
<p>Mercurial's internal web server, hgweb, can serve either a single
repository, or a collection of them. In the latter case, a special
configuration file can be used to specify the repository paths to use
and global web configuration options.</p>
<p>This file uses the same syntax as hgrc configuration files, but only
the following sections are recognized:</p>
<blockquote>
<ul class="simple">
<li>web</li>
<li>paths</li>
<li>collections</li>
</ul>
</blockquote>
<p>The <tt class="docutils literal">web</tt> section can specify all the settings described in the web
section of the hgrc documentation.</p>
<p>The <tt class="docutils literal">paths</tt> section provides mappings of physical repository
paths to virtual ones. For instance:</p>
<pre class="literal-block">
[paths]
projects/a = /foo/bar
projects/b = /baz/quux
web/root = /real/root/*
/ = /real/root2/*
virtual/root2 = /real/root2/**
</pre>
<ul class="simple">
<li>The first two entries make two repositories in different directories
appear under the same directory in the web interface</li>
<li>The third entry maps every Mercurial repository found in '/real/root'
into 'web/root'. This format is preferred over the [collections] one,
since using absolute paths as configuration keys is not supported on every
platform (especially on Windows).</li>
<li>The fourth entry is a special case mapping all repositories in
'/real/root2' in the root of the virtual directory.</li>
<li>The fifth entry recursively finds all repositories under the real
root, and maps their relative paths under the virtual root.</li>
</ul>
<p>The <tt class="docutils literal">collections</tt> section provides mappings of trees of physical
repositories paths to virtual ones, though the paths syntax is generally
preferred. For instance:</p>
<pre class="literal-block">
[collections]
/foo = /foo
</pre>
<p>Here, the left side will be stripped off all repositories found in the
right side. Thus <tt class="docutils literal">/foo/bar</tt> and <tt class="docutils literal">foo/quux/baz</tt> will be listed as
<tt class="docutils literal">bar</tt> and <tt class="docutils literal">quux/baz</tt> respectively.</p>
</div>
<div class="section" id="id2">
<span id="glossary"></span><h1><a class="toc-backref" href="#contents">Glossary</a></h1>
<dl class="docutils">
<dt>Ancestor</dt>
<dd>Any changeset that can be reached by an unbroken chain of parent
changesets from a given changeset. More precisely, the ancestors
of a changeset can be defined by two properties: a parent of a
changeset is an ancestor, and a parent of an ancestor is an
ancestor. See also: 'Descendant'.</dd>
<dt>Branch</dt>
<dd><p class="first">(Noun) A child changeset that has been created from a parent that
is not a head. These are known as topological branches, see
'Branch, topological'. If a topological branch is named, it becomes
a named branch. If a topological branch is not named, it becomes
an anonymous branch. See 'Branch, anonymous' and 'Branch, named'.</p>
<p>Branches may be created when changes are pulled from or pushed to
a remote repository, since new heads may be created by these
operations. Note that the term branch can also be used informally
to describe a development process in which certain development is
done independently of other development. This is sometimes done
explicitly with a named branch, but it can also be done locally,
using bookmarks or clones and anonymous branches.</p>
<p>Example: "The experimental branch".</p>
<p>(Verb) The action of creating a child changeset which results in
its parent having more than one child.</p>
<p class="last">Example: "I'm going to branch at X".</p>
</dd>
<dt>Branch, anonymous</dt>
<dd>Every time a new child changeset is created from a parent that is not
a head and the name of the branch is not changed, a new anonymous
branch is created.</dd>
<dt>Branch, closed</dt>
<dd>A named branch whose branch heads have all been closed.</dd>
<dt>Branch, default</dt>
<dd>The branch assigned to a changeset when no name has previously been
assigned.</dd>
<dt>Branch head</dt>
<dd>See 'Head, branch'.</dd>
<dt>Branch, inactive</dt>
<dd><p class="first">If a named branch has no topological heads, it is considered to be
inactive. As an example, a feature branch becomes inactive when it
is merged into the default branch. The <a class="reference external" href="hg.1.html#branches"><tt class="docutils literal">hg branches</tt></a> command
shows inactive branches by default, though they can be hidden with
<a class="reference external" href="hg.1.html#branches"><tt class="docutils literal">hg branches <span class="pre">--active</span></tt></a>.</p>
<p class="last">NOTE: this concept is deprecated because it is too implicit.
Branches should now be explicitly closed using <a class="reference external" href="hg.1.html#commit"><tt class="docutils literal">hg commit
<span class="pre">--close-branch</span></tt></a> when they are no longer needed.</p>
</dd>
<dt>Branch, named</dt>
<dd><p class="first">A collection of changesets which have the same branch name. By
default, children of a changeset in a named branch belong to the
same named branch. A child can be explicitly assigned to a
different branch. See <a class="reference external" href="hg.1.html#branch"><tt class="docutils literal">hg help branch</tt></a>, <a class="reference external" href="hg.1.html#branches"><tt class="docutils literal">hg help branches</tt></a> and
<a class="reference external" href="hg.1.html#commit"><tt class="docutils literal">hg commit <span class="pre">--close-branch</span></tt></a> for more information on managing
branches.</p>
<p class="last">Named branches can be thought of as a kind of namespace, dividing
the collection of changesets that comprise the repository into a
collection of disjoint subsets. A named branch is not necessarily
a topological branch. If a new named branch is created from the
head of another named branch, or the default branch, but no
further changesets are added to that previous branch, then that
previous branch will be a branch in name only.</p>
</dd>
<dt>Branch tip</dt>
<dd>See 'Tip, branch'.</dd>
<dt>Branch, topological</dt>
<dd>Every time a new child changeset is created from a parent that is
not a head, a new topological branch is created. If a topological
branch is named, it becomes a named branch. If a topological
branch is not named, it becomes an anonymous branch of the
current, possibly default, branch.</dd>
<dt>Changelog</dt>
<dd>A record of the changesets in the order in which they were added
to the repository. This includes details such as changeset id,
author, commit message, date, and list of changed files.</dd>
<dt>Changeset</dt>
<dd>A snapshot of the state of the repository used to record a change.</dd>
<dt>Changeset, child</dt>
<dd>The converse of parent changeset: if P is a parent of C, then C is
a child of P. There is no limit to the number of children that a
changeset may have.</dd>
<dt>Changeset id</dt>
<dd>A SHA-1 hash that uniquely identifies a changeset. It may be
represented as either a "long" 40 hexadecimal digit string, or a
"short" 12 hexadecimal digit string.</dd>
<dt>Changeset, merge</dt>
<dd>A changeset with two parents. This occurs when a merge is
committed.</dd>
<dt>Changeset, parent</dt>
<dd>A revision upon which a child changeset is based. Specifically, a
parent changeset of a changeset C is a changeset whose node
immediately precedes C in the DAG. Changesets have at most two
parents.</dd>
<dt>Checkout</dt>
<dd><p class="first">(Noun) The working directory being updated to a specific
revision. This use should probably be avoided where possible, as
changeset is much more appropriate than checkout in this context.</p>
<p>Example: "I'm using checkout X."</p>
<p>(Verb) Updating the working directory to a specific changeset. See
<a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg help update</tt></a>.</p>
<p class="last">Example: "I'm going to check out changeset X."</p>
</dd>
<dt>Child changeset</dt>
<dd>See 'Changeset, child'.</dd>
<dt>Close changeset</dt>
<dd>See 'Changeset, close'.</dd>
<dt>Closed branch</dt>
<dd>See 'Branch, closed'.</dd>
<dt>Clone</dt>
<dd><p class="first">(Noun) An entire or partial copy of a repository. The partial
clone must be in the form of a revision and its ancestors.</p>
<p>Example: "Is your clone up to date?".</p>
<p>(Verb) The process of creating a clone, using <a class="reference external" href="hg.1.html#clone"><tt class="docutils literal">hg clone</tt></a>.</p>
<p class="last">Example: "I'm going to clone the repository".</p>
</dd>
<dt>Closed branch head</dt>
<dd>See 'Head, closed branch'.</dd>
<dt>Commit</dt>
<dd><p class="first">(Noun) A synonym for changeset.</p>
<p>Example: "Is the bug fixed in your recent commit?"</p>
<p>(Verb) The act of recording changes to a repository. When files
are committed in a working directory, Mercurial finds the
differences between the committed files and their parent
changeset, creating a new changeset in the repository.</p>
<p class="last">Example: "You should commit those changes now."</p>
</dd>
<dt>Cset</dt>
<dd>A common abbreviation of the term changeset.</dd>
<dt>DAG</dt>
<dd>The repository of changesets of a distributed version control
system (DVCS) can be described as a directed acyclic graph (DAG),
consisting of nodes and edges, where nodes correspond to
changesets and edges imply a parent -> child relation. This graph
can be visualized by graphical tools such as <a class="reference external" href="hg.1.html#glog"><tt class="docutils literal">hg glog</tt></a>
(graphlog). In Mercurial, the DAG is limited by the requirement
for children to have at most two parents.</dd>
<dt>Default branch</dt>
<dd>See 'Branch, default'.</dd>
<dt>Descendant</dt>
<dd>Any changeset that can be reached by a chain of child changesets
from a given changeset. More precisely, the descendants of a
changeset can be defined by two properties: the child of a
changeset is a descendant, and the child of a descendant is a
descendant. See also: 'Ancestor'.</dd>
<dt>Diff</dt>
<dd><p class="first">(Noun) The difference between the contents and attributes of files
in two changesets or a changeset and the current working
directory. The difference is usually represented in a standard
form called a "diff" or "patch". The "git diff" format is used
when the changes include copies, renames, or changes to file
attributes, none of which can be represented/handled by classic
"diff" and "patch".</p>
<p>Example: "Did you see my correction in the diff?"</p>
<p>(Verb) Diffing two changesets is the action of creating a diff or
patch.</p>
<p class="last">Example: "If you diff with changeset X, you will see what I mean."</p>
</dd>
<dt>Directory, working</dt>
<dd>The working directory represents the state of the files tracked by
Mercurial, that will be recorded in the next commit. The working
directory initially corresponds to the snapshot at an existing
changeset, known as the parent of the working directory. See
'Parent, working directory'. The state may be modified by changes
to the files introduced manually or by a merge. The repository
metadata exists in the .hg directory inside the working directory.</dd>
<dt>Graph</dt>
<dd>See DAG and <a class="reference external" href="hg.1.html#graphlog"><tt class="docutils literal">hg help graphlog</tt></a>.</dd>
<dt>Head</dt>
<dd><p class="first">The term 'head' may be used to refer to both a branch head or a
repository head, depending on the context. See 'Head, branch' and
'Head, repository' for specific definitions.</p>
<p class="last">Heads are where development generally takes place and are the
usual targets for update and merge operations.</p>
</dd>
<dt>Head, branch</dt>
<dd>A changeset with no descendants on the same named branch.</dd>
<dt>Head, closed branch</dt>
<dd>A changeset that marks a head as no longer interesting. The closed
head is no longer listed by <a class="reference external" href="hg.1.html#heads"><tt class="docutils literal">hg heads</tt></a>. A branch is considered
closed when all its heads are closed and consequently is not
listed by <a class="reference external" href="hg.1.html#branches"><tt class="docutils literal">hg branches</tt></a>.</dd>
<dt>Head, repository</dt>
<dd>A topological head which has not been closed.</dd>
<dt>Head, topological</dt>
<dd>A changeset with no children in the repository.</dd>
<dt>History, immutable</dt>
<dd>Once committed, changesets cannot be altered. Extensions which
appear to change history actually create new changesets that
replace existing ones, and then destroy the old changesets. Doing
so in public repositories can result in old changesets being
reintroduced to the repository.</dd>
<dt>History, rewriting</dt>
<dd>The changesets in a repository are immutable. However, extensions
to Mercurial can be used to alter the repository, usually in such
a way as to preserve changeset contents.</dd>
<dt>Immutable history</dt>
<dd>See 'History, immutable'.</dd>
<dt>Merge changeset</dt>
<dd>See 'Changeset, merge'.</dd>
<dt>Manifest</dt>
<dd>Each changeset has a manifest, which is the list of files that are
tracked by the changeset.</dd>
<dt>Merge</dt>
<dd>Used to bring together divergent branches of work. When you update
to a changeset and then merge another changeset, you bring the
history of the latter changeset into your working directory. Once
conflicts are resolved (and marked), this merge may be committed
as a merge changeset, bringing two branches together in the DAG.</dd>
<dt>Named branch</dt>
<dd>See 'Branch, named'.</dd>
<dt>Null changeset</dt>
<dd>The empty changeset. It is the parent state of newly-initialized
repositories and repositories with no checked out revision. It is
thus the parent of root changesets and the effective ancestor when
merging unrelated changesets. Can be specified by the alias 'null'
or by the changeset ID '000000000000'.</dd>
<dt>Parent</dt>
<dd>See 'Changeset, parent'.</dd>
<dt>Parent changeset</dt>
<dd>See 'Changeset, parent'.</dd>
<dt>Parent, working directory</dt>
<dd>The working directory parent reflects a virtual revision which is
the child of the changeset (or two changesets with an uncommitted
merge) shown by <a class="reference external" href="hg.1.html#parents"><tt class="docutils literal">hg parents</tt></a>. This is changed with
<a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update</tt></a>. Other commands to see the working directory parent
are <a class="reference external" href="hg.1.html#summary"><tt class="docutils literal">hg summary</tt></a> and <a class="reference external" href="hg.1.html#id"><tt class="docutils literal">hg id</tt></a>. Can be specified by the alias ".".</dd>
<dt>Patch</dt>
<dd><p class="first">(Noun) The product of a diff operation.</p>
<p>Example: "I've sent you my patch."</p>
<p>(Verb) The process of using a patch file to transform one
changeset into another.</p>
<p class="last">Example: "You will need to patch that revision."</p>
</dd>
<dt>Pull</dt>
<dd>An operation in which changesets in a remote repository which are
not in the local repository are brought into the local
repository. Note that this operation without special arguments
only updates the repository, it does not update the files in the
working directory. See <a class="reference external" href="hg.1.html#pull"><tt class="docutils literal">hg help pull</tt></a>.</dd>
<dt>Push</dt>
<dd>An operation in which changesets in a local repository which are
not in a remote repository are sent to the remote repository. Note
that this operation only adds changesets which have been committed
locally to the remote repository. Uncommitted changes are not
sent. See <a class="reference external" href="hg.1.html#push"><tt class="docutils literal">hg help push</tt></a>.</dd>
<dt>Repository</dt>
<dd>The metadata describing all recorded states of a collection of
files. Each recorded state is represented by a changeset. A
repository is usually (but not always) found in the <tt class="docutils literal">.hg</tt>
subdirectory of a working directory. Any recorded state can be
recreated by "updating" a working directory to a specific
changeset.</dd>
<dt>Repository head</dt>
<dd>See 'Head, repository'.</dd>
<dt>Revision</dt>
<dd>A state of the repository at some point in time. Earlier revisions
can be updated to by using <a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update</tt></a>. See also 'Revision
number'; See also 'Changeset'.</dd>
<dt>Revision number</dt>
<dd>This integer uniquely identifies a changeset in a specific
repository. It represents the order in which changesets were added
to a repository, starting with revision number 0. Note that the
revision number may be different in each clone of a repository. To
identify changesets uniquely between different clones, see
'Changeset id'.</dd>
<dt>Revlog</dt>
<dd>History storage mechanism used by Mercurial. It is a form of delta
encoding, with occasional full revision of data followed by delta
of each successive revision. It includes data and an index
pointing to the data.</dd>
<dt>Rewriting history</dt>
<dd>See 'History, rewriting'.</dd>
<dt>Root</dt>
<dd>A changeset that has only the null changeset as its parent. Most
repositories have only a single root changeset.</dd>
<dt>Tip</dt>
<dd>The changeset with the highest revision number. It is the changeset
most recently added in a repository.</dd>
<dt>Tip, branch</dt>
<dd>The head of a given branch with the highest revision number. When
a branch name is used as a revision identifier, it refers to the
branch tip. See also 'Branch, head'. Note that because revision
numbers may be different in different repository clones, the
branch tip may be different in different cloned repositories.</dd>
<dt>Update</dt>
<dd><p class="first">(Noun) Another synonym of changeset.</p>
<p>Example: "I've pushed an update".</p>
<p>(Verb) This term is usually used to describe updating the state of
the working directory to that of a specific changeset. See
<a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg help update</tt></a>.</p>
<p class="last">Example: "You should update".</p>
</dd>
<dt>Working directory</dt>
<dd>See 'Directory, working'.</dd>
<dt>Working directory parent</dt>
<dd>See 'Parent, working directory'.</dd>
</dl>
</div>
<div class="section" id="id3">
<h1><a class="toc-backref" href="#contents">Extensions</a></h1>
<p>This section contains help for extensions that are distributed together with Mercurial. Help for other extensions is available in the help system.</p>
<div class="contents htmlonly local topic" id="id4">
<ul class="simple">
<li><a class="reference internal" href="#acl" id="id68">acl</a></li>
<li><a class="reference internal" href="#bookmarks" id="id69">bookmarks</a></li>
<li><a class="reference internal" href="#bugzilla" id="id70">bugzilla</a></li>
<li><a class="reference internal" href="#children" id="id71">children</a></li>
<li><a class="reference internal" href="#churn" id="id72">churn</a></li>
<li><a class="reference internal" href="#color" id="id73">color</a></li>
<li><a class="reference internal" href="#convert" id="id74">convert</a></li>
<li><a class="reference internal" href="#eol" id="id75">eol</a></li>
<li><a class="reference internal" href="#extdiff" id="id76">extdiff</a></li>
<li><a class="reference internal" href="#fetch" id="id77">fetch</a></li>
<li><a class="reference internal" href="#gpg" id="id78">gpg</a></li>
<li><a class="reference internal" href="#graphlog" id="id79">graphlog</a></li>
<li><a class="reference internal" href="#hgcia" id="id80">hgcia</a></li>
<li><a class="reference internal" href="#hgk" id="id81">hgk</a></li>
<li><a class="reference internal" href="#highlight" id="id82">highlight</a></li>
<li><a class="reference internal" href="#inotify" id="id83">inotify</a></li>
<li><a class="reference internal" href="#interhg" id="id84">interhg</a></li>
<li><a class="reference internal" href="#keyword" id="id85">keyword</a></li>
<li><a class="reference internal" href="#mq" id="id86">mq</a></li>
<li><a class="reference internal" href="#notify" id="id87">notify</a></li>
<li><a class="reference internal" href="#pager" id="id88">pager</a></li>
<li><a class="reference internal" href="#parentrevspec" id="id89">parentrevspec</a></li>
<li><a class="reference internal" href="#patchbomb" id="id90">patchbomb</a></li>
<li><a class="reference internal" href="#progress" id="id91">progress</a></li>
<li><a class="reference internal" href="#purge" id="id92">purge</a></li>
<li><a class="reference internal" href="#rebase" id="id93">rebase</a></li>
<li><a class="reference internal" href="#record" id="id94">record</a></li>
<li><a class="reference internal" href="#relink" id="id95">relink</a></li>
<li><a class="reference internal" href="#schemes" id="id96">schemes</a></li>
<li><a class="reference internal" href="#share" id="id97">share</a></li>
<li><a class="reference internal" href="#transplant" id="id98">transplant</a></li>
<li><a class="reference internal" href="#win32mbcs" id="id99">win32mbcs</a></li>
<li><a class="reference internal" href="#win32text" id="id100">win32text</a></li>
<li><a class="reference internal" href="#zeroconf" id="id101">zeroconf</a></li>
</ul>
</div>
<div class="section" id="acl">
<h2><a class="toc-backref" href="#id68">acl</a></h2>
<p>hooks for controlling repository access</p>
<p>This hook makes it possible to allow or deny write access to given
branches and paths of a repository when receiving incoming changesets
via pretxnchangegroup and pretxncommit.</p>
<p>The authorization is matched based on the local user name on the
system where the hook runs, and not the committer of the original
changeset (since the latter is merely informative).</p>
<p>The acl hook is best used along with a restricted shell like hgsh,
preventing authenticating users from doing anything other than pushing
or pulling. The hook is not safe to use if users have interactive
shell access, as they can then disable the hook. Nor is it safe if
remote users share an account, because then there is no way to
distinguish them.</p>
<p>The order in which access checks are performed is:</p>
<ol class="arabic simple">
<li>Deny list for branches (section <tt class="docutils literal">acl.deny.branches</tt>)</li>
<li>Allow list for branches (section <tt class="docutils literal">acl.allow.branches</tt>)</li>
<li>Deny list for paths (section <tt class="docutils literal">acl.deny</tt>)</li>
<li>Allow list for paths (section <tt class="docutils literal">acl.allow</tt>)</li>
</ol>
<p>The allow and deny sections take key-value pairs.</p>
<div class="section" id="branch-based-access-control">
<h3>Branch-based Access Control</h3>
<p>Use the <tt class="docutils literal">acl.deny.branches</tt> and <tt class="docutils literal">acl.allow.branches</tt> sections to
have branch-based access control. Keys in these sections can be
either:</p>
<ul class="simple">
<li>a branch name, or</li>
<li>an asterisk, to match any branch;</li>
</ul>
<p>The corresponding values can be either:</p>
<ul class="simple">
<li>a comma-separated list containing users and groups, or</li>
<li>an asterisk, to match anyone;</li>
</ul>
</div>
<div class="section" id="path-based-access-control">
<h3>Path-based Access Control</h3>
<p>Use the <tt class="docutils literal">acl.deny</tt> and <tt class="docutils literal">acl.allow</tt> sections to have path-based
access control. Keys in these sections accept a subtree pattern (with
a glob syntax by default). The corresponding values follow the same
syntax as the other sections above.</p>
</div>
<div class="section" id="groups">
<h3>Groups</h3>
<p>Group names must be prefixed with an <tt class="docutils literal">@</tt> symbol. Specifying a group
name has the same effect as specifying all the users in that group.</p>
<p>You can define group members in the <tt class="docutils literal">acl.groups</tt> section.
If a group name is not defined there, and Mercurial is running under
a Unix-like system, the list of users will be taken from the OS.
Otherwise, an exception will be raised.</p>
</div>
<div class="section" id="example-configuration">
<h3>Example Configuration</h3>
<pre class="literal-block">
[hooks]
# Use this if you want to check access restrictions at commit time
pretxncommit.acl = python:hgext.acl.hook
# Use this if you want to check access restrictions for pull, push,
# bundle and serve.
pretxnchangegroup.acl = python:hgext.acl.hook
[acl]
# Allow or deny access for incoming changes only if their source is
# listed here, let them pass otherwise. Source is "serve" for all
# remote access (http or ssh), "push", "pull" or "bundle" when the
# related commands are run locally.
# Default: serve
sources = serve
[acl.deny.branches]
# Everyone is denied to the frozen branch:
frozen-branch = *
# A bad user is denied on all branches:
* = bad-user
[acl.allow.branches]
# A few users are allowed on branch-a:
branch-a = user-1, user-2, user-3
# Only one user is allowed on branch-b:
branch-b = user-1
# The super user is allowed on any branch:
* = super-user
# Everyone is allowed on branch-for-tests:
branch-for-tests = *
[acl.deny]
# This list is checked first. If a match is found, acl.allow is not
# checked. All users are granted access if acl.deny is not present.
# Format for both lists: glob pattern = user, ..., @group, ...
# To match everyone, use an asterisk for the user:
# my/glob/pattern = *
# user6 will not have write access to any file:
** = user6
# Group "hg-denied" will not have write access to any file:
** = @hg-denied
# Nobody will be able to change "DONT-TOUCH-THIS.txt", despite
# everyone being able to change all other files. See below.
src/main/resources/DONT-TOUCH-THIS.txt = *
[acl.allow]
# if acl.allow is not present, all users are allowed by default
# empty acl.allow = no users allowed
# User "doc_writer" has write access to any file under the "docs"
# folder:
docs/** = doc_writer
# User "jack" and group "designers" have write access to any file
# under the "images" folder:
images/** = jack, @designers
# Everyone (except for "user6" - see acl.deny above) will have write
# access to any file under the "resources" folder (except for 1
# file. See acl.deny):
src/main/resources/** = *
.hgtags = release_engineer
</pre>
</div>
</div>
<div class="section" id="bookmarks">
<h2><a class="toc-backref" href="#id69">bookmarks</a></h2>
<p>track a line of development with movable markers</p>
<p>Bookmarks are local movable markers to changesets. Every bookmark
points to a changeset identified by its hash. If you commit a
changeset that is based on a changeset that has a bookmark on it, the
bookmark shifts to the new changeset.</p>
<p>It is possible to use bookmark names in every revision lookup (e.g.
<a class="reference external" href="hg.1.html#merge"><tt class="docutils literal">hg merge</tt></a>, <a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update</tt></a>).</p>
<p>By default, when several bookmarks point to the same changeset, they
will all move forward together. It is possible to obtain a more
git-like experience by adding the following configuration option to
your configuration file:</p>
<pre class="literal-block">
[bookmarks]
track.current = True
</pre>
<p>This will cause Mercurial to track the bookmark that you are currently
using, and only update it. This is similar to git's approach to
branching.</p>
<div class="section" id="id5">
<h3>Commands</h3>
<div class="section" id="id6">
<h4>bookmarks</h4>
<pre class="literal-block">
hg bookmarks [-f] [-d] [-m NAME] [-r REV] [NAME]
</pre>
<p>Bookmarks are pointers to certain commits that move when
committing. Bookmarks are local. They can be renamed, copied and
deleted. It is possible to use bookmark names in <a class="reference external" href="hg.1.html#merge"><tt class="docutils literal">hg merge</tt></a> and
<a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update</tt></a> to merge and update respectively to a given bookmark.</p>
<p>You can use <a class="reference external" href="hg.1.html#bookmark"><tt class="docutils literal">hg bookmark NAME</tt></a> to set a bookmark on the working
directory's parent revision with the given name. If you specify
a revision using -r REV (where REV may be an existing bookmark),
the bookmark is assigned to that revision.</p>
<p>Bookmarks can be pushed and pulled between repositories (see <a class="reference external" href="hg.1.html#push"><tt class="docutils literal">hg help
push</tt></a> and <a class="reference external" href="hg.1.html#pull"><tt class="docutils literal">hg help pull</tt></a>). This requires the bookmark extension to be
enabled for both the local and remote repositories.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>force</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>revision</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--delete</span></kbd></td>
<td>delete a given bookmark</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--rename</span></kbd></td>
<td>rename a given bookmark</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="bugzilla">
<h2><a class="toc-backref" href="#id70">bugzilla</a></h2>
<p>hooks for integrating with the Bugzilla bug tracker</p>
<p>This hook extension adds comments on bugs in Bugzilla when changesets
that refer to bugs by Bugzilla ID are seen. The hook does not change
bug status.</p>
<p>The hook updates the Bugzilla database directly. Only Bugzilla
installations using MySQL are supported.</p>
<p>The hook relies on a Bugzilla script to send bug change notification
emails. That script changes between Bugzilla versions; the
'processmail' script used prior to 2.18 is replaced in 2.18 and
subsequent versions by 'config/sendbugmail.pl'. Note that these will
be run by Mercurial as the user pushing the change; you will need to
ensure the Bugzilla install file permissions are set appropriately.</p>
<p>The extension is configured through three different configuration
sections. These keys are recognized in the [bugzilla] section:</p>
<dl class="docutils">
<dt>host</dt>
<dd>Hostname of the MySQL server holding the Bugzilla database.</dd>
<dt>db</dt>
<dd>Name of the Bugzilla database in MySQL. Default 'bugs'.</dd>
<dt>user</dt>
<dd>Username to use to access MySQL server. Default 'bugs'.</dd>
<dt>password</dt>
<dd>Password to use to access MySQL server.</dd>
<dt>timeout</dt>
<dd>Database connection timeout (seconds). Default 5.</dd>
<dt>version</dt>
<dd>Bugzilla version. Specify '3.0' for Bugzilla versions 3.0 and later,
'2.18' for Bugzilla versions from 2.18 and '2.16' for versions prior
to 2.18.</dd>
<dt>bzuser</dt>
<dd>Fallback Bugzilla user name to record comments with, if changeset
committer cannot be found as a Bugzilla user.</dd>
<dt>bzdir</dt>
<dd>Bugzilla install directory. Used by default notify. Default
'/var/www/html/bugzilla'.</dd>
<dt>notify</dt>
<dd>The command to run to get Bugzilla to send bug change notification
emails. Substitutes from a map with 3 keys, 'bzdir', 'id' (bug id)
and 'user' (committer bugzilla email). Default depends on version;
from 2.18 it is "cd %(bzdir)s && perl -T contrib/sendbugmail.pl
%(id)s %(user)s".</dd>
<dt>regexp</dt>
<dd>Regular expression to match bug IDs in changeset commit message.
Must contain one "()" group. The default expression matches 'Bug
1234', 'Bug no. 1234', 'Bug number 1234', 'Bugs 1234,5678', 'Bug
1234 and 5678' and variations thereof. Matching is case insensitive.</dd>
<dt>style</dt>
<dd>The style file to use when formatting comments.</dd>
<dt>template</dt>
<dd><p class="first">Template to use when formatting comments. Overrides style if
specified. In addition to the usual Mercurial keywords, the
extension specifies:</p>
<pre class="literal-block">
{bug} The Bugzilla bug ID.
{root} The full pathname of the Mercurial repository.
{webroot} Stripped pathname of the Mercurial repository.
{hgweb} Base URL for browsing Mercurial repositories.
</pre>
<dl class="last docutils">
<dt>Default 'changeset {node|short} in repo {root} refers '</dt>
<dd>'to bug {bug}.ndetails:nt{desc|tabindent}'</dd>
</dl>
</dd>
<dt>strip</dt>
<dd>The number of slashes to strip from the front of {root} to produce
{webroot}. Default 0.</dd>
<dt>usermap</dt>
<dd>Path of file containing Mercurial committer ID to Bugzilla user ID
mappings. If specified, the file should contain one mapping per
line, "committer"="Bugzilla user". See also the [usermap] section.</dd>
</dl>
<p>The [usermap] section is used to specify mappings of Mercurial
committer ID to Bugzilla user ID. See also [bugzilla].usermap.
"committer"="Bugzilla user"</p>
<p>Finally, the [web] section supports one entry:</p>
<dl class="docutils">
<dt>baseurl</dt>
<dd>Base URL for browsing Mercurial repositories. Reference from
templates as {hgweb}.</dd>
</dl>
<p>Activating the extension:</p>
<pre class="literal-block">
[extensions]
bugzilla =
[hooks]
# run bugzilla hook on every change pulled or pushed in here
incoming.bugzilla = python:hgext.bugzilla.hook
</pre>
<p>Example configuration:</p>
<p>This example configuration is for a collection of Mercurial
repositories in /var/local/hg/repos/ used with a local Bugzilla 3.2
installation in /opt/bugzilla-3.2.</p>
<pre class="literal-block">
[bugzilla]
host=localhost
password=XYZZY
version=3.0
bzuser=unknown@domain.com
bzdir=/opt/bugzilla-3.2
template=Changeset {node|short} in {root|basename}.
{hgweb}/{webroot}/rev/{node|short}\n
{desc}\n
strip=5
[web]
baseurl=http://dev.domain.com/hg
[usermap]
user@emaildomain.com=user.name@bugzilladomain.com
</pre>
<p>Commits add a comment to the Bugzilla bug record of the form:</p>
<pre class="literal-block">
Changeset 3b16791d6642 in repository-name.
http://dev.domain.com/hg/repository-name/rev/3b16791d6642
Changeset commit comment. Bug 1234.
</pre>
</div>
<div class="section" id="children">
<h2><a class="toc-backref" href="#id71">children</a></h2>
<p>command to display child changesets</p>
<div class="section" id="id7">
<h3>Commands</h3>
<div class="section" id="id8">
<h4>children</h4>
<pre class="literal-block">
hg children [-r REV] [FILE]
</pre>
<p>Print the children of the working directory's revisions. If a
revision is given via -r/--rev, the children of that revision will
be printed. If a file argument is given, revision in which the
file was last changed (after the working directory revision or the
argument to --rev if given) is printed.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>show children of the specified revision</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--style</span></kbd></td>
<td>display using template map file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--template</span></kbd></td>
<td>display with template</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="churn">
<h2><a class="toc-backref" href="#id72">churn</a></h2>
<p>command to display statistics about repository history</p>
<div class="section" id="id9">
<h3>Commands</h3>
<div class="section" id="id10">
<h4>churn</h4>
<pre class="literal-block">
hg churn [-d DATE] [-r REV] [--aliases FILE] [FILE]
</pre>
<p>This command will display a histogram representing the number
of changed lines or revisions, grouped according to the given
template. The default template will group changes by author.
The --dateformat option may be used to group the results by
date instead.</p>
<p>Statistics are based on the number of changed lines, or
alternatively the number of matching revisions if the
--changesets option is specified.</p>
<p>Examples:</p>
<pre class="literal-block">
# display count of changed lines for every committer
hg churn -t '{author|email}'
# display daily activity graph
hg churn -f '%H' -s -c
# display activity of developers by month
hg churn -f '%Y-%m' -s -c
# display count of lines changed in every year
hg churn -f '%Y' -s
</pre>
<p>It is possible to map alternate email addresses to a main address
by providing a file using the following format:</p>
<pre class="literal-block">
<alias email> = <actual email>
</pre>
<p>Such a file may be specified with the --aliases option, otherwise
a .hgchurn file will be looked for in the working directory root.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>count rate for the specified revision or range</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>count rate for revisions matching date spec</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-t</span>, <span class="option">--template</span></kbd></td>
<td>template to group changesets (default: {author|email})</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-f</span>, <span class="option">--dateformat</span></kbd></td>
</tr>
<tr><td> </td><td>strftime-compatible format for grouping by date</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-c</span>, <span class="option">--changesets</span></kbd></td>
</tr>
<tr><td> </td><td>count rate by number of changesets</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--sort</span></kbd></td>
<td>sort by key (default: sort by count)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--diffstat</span></kbd></td>
<td>display added/removed lines separately</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--aliases</span></kbd></td>
<td>file with email aliases</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="color">
<h2><a class="toc-backref" href="#id73">color</a></h2>
<p>colorize output from some commands</p>
<p>This extension modifies the status and resolve commands to add color to their
output to reflect file status, the qseries command to add color to reflect
patch status (applied, unapplied, missing), and to diff-related
commands to highlight additions, removals, diff headers, and trailing
whitespace.</p>
<p>Other effects in addition to color, like bold and underlined text, are
also available. Effects are rendered with the ECMA-48 SGR control
function (aka ANSI escape codes). This module also provides the
render_text function, which can be used to add effects to any text.</p>
<p>Default effects may be overridden from your configuration file:</p>
<pre class="literal-block">
[color]
status.modified = blue bold underline red_background
status.added = green bold
status.removed = red bold blue_background
status.deleted = cyan bold underline
status.unknown = magenta bold underline
status.ignored = black bold
# 'none' turns off all effects
status.clean = none
status.copied = none
qseries.applied = blue bold underline
qseries.unapplied = black bold
qseries.missing = red bold
diff.diffline = bold
diff.extended = cyan bold
diff.file_a = red bold
diff.file_b = green bold
diff.hunk = magenta
diff.deleted = red
diff.inserted = green
diff.changed = white
diff.trailingwhitespace = bold red_background
resolve.unresolved = red bold
resolve.resolved = green bold
bookmarks.current = green
branches.active = none
branches.closed = black bold
branches.current = green
branches.inactive = none
</pre>
<p>The color extension will try to detect whether to use ANSI codes or
Win32 console APIs, unless it is made explicit:</p>
<pre class="literal-block">
[color]
mode = ansi
</pre>
<p>Any value other than 'ansi', 'win32', or 'auto' will disable color.</p>
</div>
<div class="section" id="convert">
<h2><a class="toc-backref" href="#id74">convert</a></h2>
<p>import revisions from foreign VCS repositories into Mercurial</p>
<div class="section" id="id11">
<h3>Commands</h3>
<div class="section" id="id12">
<h4>convert</h4>
<pre class="literal-block">
hg convert [OPTION]... SOURCE [DEST [REVMAP]]
</pre>
<p>Accepted source formats [identifiers]:</p>
<ul class="simple">
<li>Mercurial [hg]</li>
<li>CVS [cvs]</li>
<li>Darcs [darcs]</li>
<li>git [git]</li>
<li>Subversion [svn]</li>
<li>Monotone [mtn]</li>
<li>GNU Arch [gnuarch]</li>
<li>Bazaar [bzr]</li>
<li>Perforce [p4]</li>
</ul>
<p>Accepted destination formats [identifiers]:</p>
<ul class="simple">
<li>Mercurial [hg]</li>
<li>Subversion [svn] (history on branches is not preserved)</li>
</ul>
<p>If no revision is given, all revisions will be converted.
Otherwise, convert will only import up to the named revision
(given in a format understood by the source).</p>
<p>If no destination directory name is specified, it defaults to the
basename of the source with <tt class="docutils literal"><span class="pre">-hg</span></tt> appended. If the destination
repository doesn't exist, it will be created.</p>
<p>By default, all sources except Mercurial will use --branchsort.
Mercurial uses --sourcesort to preserve original revision numbers
order. Sort modes have the following effects:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">--branchsort</span></kbd></td>
<td>convert from parent to child revision when possible,
which means branches are usually converted one after
the other. It generates more compact repositories.</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--datesort</span></kbd></td>
<td>sort revisions by date. Converted repositories have
good-looking changelogs but are often an order of
magnitude larger than the same ones generated by
--branchsort.</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--sourcesort</span></kbd></td>
<td>try to preserve source revisions order, only
supported by Mercurial sources.</td></tr>
</tbody>
</table>
<p>If <REVMAP> isn't given, it will be put in a default location
(<dest>/.hg/shamap by default). The <REVMAP> is a simple text file
that maps each source commit ID to the destination ID for that
revision, like so:</p>
<pre class="literal-block">
<source ID> <destination ID>
</pre>
<p>If the file doesn't exist, it's automatically created. It's
updated on each commit copied, so <a class="reference external" href="hg.1.html#convert"><tt class="docutils literal">hg convert</tt></a> can be interrupted
and can be run repeatedly to copy new commits.</p>
<p>The authormap is a simple text file that maps each source commit
author to a destination commit author. It is handy for source SCMs
that use unix logins to identify authors (eg: CVS). One line per
author mapping and the line format is:</p>
<pre class="literal-block">
source author = destination author
</pre>
<p>Empty lines and lines starting with a <tt class="docutils literal">#</tt> are ignored.</p>
<p>The filemap is a file that allows filtering and remapping of files
and directories. Each line can contain one of the following
directives:</p>
<pre class="literal-block">
include path/to/file-or-dir
exclude path/to/file-or-dir
rename path/to/source path/to/destination
</pre>
<p>Comment lines start with <tt class="docutils literal">#</tt>. A specified path matches if it
equals the full relative name of a file or one of its parent
directories. The <tt class="docutils literal">include</tt> or <tt class="docutils literal">exclude</tt> directive with the
longest matching path applies, so line order does not matter.</p>
<p>The <tt class="docutils literal">include</tt> directive causes a file, or all files under a
directory, to be included in the destination repository, and the
exclusion of all other files and directories not explicitly
included. The <tt class="docutils literal">exclude</tt> directive causes files or directories to
be omitted. The <tt class="docutils literal">rename</tt> directive renames a file or directory if
it is converted. To rename from a subdirectory into the root of
the repository, use <tt class="docutils literal">.</tt> as the path to rename to.</p>
<p>The splicemap is a file that allows insertion of synthetic
history, letting you specify the parents of a revision. This is
useful if you want to e.g. give a Subversion merge two parents, or
graft two disconnected series of history together. Each entry
contains a key, followed by a space, followed by one or two
comma-separated values:</p>
<pre class="literal-block">
key parent1, parent2
</pre>
<p>The key is the revision ID in the source
revision control system whose parents should be modified (same
format as a key in .hg/shamap). The values are the revision IDs
(in either the source or destination revision control system) that
should be used as the new parents for that node. For example, if
you have merged "release-1.0" into "trunk", then you should
specify the revision on "trunk" as the first parent and the one on
the "release-1.0" branch as the second.</p>
<p>The branchmap is a file that allows you to rename a branch when it is
being brought in from whatever external repository. When used in
conjunction with a splicemap, it allows for a powerful combination
to help fix even the most badly mismanaged repositories and turn them
into nicely structured Mercurial repositories. The branchmap contains
lines of the form:</p>
<pre class="literal-block">
original_branch_name new_branch_name
</pre>
<p>where "original_branch_name" is the name of the branch in the
source repository, and "new_branch_name" is the name of the branch
is the destination repository. No whitespace is allowed in the
branch names. This can be used to (for instance) move code in one
repository from "default" to a named branch.</p>
<div class="section" id="mercurial-source">
<h5>Mercurial Source</h5>
<dl class="docutils">
<dt>--config convert.hg.ignoreerrors=False (boolean)</dt>
<dd>ignore integrity errors when reading. Use it to fix Mercurial
repositories with missing revlogs, by converting from and to
Mercurial.</dd>
<dt>--config convert.hg.saverev=False (boolean)</dt>
<dd>store original revision ID in changeset (forces target IDs to
change)</dd>
<dt>--config convert.hg.startrev=0 (hg revision identifier)</dt>
<dd>convert start revision and its descendants</dd>
</dl>
</div>
<div class="section" id="cvs-source">
<h5>CVS Source</h5>
<p>CVS source will use a sandbox (i.e. a checked-out copy) from CVS
to indicate the starting point of what will be converted. Direct
access to the repository files is not needed, unless of course the
repository is :local:. The conversion uses the top level directory
in the sandbox to find the CVS repository, and then uses CVS rlog
commands to find files to convert. This means that unless a
filemap is given, all files under the starting directory will be
converted, and that any directory reorganization in the CVS
sandbox is ignored.</p>
<p>The options shown are the defaults.</p>
<dl class="docutils">
<dt>--config convert.cvsps.cache=True (boolean)</dt>
<dd>Set to False to disable remote log caching, for testing and
debugging purposes.</dd>
<dt>--config convert.cvsps.fuzz=60 (integer)</dt>
<dd>Specify the maximum time (in seconds) that is allowed between
commits with identical user and log message in a single
changeset. When very large files were checked in as part of a
changeset then the default may not be long enough.</dd>
<dt>--config convert.cvsps.mergeto='{{mergetobranch ([-w]+)}}'</dt>
<dd>Specify a regular expression to which commit log messages are
matched. If a match occurs, then the conversion process will
insert a dummy revision merging the branch on which this log
message occurs to the branch indicated in the regex.</dd>
<dt>--config convert.cvsps.mergefrom='{{mergefrombranch ([-w]+)}}'</dt>
<dd>Specify a regular expression to which commit log messages are
matched. If a match occurs, then the conversion process will
add the most recent revision on the branch indicated in the
regex as the second parent of the changeset.</dd>
<dt>--config hook.cvslog</dt>
<dd>Specify a Python function to be called at the end of gathering
the CVS log. The function is passed a list with the log entries,
and can modify the entries in-place, or add or delete them.</dd>
<dt>--config hook.cvschangesets</dt>
<dd>Specify a Python function to be called after the changesets
are calculated from the the CVS log. The function is passed
a list with the changeset entries, and can modify the changesets
in-place, or add or delete them.</dd>
</dl>
<p>An additional "debugcvsps" Mercurial command allows the builtin
changeset merging code to be run without doing a conversion. Its
parameters and output are similar to that of cvsps 2.1. Please see
the command help for more details.</p>
</div>
<div class="section" id="subversion-source">
<h5>Subversion Source</h5>
<p>Subversion source detects classical trunk/branches/tags layouts.
By default, the supplied "svn://repo/path/" source URL is
converted as a single branch. If "svn://repo/path/trunk" exists it
replaces the default branch. If "svn://repo/path/branches" exists,
its subdirectories are listed as possible branches. If
"svn://repo/path/tags" exists, it is looked for tags referencing
converted branches. Default "trunk", "branches" and "tags" values
can be overridden with following options. Set them to paths
relative to the source URL, or leave them blank to disable auto
detection.</p>
<dl class="docutils">
<dt>--config convert.svn.branches=branches (directory name)</dt>
<dd>specify the directory containing branches</dd>
<dt>--config convert.svn.tags=tags (directory name)</dt>
<dd>specify the directory containing tags</dd>
<dt>--config convert.svn.trunk=trunk (directory name)</dt>
<dd>specify the name of the trunk branch</dd>
</dl>
<p>Source history can be retrieved starting at a specific revision,
instead of being integrally converted. Only single branch
conversions are supported.</p>
<dl class="docutils">
<dt>--config convert.svn.startrev=0 (svn revision number)</dt>
<dd>specify start Subversion revision.</dd>
</dl>
</div>
<div class="section" id="perforce-source">
<h5>Perforce Source</h5>
<p>The Perforce (P4) importer can be given a p4 depot path or a
client specification as source. It will convert all files in the
source to a flat Mercurial repository, ignoring labels, branches
and integrations. Note that when a depot path is given you then
usually should specify a target directory, because otherwise the
target may be named ...-hg.</p>
<p>It is possible to limit the amount of source history to be
converted by specifying an initial Perforce revision.</p>
<dl class="docutils">
<dt>--config convert.p4.startrev=0 (perforce changelist number)</dt>
<dd>specify initial Perforce revision.</dd>
</dl>
</div>
<div class="section" id="mercurial-destination">
<h5>Mercurial Destination</h5>
<dl class="docutils">
<dt>--config convert.hg.clonebranches=False (boolean)</dt>
<dd>dispatch source branches in separate clones.</dd>
<dt>--config convert.hg.tagsbranch=default (branch name)</dt>
<dd>tag revisions branch name</dd>
<dt>--config convert.hg.usebranchnames=True (boolean)</dt>
<dd>preserve branch names</dd>
</dl>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">--authors</span></kbd></td>
<td>username mapping filename (DEPRECATED, use --authormap instead)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-s</span>, <span class="option">--source-type</span></kbd></td>
</tr>
<tr><td> </td><td>source repository type</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-d</span>, <span class="option">--dest-type</span></kbd></td>
</tr>
<tr><td> </td><td>destination repository type</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>import up to target revision REV</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-A</span>, <span class="option">--authormap</span></kbd></td>
</tr>
<tr><td> </td><td>remap usernames using this file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--filemap</span></kbd></td>
<td>remap file names using contents of file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--splicemap</span></kbd></td>
<td>splice synthesized history into place</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--branchmap</span></kbd></td>
<td>change branch names while converting</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--branchsort</span></kbd></td>
<td>try to sort changesets by branches</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--datesort</span></kbd></td>
<td>try to sort changesets by date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--sourcesort</span></kbd></td>
<td>preserve source changesets order</td></tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="section" id="eol">
<h2><a class="toc-backref" href="#id75">eol</a></h2>
<p>automatically manage newlines in repository files</p>
<p>This extension allows you to manage the type of line endings (CRLF or
LF) that are used in the repository and in the local working
directory. That way you can get CRLF line endings on Windows and LF on
Unix/Mac, thereby letting everybody use their OS native line endings.</p>
<p>The extension reads its configuration from a versioned <tt class="docutils literal">.hgeol</tt>
configuration file every time you run an <tt class="docutils literal">hg</tt> command. The
<tt class="docutils literal">.hgeol</tt> file use the same syntax as all other Mercurial
configuration files. It uses two sections, <tt class="docutils literal">[patterns]</tt> and
<tt class="docutils literal">[repository]</tt>.</p>
<p>The <tt class="docutils literal">[patterns]</tt> section specifies how line endings should be
converted between the working copy and the repository. The format is
specified by a file pattern. The first match is used, so put more
specific patterns first. The available line endings are <tt class="docutils literal">LF</tt>,
<tt class="docutils literal">CRLF</tt>, and <tt class="docutils literal">BIN</tt>.</p>
<p>Files with the declared format of <tt class="docutils literal">CRLF</tt> or <tt class="docutils literal">LF</tt> are always
checked out and stored in the repository in that format and files
declared to be binary (<tt class="docutils literal">BIN</tt>) are left unchanged. Additionally,
<tt class="docutils literal">native</tt> is an alias for checking out in the platform's default line
ending: <tt class="docutils literal">LF</tt> on Unix (including Mac OS X) and <tt class="docutils literal">CRLF</tt> on
Windows. Note that <tt class="docutils literal">BIN</tt> (do nothing to line endings) is Mercurial's
default behaviour; it is only needed if you need to override a later,
more general pattern.</p>
<p>The optional <tt class="docutils literal">[repository]</tt> section specifies the line endings to
use for files stored in the repository. It has a single setting,
<tt class="docutils literal">native</tt>, which determines the storage line endings for files
declared as <tt class="docutils literal">native</tt> in the <tt class="docutils literal">[patterns]</tt> section. It can be set to
<tt class="docutils literal">LF</tt> or <tt class="docutils literal">CRLF</tt>. The default is <tt class="docutils literal">LF</tt>. For example, this means
that on Windows, files configured as <tt class="docutils literal">native</tt> (<tt class="docutils literal">CRLF</tt> by default)
will be converted to <tt class="docutils literal">LF</tt> when stored in the repository. Files
declared as <tt class="docutils literal">LF</tt>, <tt class="docutils literal">CRLF</tt>, or <tt class="docutils literal">BIN</tt> in the <tt class="docutils literal">[patterns]</tt> section
are always stored as-is in the repository.</p>
<p>Example versioned <tt class="docutils literal">.hgeol</tt> file:</p>
<pre class="literal-block">
[patterns]
**.py = native
**.vcproj = CRLF
**.txt = native
Makefile = LF
**.jpg = BIN
[repository]
native = LF
</pre>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">The rules will first apply when files are touched in the working
copy, e.g. by updating to null and back to tip to touch all files.</p>
</div>
<p>The extension uses an optional <tt class="docutils literal">[eol]</tt> section in your hgrc file
(not the <tt class="docutils literal">.hgeol</tt> file) for settings that control the overall
behavior. There are two settings:</p>
<ul class="simple">
<li><tt class="docutils literal">eol.native</tt> (default <tt class="docutils literal">os.linesep</tt>) can be set to <tt class="docutils literal">LF</tt> or
<tt class="docutils literal">CRLF</tt> to override the default interpretation of <tt class="docutils literal">native</tt> for
checkout. This can be used with <a class="reference external" href="hg.1.html#archive"><tt class="docutils literal">hg archive</tt></a> on Unix, say, to
generate an archive where files have line endings for Windows.</li>
<li><tt class="docutils literal"><span class="pre">eol.only-consistent</span></tt> (default True) can be set to False to make
the extension convert files with inconsistent EOLs. Inconsistent
means that there is both <tt class="docutils literal">CRLF</tt> and <tt class="docutils literal">LF</tt> present in the file.
Such files are normally not touched under the assumption that they
have mixed EOLs on purpose.</li>
</ul>
<p>The <tt class="docutils literal">win32text.forbid*</tt> hooks provided by the win32text extension
have been unified into a single hook named <tt class="docutils literal">eol.hook</tt>. The hook will
lookup the expected line endings from the <tt class="docutils literal">.hgeol</tt> file, which means
you must migrate to a <tt class="docutils literal">.hgeol</tt> file first before using the hook.</p>
<p>See <a class="reference external" href="hg.1.html#patterns"><tt class="docutils literal">hg help patterns</tt></a> for more information about the glob patterns
used.</p>
</div>
<div class="section" id="extdiff">
<h2><a class="toc-backref" href="#id76">extdiff</a></h2>
<p>command to allow external programs to compare revisions</p>
<p>The extdiff Mercurial extension allows you to use external programs
to compare revisions, or revision with working directory. The external
diff programs are called with a configurable set of options and two
non-option arguments: paths to directories containing snapshots of
files to compare.</p>
<p>The extdiff extension also allows to configure new diff commands, so
you do not need to type <a class="reference external" href="hg.1.html#extdiff"><tt class="docutils literal">hg extdiff <span class="pre">-p</span> kdiff3</tt></a> always.</p>
<pre class="literal-block">
[extdiff]
# add new command that runs GNU diff(1) in 'context diff' mode
cdiff = gdiff -Nprc5
## or the old way:
#cmd.cdiff = gdiff
#opts.cdiff = -Nprc5
# add new command called vdiff, runs kdiff3
vdiff = kdiff3
# add new command called meld, runs meld (no need to name twice)
meld =
# add new command called vimdiff, runs gvimdiff with DirDiff plugin
# (see http://www.vim.org/scripts/script.php?script_id=102) Non
# English user, be sure to put "let g:DirDiffDynamicDiffText = 1" in
# your .vimrc
vimdiff = gvim -f '+next' '+execute "DirDiff" argv(0) argv(1)'
</pre>
<p>Tool arguments can include variables that are expanded at runtime:</p>
<pre class="literal-block">
$parent1, $plabel1 - filename, descriptive label of first parent
$child, $clabel - filename, descriptive label of child revision
$parent2, $plabel2 - filename, descriptive label of second parent
$parent is an alias for $parent1.
</pre>
<p>The extdiff extension will look in your [diff-tools] and [merge-tools]
sections for diff tool arguments, when none are specified in [extdiff].</p>
<pre class="literal-block">
[extdiff]
kdiff3 =
[diff-tools]
kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child
</pre>
<p>You can use -I/-X and list of file or directory names like normal
<a class="reference external" href="hg.1.html#diff"><tt class="docutils literal">hg diff</tt></a> command. The extdiff extension makes snapshots of only
needed files, so running the external diff program will actually be
pretty fast (at least faster than having to compare the entire tree).</p>
<div class="section" id="id13">
<h3>Commands</h3>
<div class="section" id="id14">
<h4>extdiff</h4>
<pre class="literal-block">
hg extdiff [OPT]... [FILE]...
</pre>
<p>Show differences between revisions for the specified files, using
an external program. The default program used is diff, with
default options "-Npru".</p>
<p>To select a different program, use the -p/--program option. The
program will be passed the names of two directories to compare. To
pass additional options to the program, use -o/--option. These
will be passed before the names of the directories to compare.</p>
<p>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.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-p</span>, <span class="option">--program</span></kbd></td>
<td>comparison program to run</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-o</span>, <span class="option">--option</span></kbd></td>
<td>pass option to comparison program</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>revision</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-c</span>, <span class="option">--change</span></kbd></td>
<td>change made by revision</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="fetch">
<h2><a class="toc-backref" href="#id77">fetch</a></h2>
<p>pull, update and merge in one command</p>
<div class="section" id="id15">
<h3>Commands</h3>
<div class="section" id="id16">
<h4>fetch</h4>
<pre class="literal-block">
hg fetch [SOURCE]
</pre>
<p>This finds all changes from the repository at the specified path
or URL and adds them to the local repository.</p>
<p>If the pulled changes add a new branch head, the head is
automatically merged, and the result of the merge is committed.
Otherwise, the working directory is updated to include the new
changes.</p>
<p>When a merge occurs, the newly pulled changes are assumed to be
"authoritative". The head of the new changes is used as the first
parent, with local changes as the second. To switch the merge
order, use --switch-parent.</p>
<p>See <a class="reference external" href="hg.1.html#dates"><tt class="docutils literal">hg help dates</tt></a> for a list of formats valid for -d/--date.</p>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>a specific revision you would like to pull</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td>
<td>edit commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--force-editor</span></kbd></td>
<td>edit commit message (DEPRECATED)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--switch-parent</span></kbd></td>
</tr>
<tr><td> </td><td>switch parents when merging</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td>
<td>use text as commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td>
<td>read commit message from file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>record datecode as commit date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td>record the specified user as committer</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td>
<td>specify ssh command to use</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--remotecmd</span></kbd></td>
<td>specify hg command to run on the remote side</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="gpg">
<h2><a class="toc-backref" href="#id78">gpg</a></h2>
<p>commands to sign and verify changesets</p>
<div class="section" id="id17">
<h3>Commands</h3>
<div class="section" id="sigcheck">
<h4>sigcheck</h4>
<pre class="literal-block">
hg sigcheck REVISION
</pre>
<p>verify all the signatures there may be for a particular revision</p>
</div>
<div class="section" id="sign">
<h4>sign</h4>
<pre class="literal-block">
hg sign [OPTION]... [REVISION]...
</pre>
<p>If no revision is given, the parent of the working directory is used,
or tip if no revision is checked out.</p>
<p>See <a class="reference external" href="hg.1.html#dates"><tt class="docutils literal">hg help dates</tt></a> for a list of formats valid for -d/--date.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--local</span></kbd></td>
<td>make the signature local</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>sign even if the sigfile is modified</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--no-commit</span></kbd></td>
<td>do not commit the sigfile after signing</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-k</span>, <span class="option">--key</span></kbd></td>
<td>the key id to sign with</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td>
<td>commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>record datecode as commit date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td>record the specified user as committer</td></tr>
</tbody>
</table>
</div>
<div class="section" id="sigs">
<h4>sigs</h4>
<pre class="literal-block">
hg sigs
</pre>
<p>list signed changesets</p>
</div>
</div>
</div>
<div class="section" id="graphlog">
<h2><a class="toc-backref" href="#id79">graphlog</a></h2>
<p>command to view revision graphs from a shell</p>
<p>This extension adds a --graph option to the incoming, outgoing and log
commands. When this options is given, an ASCII representation of the
revision graph is also shown.</p>
<div class="section" id="id18">
<h3>Commands</h3>
<div class="section" id="glog">
<h4>glog</h4>
<pre class="literal-block">
hg glog [OPTION]... [FILE]
</pre>
<p>Print a revision history alongside a revision graph drawn with
ASCII characters.</p>
<p>Nodes printed as an @ character are parents of the working
directory.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--limit</span></kbd></td>
<td>limit number of changes displayed</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-p</span>, <span class="option">--patch</span></kbd></td>
<td>show patch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>show the specified revision or range</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--style</span></kbd></td>
<td>display using template map file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--template</span></kbd></td>
<td>display with template</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="hgcia">
<h2><a class="toc-backref" href="#id80">hgcia</a></h2>
<p>hooks for integrating with the CIA.vc notification service</p>
<p>This is meant to be run as a changegroup or incoming hook. To
configure it, set the following options in your hgrc:</p>
<pre class="literal-block">
[cia]
# your registered CIA user name
user = foo
# the name of the project in CIA
project = foo
# the module (subproject) (optional)
#module = foo
# Append a diffstat to the log message (optional)
#diffstat = False
# Template to use for log messages (optional)
#template = {desc}\n{baseurl}/rev/{node}-- {diffstat}
# Style to use (optional)
#style = foo
# The URL of the CIA notification service (optional)
# You can use mailto: URLs to send by email, eg
# mailto:cia@cia.vc
# Make sure to set email.from if you do this.
#url = http://cia.vc/
# print message instead of sending it (optional)
#test = False
[hooks]
# one of these:
changegroup.cia = python:hgcia.hook
#incoming.cia = python:hgcia.hook
[web]
# If you want hyperlinks (optional)
baseurl = http://server/path/to/repo
</pre>
</div>
<div class="section" id="hgk">
<h2><a class="toc-backref" href="#id81">hgk</a></h2>
<p>browse the repository in a graphical way</p>
<p>The hgk extension allows browsing the history of a repository in a
graphical way. It requires Tcl/Tk version 8.4 or later. (Tcl/Tk is not
distributed with Mercurial.)</p>
<p>hgk consists of two parts: a Tcl script that does the displaying and
querying of information, and an extension to Mercurial named hgk.py,
which provides hooks for hgk to get information. hgk can be found in
the contrib directory, and the extension is shipped in the hgext
repository, and needs to be enabled.</p>
<p>The <a class="reference external" href="hg.1.html#view"><tt class="docutils literal">hg view</tt></a> command will launch the hgk Tcl script. For this command
to work, hgk must be in your search path. Alternately, you can specify
the path to hgk in your configuration file:</p>
<pre class="literal-block">
[hgk]
path=/location/of/hgk
</pre>
<p>hgk can make use of the extdiff extension to visualize revisions.
Assuming you had already configured extdiff vdiff command, just add:</p>
<pre class="literal-block">
[hgk]
vdiff=vdiff
</pre>
<p>Revisions context menu will now display additional entries to fire
vdiff on hovered and selected revisions.</p>
<div class="section" id="id19">
<h3>Commands</h3>
<div class="section" id="view">
<h4>view</h4>
<pre class="literal-block">
hg view [-l LIMIT] [REVRANGE]
</pre>
<p>start interactive history viewer</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--limit</span></kbd></td>
<td>limit number of changes displayed</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="highlight">
<h2><a class="toc-backref" href="#id82">highlight</a></h2>
<p>syntax highlighting for hgweb (requires Pygments)</p>
<p>It depends on the Pygments syntax highlighting library:
<a class="reference external" href="http://pygments.org/">http://pygments.org/</a></p>
<p>There is a single configuration option:</p>
<pre class="literal-block">
[web]
pygments_style = <style>
</pre>
<p>The default is 'colorful'.</p>
</div>
<div class="section" id="inotify">
<h2><a class="toc-backref" href="#id83">inotify</a></h2>
<p>accelerate status report using Linux's inotify service</p>
<div class="section" id="id20">
<h3>Commands</h3>
<div class="section" id="inserve">
<h4>inserve</h4>
<pre class="literal-block">
hg inserve [OPTION]...
</pre>
<p>start an inotify server for this repository</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--daemon</span></kbd></td>
<td>run server in background</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--daemon-pipefds</span></kbd></td>
</tr>
<tr><td> </td><td>used internally by daemon mode</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-t</span>, <span class="option">--idle-timeout</span></kbd></td>
</tr>
<tr><td> </td><td>minutes to sit idle before exiting</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--pid-file</span></kbd></td>
<td>name of file to write process ID to</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="interhg">
<h2><a class="toc-backref" href="#id84">interhg</a></h2>
<p>expand expressions into changelog and summaries</p>
<p>This extension allows the use of a special syntax in summaries, which
will be automatically expanded into links or any other arbitrary
expression, much like InterWiki does.</p>
<p>A few example patterns (link to bug tracking, etc.) that may be used
in your hgrc:</p>
<pre class="literal-block">
[interhg]
issues = s!issue(\d+)!<a href="http://bts/issue\1">issue\1</a>!
bugzilla = s!((?:bug|b=|(?=#?\d{4,}))(?:\s*#?)(\d+))!<a..=\2">\1</a>!i
boldify = s!(^|\s)#(\d+)\b! <b>#\2</b>!
</pre>
</div>
<div class="section" id="keyword">
<h2><a class="toc-backref" href="#id85">keyword</a></h2>
<p>expand keywords in tracked files</p>
<p>This extension expands RCS/CVS-like or self-customized $Keywords$ in
tracked text files selected by your configuration.</p>
<p>Keywords are only expanded in local repositories and not stored in the
change history. The mechanism can be regarded as a convenience for the
current user or for archive distribution.</p>
<p>Keywords expand to the changeset data pertaining to the latest change
relative to the working directory parent of each file.</p>
<p>Configuration is done in the [keyword], [keywordset] and [keywordmaps]
sections of hgrc files.</p>
<p>Example:</p>
<pre class="literal-block">
[keyword]
# expand keywords in every python file except those matching "x*"
**.py =
x* = ignore
[keywordset]
# prefer svn- over cvs-like default keywordmaps
svn = True
</pre>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">The more specific you are in your filename patterns the less you
lose speed in huge repositories.</p>
</div>
<p>For [keywordmaps] template mapping and expansion demonstration and
control run <a class="reference external" href="hg.1.html#kwdemo"><tt class="docutils literal">hg kwdemo</tt></a>. See <a class="reference external" href="hg.1.html#templates"><tt class="docutils literal">hg help templates</tt></a> for a list of
available templates and filters.</p>
<p>Three additional date template filters are provided:</p>
<pre class="literal-block">
utcdate "2006/09/18 15:13:13"
svnutcdate "2006-09-18 15:13:13Z"
svnisodate "2006-09-18 08:13:13 -700 (Mon, 18 Sep 2006)"
</pre>
<p>The default template mappings (view with <a class="reference external" href="hg.1.html#kwdemo"><tt class="docutils literal">hg kwdemo <span class="pre">-d</span></tt></a>) can be
replaced with customized keywords and templates. Again, run
<a class="reference external" href="hg.1.html#kwdemo"><tt class="docutils literal">hg kwdemo</tt></a> to control the results of your configuration changes.</p>
<p>Before changing/disabling active keywords, run <a class="reference external" href="hg.1.html#kwshrink"><tt class="docutils literal">hg kwshrink</tt></a> to avoid
the risk of inadvertently storing expanded keywords in the change
history.</p>
<p>To force expansion after enabling it, or a configuration change, run
<a class="reference external" href="hg.1.html#kwexpand"><tt class="docutils literal">hg kwexpand</tt></a>.</p>
<p>Expansions spanning more than one line and incremental expansions,
like CVS' $Log$, are not supported. A keyword template map "Log =
{desc}" expands to the first line of the changeset description.</p>
<div class="section" id="id21">
<h3>Commands</h3>
<div class="section" id="kwdemo">
<h4>kwdemo</h4>
<pre class="literal-block">
hg kwdemo [-d] [-f RCFILE] [TEMPLATEMAP]...
</pre>
<p>Show current, custom, or default keyword template maps and their
expansions.</p>
<p>Extend the current configuration by specifying maps as arguments
and using -f/--rcfile to source an external hgrc file.</p>
<p>Use -d/--default to disable current configuration.</p>
<p>See <a class="reference external" href="hg.1.html#templates"><tt class="docutils literal">hg help templates</tt></a> for information on templates and filters.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--default</span></kbd></td>
<td>show default keyword template maps</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--rcfile</span></kbd></td>
<td>read maps from rcfile</td></tr>
</tbody>
</table>
</div>
<div class="section" id="kwexpand">
<h4>kwexpand</h4>
<pre class="literal-block">
hg kwexpand [OPTION]... [FILE]...
</pre>
<p>Run after (re)enabling keyword expansion.</p>
<p>kwexpand refuses to run if given files contain local changes.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
</div>
<div class="section" id="kwfiles">
<h4>kwfiles</h4>
<pre class="literal-block">
hg kwfiles [OPTION]... [FILE]...
</pre>
<p>List which files in the working directory are matched by the
[keyword] configuration patterns.</p>
<p>Useful to prevent inadvertent keyword expansion and to speed up
execution by including only files that are actual candidates for
expansion.</p>
<p>See <a class="reference external" href="hg.1.html#keyword"><tt class="docutils literal">hg help keyword</tt></a> on how to construct patterns both for
inclusion and exclusion of files.</p>
<p>With -A/--all and -v/--verbose the codes used to show the status
of files are:</p>
<pre class="literal-block">
K = keyword expansion candidate
k = keyword expansion candidate (not tracked)
I = ignored
i = ignored (not tracked)
</pre>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-A</span>, <span class="option">--all</span></kbd></td>
<td>show keyword status flags of all files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-i</span>, <span class="option">--ignore</span></kbd></td>
<td>show files excluded from expansion</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--unknown</span></kbd></td>
<td>only show unknown (not tracked) files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
</div>
<div class="section" id="kwshrink">
<h4>kwshrink</h4>
<pre class="literal-block">
hg kwshrink [OPTION]... [FILE]...
</pre>
<p>Run before changing/disabling active keywords or if you experience
problems with <a class="reference external" href="hg.1.html#import"><tt class="docutils literal">hg import</tt></a> or <a class="reference external" href="hg.1.html#merge"><tt class="docutils literal">hg merge</tt></a>.</p>
<p>kwshrink refuses to run if given files contain local changes.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="mq">
<h2><a class="toc-backref" href="#id86">mq</a></h2>
<p>manage a stack of patches</p>
<p>This extension lets you work with a stack of patches in a Mercurial
repository. It manages two stacks of patches - all known patches, and
applied patches (subset of known patches).</p>
<p>Known patches are represented as patch files in the .hg/patches
directory. Applied patches are both patch files and changesets.</p>
<p>Common tasks (use <a class="reference external" href="hg.1.html#command"><tt class="docutils literal">hg help command</tt></a> for more details):</p>
<pre class="literal-block">
create new patch qnew
import existing patch qimport
print patch series qseries
print applied patches qapplied
add known patch to applied stack qpush
remove patch from applied stack qpop
refresh contents of top applied patch qrefresh
</pre>
<p>By default, mq will automatically use git patches when required to
avoid losing file mode changes, copy records, binary files or empty
files creations or deletions. This behaviour can be configured with:</p>
<pre class="literal-block">
[mq]
git = auto/keep/yes/no
</pre>
<p>If set to 'keep', mq will obey the [diff] section configuration while
preserving existing git patches upon qrefresh. If set to 'yes' or
'no', mq will override the [diff] section and always generate git or
regular patches, possibly losing data in the second case.</p>
<p>You will by default be managing a patch queue named "patches". You can
create other, independent patch queues with the <a class="reference external" href="hg.1.html#qqueue"><tt class="docutils literal">hg qqueue</tt></a> command.</p>
<div class="section" id="id22">
<h3>Commands</h3>
<div class="section" id="qapplied">
<h4>qapplied</h4>
<pre class="literal-block">
hg qapplied [-1] [-s] [PATCH]
</pre>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-1</span>, <span class="option">--last</span></kbd></td>
<td>show only the last patch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--summary</span></kbd></td>
<td>print first line of patch header</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qclone">
<h4>qclone</h4>
<pre class="literal-block">
hg qclone [OPTION]... SOURCE [DEST]
</pre>
<p>If source is local, destination will have no patches applied. If
source is remote, this command can not check if patches are
applied in source, so cannot guarantee that patches are not
applied in destination. If you clone remote repository, be sure
before that it has no patches applied.</p>
<p>Source patch repository is looked for in <src>/.hg/patches by
default. Use -p <url> to change.</p>
<p>The patch directory must be a nested Mercurial repository, as
would be created by <a class="reference external" href="hg.1.html#init"><tt class="docutils literal">hg init <span class="pre">--mq</span></tt></a>.</p>
<p>Return 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">--pull</span></kbd></td>
<td>use pull protocol to copy metadata</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-U</span>, <span class="option">--noupdate</span></kbd></td>
<td>do not update the new working directories</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--uncompressed</span></kbd></td>
<td>use uncompressed transfer (fast over LAN)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-p</span>, <span class="option">--patches</span></kbd></td>
<td>location of source patch repository</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td>
<td>specify ssh command to use</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--remotecmd</span></kbd></td>
<td>specify hg command to run on the remote side</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qcommit">
<h4>qcommit</h4>
<pre class="literal-block">
hg qcommit [OPTION]... [FILE]...
</pre>
<p>This command is deprecated; use <a class="reference external" href="hg.1.html#commit"><tt class="docutils literal">hg commit <span class="pre">--mq</span></tt></a> instead.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-A</span>, <span class="option">--addremove</span></kbd></td>
</tr>
<tr><td> </td><td>mark new/missing files as added/removed before committing</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--close-branch</span></kbd></td>
<td>mark a branch as closed, hiding it from the branch list</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td>
<td>use text as commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td>
<td>read commit message from file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>record datecode as commit date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td><p class="first">record the specified user as committer</p>
<p class="last">aliases: qci</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qdelete">
<h4>qdelete</h4>
<pre class="literal-block">
hg qdelete [-k] [PATCH]...
</pre>
<p>The patches must not be applied, and at least one patch is required. With
-k/--keep, the patch files are preserved in the patch directory.</p>
<p>To stop managing a patch and move it into permanent history,
use the <a class="reference external" href="hg.1.html#qfinish"><tt class="docutils literal">hg qfinish</tt></a> command.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-k</span>, <span class="option">--keep</span></kbd></td>
<td>keep patch file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td><p class="first">stop managing a revision (DEPRECATED)</p>
<p class="last">aliases: qremove qrm</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qdiff">
<h4>qdiff</h4>
<pre class="literal-block">
hg qdiff [OPTION]... [FILE]...
</pre>
<p>Shows a diff which includes the current patch as well as any
changes which have been made in the working directory since the
last refresh (thus showing what the current patch would become
after a qrefresh).</p>
<p>Use <a class="reference external" href="hg.1.html#diff"><tt class="docutils literal">hg diff</tt></a> if you only want to see the changes made since the
last qrefresh, or <a class="reference external" href="hg.1.html#export"><tt class="docutils literal">hg export qtip</tt></a> if you want to see changes
made by the current patch without including changes made since the
qrefresh.</p>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--text</span></kbd></td>
<td>treat all files as text</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td>
<td>use git extended diff format</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--nodates</span></kbd></td>
<td>omit dates from diff headers</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-p</span>, <span class="option">--show-function</span></kbd></td>
</tr>
<tr><td> </td><td>show which function each change is in</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--reverse</span></kbd></td>
<td>produce a diff that undoes the changes</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-w</span>, <span class="option">--ignore-all-space</span></kbd></td>
</tr>
<tr><td> </td><td>ignore white space when comparing lines</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-b</span>, <span class="option">--ignore-space-change</span></kbd></td>
</tr>
<tr><td> </td><td>ignore changes in the amount of white space</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-B</span>, <span class="option">--ignore-blank-lines</span></kbd></td>
</tr>
<tr><td> </td><td>ignore changes whose lines are all blank</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-U</span>, <span class="option">--unified</span></kbd></td>
<td>number of lines of context to show</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--stat</span></kbd></td>
<td>output diffstat-style summary of changes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qfinish">
<h4>qfinish</h4>
<pre class="literal-block">
hg qfinish [-a] [REV]...
</pre>
<p>Finishes the specified revisions (corresponding to applied
patches) by moving them out of mq control into regular repository
history.</p>
<p>Accepts a revision range or the -a/--applied option. If --applied
is specified, all applied mq revisions are removed from mq
control. Otherwise, the given revisions must be at the base of the
stack of applied patches.</p>
<p>This can be especially useful if your changes have been applied to
an upstream repository, or if you are about to push your changes
to upstream.</p>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--applied</span></kbd></td>
<td>finish all applied changesets</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qfold">
<h4>qfold</h4>
<pre class="literal-block">
hg qfold [-e] [-k] [-m TEXT] [-l FILE] PATCH...
</pre>
<p>Patches must not yet be applied. Each patch will be successively
applied to the current patch in the order given. If all the
patches apply successfully, the current patch will be refreshed
with the new cumulative patch, and the folded patches will be
deleted. With -k/--keep, the folded patch files will not be
removed afterwards.</p>
<p>The header for each folded patch will be concatenated with the
current patch header, separated by a line of <tt class="docutils literal">* * *</tt>.</p>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td>
<td>edit patch header</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-k</span>, <span class="option">--keep</span></kbd></td>
<td>keep folded patch files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td>
<td>use text as commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td>
<td>read commit message from file</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qgoto">
<h4>qgoto</h4>
<pre class="literal-block">
hg qgoto [OPTION]... PATCH
</pre>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>overwrite any local changes</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qguard">
<h4>qguard</h4>
<pre class="literal-block">
hg qguard [-l] [-n] [PATCH] [-- [+GUARD]... [-GUARD]...]
</pre>
<p>Guards control whether a patch can be pushed. A patch with no
guards is always pushed. A patch with a positive guard ("+foo") is
pushed only if the <a class="reference external" href="hg.1.html#qselect"><tt class="docutils literal">hg qselect</tt></a> command has activated it. A patch with
a negative guard ("-foo") is never pushed if the <a class="reference external" href="hg.1.html#qselect"><tt class="docutils literal">hg qselect</tt></a> command
has activated it.</p>
<p>With no arguments, print the currently active guards.
With arguments, set guards for the named patch.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">Specifying negative guards now requires '--'.</p>
</div>
<p>To set guards on another patch:</p>
<pre class="literal-block">
hg qguard other.patch -- +2.6.17 -stable
</pre>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--list</span></kbd></td>
<td>list all patches and guards</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--none</span></kbd></td>
<td>drop all guards</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qheader">
<h4>qheader</h4>
<pre class="literal-block">
hg qheader [PATCH]
</pre>
<p>Returns 0 on success.</p>
</div>
<div class="section" id="qimport">
<h4>qimport</h4>
<pre class="literal-block">
hg qimport [-e] [-n NAME] [-f] [-g] [-P] [-r REV]... FILE...
</pre>
<p>The patch is inserted into the series after the last applied
patch. If no patches have been applied, qimport prepends the patch
to the series.</p>
<p>The patch will have the same name as its source file unless you
give it a new one with -n/--name.</p>
<p>You can register an existing patch inside the patch directory with
the -e/--existing flag.</p>
<p>With -f/--force, an existing patch of the same name will be
overwritten.</p>
<p>An existing changeset may be placed under mq control with -r/--rev
(e.g. qimport --rev tip -n patch will place tip under mq control).
With -g/--git, patches imported with --rev will use the git diff
format. See the diffs help topic for information on why this is
important for preserving rename/copy information and permission
changes.</p>
<p>To import a patch from standard input, pass - as the patch file.
When importing from standard input, a patch name must be specified
using the --name flag.</p>
<p>To import an existing patch while renaming it:</p>
<pre class="literal-block">
hg qimport -e existing-patch -n new-name
</pre>
<p>Returns 0 if import succeeded.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--existing</span></kbd></td>
<td>import file in patch directory</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--name</span></kbd></td>
<td>name of patch file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>overwrite existing files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>place existing revisions under mq control</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td>
<td>use git extended diff format</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-P</span>, <span class="option">--push</span></kbd></td>
<td>qpush after importing</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qinit">
<h4>qinit</h4>
<pre class="literal-block">
hg qinit [-c]
</pre>
<p>The queue repository is unversioned by default. If
-c/--create-repo is specified, qinit will create a separate nested
repository for patches (qinit -c may also be run later to convert
an unversioned patch repository into a versioned one). You can use
qcommit to commit changes to this queue repository.</p>
<p>This command is deprecated. Without -c, it's implied by other relevant
commands. With -c, use <a class="reference external" href="hg.1.html#init"><tt class="docutils literal">hg init <span class="pre">--mq</span></tt></a> instead.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-c</span>, <span class="option">--create-repo</span></kbd></td>
</tr>
<tr><td> </td><td>create queue repository</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qnew">
<h4>qnew</h4>
<pre class="literal-block">
hg qnew [-e] [-m TEXT] [-l FILE] PATCH [FILE]...
</pre>
<p>qnew creates a new patch on top of the currently-applied patch (if
any). The patch will be initialized with any outstanding changes
in the working directory. You may also use -I/--include,
-X/--exclude, and/or a list of files after the patch name to add
only changes to matching files to the new patch, leaving the rest
as uncommitted modifications.</p>
<p>-u/--user and -d/--date can be used to set the (given) user and
date, respectively. -U/--currentuser and -D/--currentdate set user
to current user and date to current date.</p>
<p>-e/--edit, -m/--message or -l/--logfile set the patch header as
well as the commit message. If none is specified, the header is
empty and the commit message is '[mq]: PATCH'.</p>
<p>Use the -g/--git option to keep the patch in the git extended diff
format. Read the diffs help topic for more information on why this
is important for preserving permission changes and copy/rename
information.</p>
<p>Returns 0 on successful creation of a new patch.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td>
<td>edit commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>import uncommitted changes (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td>
<td>use git extended diff format</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-U</span>, <span class="option">--currentuser</span></kbd></td>
</tr>
<tr><td> </td><td>add "From: <current user>" to patch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td>add "From: <USER>" to patch</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-D</span>, <span class="option">--currentdate</span></kbd></td>
</tr>
<tr><td> </td><td>add "Date: <current date>" to patch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>add "Date: <DATE>" to patch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td>
<td>use text as commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td>
<td>read commit message from file</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qnext">
<h4>qnext</h4>
<pre class="literal-block">
hg qnext [-s]
</pre>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--summary</span></kbd></td>
<td>print first line of patch header</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qpop">
<h4>qpop</h4>
<pre class="literal-block">
hg qpop [-a] [-f] [PATCH | INDEX]
</pre>
<p>By default, pops off the top of the patch stack. If given a patch
name, keeps popping off patches until the named patch is at the
top of the stack.</p>
<p>Return 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--all</span></kbd></td>
<td>pop all patches</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--name</span></kbd></td>
<td>queue name to pop (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>forget any local changes to patched files</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qprev">
<h4>qprev</h4>
<pre class="literal-block">
hg qprev [-s]
</pre>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--summary</span></kbd></td>
<td>print first line of patch header</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qpush">
<h4>qpush</h4>
<pre class="literal-block">
hg qpush [-f] [-l] [-a] [--move] [PATCH | INDEX]
</pre>
<p>When -f/--force is applied, all local changes in patched files
will be lost.</p>
<p>Return 0 on succces.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>apply on top of local changes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--list</span></kbd></td>
<td>list patch name in commit text</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--all</span></kbd></td>
<td>apply all patches</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--merge</span></kbd></td>
<td>merge from another queue (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--name</span></kbd></td>
<td>merge queue name (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--move</span></kbd></td>
<td>reorder patch series and apply only the patch</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qqueue">
<h4>qqueue</h4>
<pre class="literal-block">
hg qqueue [OPTION] [QUEUE]
</pre>
<p>Supports switching between different patch queues, as well as creating
new patch queues and deleting existing ones.</p>
<p>Omitting a queue name or specifying -l/--list will show you the registered
queues - by default the "normal" patches queue is registered. The currently
active queue will be marked with "(active)".</p>
<p>To create a new queue, use -c/--create. The queue is automatically made
active, except in the case where there are applied patches from the
currently active queue in the repository. Then the queue will only be
created and switching will fail.</p>
<p>To delete an existing queue, use --delete. You cannot delete the currently
active queue.</p>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--list</span></kbd></td>
<td>list all available queues</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-c</span>, <span class="option">--create</span></kbd></td>
<td>create new queue</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--rename</span></kbd></td>
<td>rename active queue</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--delete</span></kbd></td>
<td>delete reference to queue</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--purge</span></kbd></td>
<td>delete queue, and remove patch dir</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qrefresh">
<h4>qrefresh</h4>
<pre class="literal-block">
hg qrefresh [-I] [-X] [-e] [-m TEXT] [-l FILE] [-s] [FILE]...
</pre>
<p>If any file patterns are provided, the refreshed patch will
contain only the modifications that match those patterns; the
remaining modifications will remain in the working directory.</p>
<p>If -s/--short is specified, files currently included in the patch
will be refreshed just like matched files and remain in the patch.</p>
<p>If -e/--edit is specified, Mercurial will start your configured editor for
you to enter a message. In case qrefresh fails, you will find a backup of
your message in <tt class="docutils literal"><span class="pre">.hg/last-message.txt</span></tt>.</p>
<p>hg add/remove/copy/rename work as usual, though you might want to
use git-style patches (-g/--git or [diff] git=1) to track copies
and renames. See the diffs help topic for more information on the
git diff format.</p>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td>
<td>edit commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td>
<td>use git extended diff format</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--short</span></kbd></td>
<td>refresh only files already in the patch and specified files</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-U</span>, <span class="option">--currentuser</span></kbd></td>
</tr>
<tr><td> </td><td>add/update author field in patch with current user</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td>add/update author field in patch with given user</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-D</span>, <span class="option">--currentdate</span></kbd></td>
</tr>
<tr><td> </td><td>add/update date field in patch with current date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>add/update date field in patch with given date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td>
<td>use text as commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td>
<td>read commit message from file</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qrename">
<h4>qrename</h4>
<pre class="literal-block">
hg qrename PATCH1 [PATCH2]
</pre>
<p>With one argument, renames the current patch to PATCH1.
With two arguments, renames PATCH1 to PATCH2.</p>
<p>Returns 0 on success.</p>
<blockquote>
aliases: qmv</blockquote>
</div>
<div class="section" id="qrestore">
<h4>qrestore</h4>
<pre class="literal-block">
hg qrestore [-d] [-u] REV
</pre>
<p>This command is deprecated, use <a class="reference external" href="hg.1.html#rebase"><tt class="docutils literal">hg rebase</tt></a> instead.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--delete</span></kbd></td>
<td>delete save entry</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--update</span></kbd></td>
<td>update queue working directory</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qsave">
<h4>qsave</h4>
<pre class="literal-block">
hg qsave [-m TEXT] [-l FILE] [-c] [-n NAME] [-e] [-f]
</pre>
<p>This command is deprecated, use <a class="reference external" href="hg.1.html#rebase"><tt class="docutils literal">hg rebase</tt></a> instead.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-c</span>, <span class="option">--copy</span></kbd></td>
<td>copy patch directory</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--name</span></kbd></td>
<td>copy directory name</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--empty</span></kbd></td>
<td>clear queue status file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>force copy</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td>
<td>use text as commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td>
<td>read commit message from file</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qselect">
<h4>qselect</h4>
<pre class="literal-block">
hg qselect [OPTION]... [GUARD]...
</pre>
<p>Use the <a class="reference external" href="hg.1.html#qguard"><tt class="docutils literal">hg qguard</tt></a> command to set or print guards on patch, then use
qselect to tell mq which guards to use. A patch will be pushed if
it has no guards or any positive guards match the currently
selected guard, but will not be pushed if any negative guards
match the current guard. For example:</p>
<pre class="literal-block">
qguard foo.patch -stable (negative guard)
qguard bar.patch +stable (positive guard)
qselect stable
</pre>
<p>This activates the "stable" guard. mq will skip foo.patch (because
it has a negative match) but push bar.patch (because it has a
positive match).</p>
<p>With no arguments, prints the currently active guards.
With one argument, sets the active guard.</p>
<p>Use -n/--none to deactivate guards (no other arguments needed).
When no guards are active, patches with positive guards are
skipped and patches with negative guards are pushed.</p>
<p>qselect can change the guards on applied patches. It does not pop
guarded patches by default. Use --pop to pop back to the last
applied patch that is not guarded. Use --reapply (which implies
--pop) to push back to the current patch afterwards, but skip
guarded patches.</p>
<p>Use -s/--series to print a list of all guards in the series file
(no other arguments needed). Use -v for more information.</p>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--none</span></kbd></td>
<td>disable all guards</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--series</span></kbd></td>
<td>list all guards in series file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--pop</span></kbd></td>
<td>pop to before first guarded applied patch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--reapply</span></kbd></td>
<td>pop, then reapply patches</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qseries">
<h4>qseries</h4>
<pre class="literal-block">
hg qseries [-ms]
</pre>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--missing</span></kbd></td>
<td>print patches not in series</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--summary</span></kbd></td>
<td>print first line of patch header</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qtop">
<h4>qtop</h4>
<pre class="literal-block">
hg qtop [-s]
</pre>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--summary</span></kbd></td>
<td>print first line of patch header</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qunapplied">
<h4>qunapplied</h4>
<pre class="literal-block">
hg qunapplied [-1] [-s] [PATCH]
</pre>
<p>Returns 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-1</span>, <span class="option">--first</span></kbd></td>
<td>show only the first patch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--summary</span></kbd></td>
<td>print first line of patch header</td></tr>
</tbody>
</table>
</div>
<div class="section" id="strip">
<h4>strip</h4>
<pre class="literal-block">
hg strip [-k] [-f] [-n] REV...
</pre>
<p>The strip command removes the specified changesets and all their
descendants. If the working directory has uncommitted changes,
the operation is aborted unless the --force flag is supplied.</p>
<p>If a parent of the working directory is stripped, then the working
directory will automatically be updated to the most recent
available ancestor of the stripped parent after the operation
completes.</p>
<p>Any stripped changesets are stored in <tt class="docutils literal"><span class="pre">.hg/strip-backup</span></tt> as a
bundle (see <a class="reference external" href="hg.1.html#bundle"><tt class="docutils literal">hg help bundle</tt></a> and <a class="reference external" href="hg.1.html#unbundle"><tt class="docutils literal">hg help unbundle</tt></a>). They can
be restored by running <a class="reference external" href="hg.1.html#unbundle"><tt class="docutils literal">hg unbundle <span class="pre">.hg/strip-backup/BUNDLE</span></tt></a>,
where BUNDLE is the bundle file created by the strip. Note that
the local revision numbers will in general be different after the
restore.</p>
<p>Use the --no-backup option to discard the backup bundle once the
operation completes.</p>
<p>Return 0 on success.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>force removal of changesets even if the working directory has uncommitted changes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--backup</span></kbd></td>
<td>bundle only changesets with local revision number greater than REV which are not descendants of REV (DEPRECATED)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-n</span>, <span class="option">--no-backup</span></kbd></td>
</tr>
<tr><td> </td><td>no backups</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--nobackup</span></kbd></td>
<td>no backups (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-k</span>, <span class="option">--keep</span></kbd></td>
<td>do not modify working copy during strip</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="notify">
<h2><a class="toc-backref" href="#id87">notify</a></h2>
<p>hooks for sending email notifications at commit/push time</p>
<p>Subscriptions can be managed through a hgrc file. Default mode is to
print messages to stdout, for testing and configuring.</p>
<p>To use, configure the notify extension and enable it in hgrc like
this:</p>
<pre class="literal-block">
[extensions]
notify =
[hooks]
# one email for each incoming changeset
incoming.notify = python:hgext.notify.hook
# batch emails when many changesets incoming at one time
changegroup.notify = python:hgext.notify.hook
[notify]
# config items go here
</pre>
<p>Required configuration items:</p>
<pre class="literal-block">
config = /path/to/file # file containing subscriptions
</pre>
<p>Optional configuration items:</p>
<pre class="literal-block">
test = True # print messages to stdout for testing
strip = 3 # number of slashes to strip for url paths
domain = example.com # domain to use if committer missing domain
style = ... # style file to use when formatting email
template = ... # template to use when formatting email
incoming = ... # template to use when run as incoming hook
changegroup = ... # template when run as changegroup hook
maxdiff = 300 # max lines of diffs to include (0=none, -1=all)
maxsubject = 67 # truncate subject line longer than this
diffstat = True # add a diffstat before the diff content
sources = serve # notify if source of incoming changes in this list
# (serve == ssh or http, push, pull, bundle)
merge = False # send notification for merges (default True)
[email]
from = user@host.com # email address to send as if none given
[web]
baseurl = http://hgserver/... # root of hg web site for browsing commits
</pre>
<p>The notify config file has same format as a regular hgrc file. It has
two sections so you can express subscriptions in whatever way is
handier for you.</p>
<pre class="literal-block">
[usersubs]
# key is subscriber email, value is ","-separated list of glob patterns
user@host = pattern
[reposubs]
# key is glob pattern, value is ","-separated list of subscriber emails
pattern = user@host
</pre>
<p>Glob patterns are matched against path to repository root.</p>
<p>If you like, you can put notify config file in repository that users
can push changes to, they can manage their own subscriptions.</p>
</div>
<div class="section" id="pager">
<h2><a class="toc-backref" href="#id88">pager</a></h2>
<p>browse command output with an external pager</p>
<p>To set the pager that should be used, set the application variable:</p>
<pre class="literal-block">
[pager]
pager = less -FRSX
</pre>
<p>If no pager is set, the pager extensions uses the environment variable
$PAGER. If neither pager.pager, nor $PAGER is set, no pager is used.</p>
<p>If you notice "BROKEN PIPE" error messages, you can disable them by
setting:</p>
<pre class="literal-block">
[pager]
quiet = True
</pre>
<p>You can disable the pager for certain commands by adding them to the
pager.ignore list:</p>
<pre class="literal-block">
[pager]
ignore = version, help, update
</pre>
<p>You can also enable the pager only for certain commands using
pager.attend. Below is the default list of commands to be paged:</p>
<pre class="literal-block">
[pager]
attend = annotate, cat, diff, export, glog, log, qdiff
</pre>
<p>Setting pager.attend to an empty value will cause all commands to be
paged.</p>
<p>If pager.attend is present, pager.ignore will be ignored.</p>
<p>To ignore global commands like <a class="reference external" href="hg.1.html#version"><tt class="docutils literal">hg version</tt></a> or <a class="reference external" href="hg.1.html#help"><tt class="docutils literal">hg help</tt></a>, you have
to specify them in your user configuration file.</p>
<p>The --pager=... option can also be used to control when the pager is
used. Use a boolean value like yes, no, on, off, or use auto for
normal behavior.</p>
</div>
<div class="section" id="parentrevspec">
<h2><a class="toc-backref" href="#id89">parentrevspec</a></h2>
<p>interpret suffixes to refer to ancestor revisions</p>
<p>This extension allows you to use git-style suffixes to refer to the
ancestors of a specific revision.</p>
<p>For example, if you can refer to a revision as "foo", then:</p>
<pre class="literal-block">
foo^N = Nth parent of foo
foo^0 = foo
foo^1 = first parent of foo
foo^2 = second parent of foo
foo^ = foo^1
foo~N = Nth first grandparent of foo
foo~0 = foo
foo~1 = foo^1 = foo^ = first parent of foo
foo~2 = foo^1^1 = foo^^ = first parent of first parent of foo
</pre>
</div>
<div class="section" id="patchbomb">
<h2><a class="toc-backref" href="#id90">patchbomb</a></h2>
<p>command to send changesets as (a series of) patch emails</p>
<p>The series is started off with a "[PATCH 0 of N]" introduction, which
describes the series as a whole.</p>
<p>Each patch email has a Subject line of "[PATCH M of N] ...", using the
first line of the changeset description as the subject text. The
message contains two or three body parts:</p>
<ul class="simple">
<li>The changeset description.</li>
<li>[Optional] The result of running diffstat on the patch.</li>
<li>The patch itself, as generated by <a class="reference external" href="hg.1.html#export"><tt class="docutils literal">hg export</tt></a>.</li>
</ul>
<p>Each message refers to the first in the series using the In-Reply-To
and References headers, so they will show up as a sequence in threaded
mail and news readers, and in mail archives.</p>
<p>To configure other defaults, add a section like this to your hgrc
file:</p>
<pre class="literal-block">
[email]
from = My Name <my@email>
to = recipient1, recipient2, ...
cc = cc1, cc2, ...
bcc = bcc1, bcc2, ...
reply-to = address1, address2, ...
</pre>
<p>Use <tt class="docutils literal">[patchbomb]</tt> as configuration section name if you need to
override global <tt class="docutils literal">[email]</tt> address settings.</p>
<p>Then you can use the <a class="reference external" href="hg.1.html#email"><tt class="docutils literal">hg email</tt></a> command to mail a series of
changesets as a patchbomb.</p>
<p>You can also either configure the method option in the email section
to be a sendmail compatible mailer or fill out the [smtp] section so
that the patchbomb extension can automatically send patchbombs
directly from the commandline. See the [email] and [smtp] sections in
hgrc(5) for details.</p>
<div class="section" id="id23">
<h3>Commands</h3>
<div class="section" id="email">
<h4>email</h4>
<pre class="literal-block">
hg email [OPTION]... [DEST]...
</pre>
<p>By default, diffs are sent in the format generated by
<a class="reference external" href="hg.1.html#export"><tt class="docutils literal">hg export</tt></a>, one per message. The series starts with a "[PATCH 0
of N]" introduction, which describes the series as a whole.</p>
<p>Each patch email has a Subject line of "[PATCH M of N] ...", using
the first line of the changeset description as the subject text.
The message contains two or three parts. First, the changeset
description.</p>
<p>With the -d/--diffstat option, if the diffstat program is
installed, the result of running diffstat on the patch is inserted.</p>
<p>Finally, the patch itself, as generated by <a class="reference external" href="hg.1.html#export"><tt class="docutils literal">hg export</tt></a>.</p>
<p>With the -d/--diffstat or -c/--confirm options, you will be presented
with a final summary of all messages and asked for confirmation before
the messages are sent.</p>
<p>By default the patch is included as text in the email body for
easy reviewing. Using the -a/--attach option will instead create
an attachment for the patch. With -i/--inline an inline attachment
will be created.</p>
<p>With -o/--outgoing, emails will be generated for patches not found
in the destination repository (or only those which are ancestors
of the specified revisions if any are provided)</p>
<p>With -b/--bundle, changesets are selected as for --outgoing, but a
single email containing a binary Mercurial bundle as an attachment
will be sent.</p>
<p>With -m/--mbox, instead of previewing each patchbomb message in a
pager or sending the messages directly, it will create a UNIX
mailbox file with the patch emails. This mailbox file can be
previewed with any mail user agent which supports UNIX mbox
files.</p>
<p>With -n/--test, all steps will run, but mail will not be sent.
You will be prompted for an email recipient address, a subject and
an introductory message describing the patches of your patchbomb.
Then when all is done, patchbomb messages are displayed. If the
PAGER environment variable is set, your pager will be fired up once
for each patchbomb message, so you can verify everything is alright.</p>
<p>Examples:</p>
<pre class="literal-block">
hg email -r 3000 # send patch 3000 only
hg email -r 3000 -r 3001 # send patches 3000 and 3001
hg email -r 3000:3005 # send patches 3000 through 3005
hg email 3000 # send patch 3000 (deprecated)
hg email -o # send all patches not in default
hg email -o DEST # send all patches not in DEST
hg email -o -r 3000 # send all ancestors of 3000 not in default
hg email -o -r 3000 DEST # send all ancestors of 3000 not in DEST
hg email -b # send bundle of all patches not in default
hg email -b DEST # send bundle of all patches not in DEST
hg email -b -r 3000 # bundle of all ancestors of 3000 not in default
hg email -b -r 3000 DEST # bundle of all ancestors of 3000 not in DEST
hg email -o -m mbox && # generate an mbox file...
mutt -R -f mbox # ... and view it with mutt
hg email -o -m mbox && # generate an mbox file ...
formail -s sendmail \ # ... and use formail to send from the mbox
-bm -t < mbox # ... using sendmail
</pre>
<p>Before using this command, you will need to enable email in your
hgrc. See the [email] section in hgrc(5) for details.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td>
<td>use git extended diff format</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--plain</span></kbd></td>
<td>omit hg patch header</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-o</span>, <span class="option">--outgoing</span></kbd></td>
<td>send changes not found in the target repository</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--bundle</span></kbd></td>
<td>send changes not in target as a binary bundle</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--bundlename</span></kbd></td>
<td>name of the bundle attachment file (default: bundle)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>a revision to send</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--force</span></kbd></td>
<td>run even when remote repository is unrelated (with -b/--bundle)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--base</span></kbd></td>
<td>a base changeset to specify instead of a destination (with -b/--bundle)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--intro</span></kbd></td>
<td>send an introduction email for a single patch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--attach</span></kbd></td>
<td>send patches as attachments</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-i</span>, <span class="option">--inline</span></kbd></td>
<td>send patches as inline attachments</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--bcc</span></kbd></td>
<td>email addresses of blind carbon copy recipients</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-c</span>, <span class="option">--cc</span></kbd></td>
<td>email addresses of copy recipients</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--confirm</span></kbd></td>
<td>ask for confirmation before sending</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--diffstat</span></kbd></td>
<td>add diffstat output to messages</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--date</span></kbd></td>
<td>use the given date as the sending date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--desc</span></kbd></td>
<td>use the given file as the series description</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--from</span></kbd></td>
<td>email address of sender</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--test</span></kbd></td>
<td>print messages that would be sent</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--mbox</span></kbd></td>
<td>write messages to mbox file instead of sending them</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--reply-to</span></kbd></td>
<td>email addresses replies should be sent to</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--subject</span></kbd></td>
<td>subject of first message (intro or single patch)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--in-reply-to</span></kbd></td>
<td>message identifier to reply to</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--flag</span></kbd></td>
<td>flags to add in subject prefixes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-t</span>, <span class="option">--to</span></kbd></td>
<td>email addresses of recipients</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td>
<td>specify ssh command to use</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--remotecmd</span></kbd></td>
<td>specify hg command to run on the remote side</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="progress">
<h2><a class="toc-backref" href="#id91">progress</a></h2>
<p>show progress bars for some actions</p>
<p>This extension uses the progress information logged by hg commands
to draw progress bars that are as informative as possible. Some progress
bars only offer indeterminate information, while others have a definite
end point.</p>
<p>The following settings are available:</p>
<pre class="literal-block">
[progress]
delay = 3 # number of seconds (float) before showing the progress bar
refresh = 0.1 # time in seconds between refreshes of the progress bar
format = topic bar number # format of the progress bar
width = <none> # if set, the maximum width of the progress information
# (that is, min(width, term width) will be used)
clear-complete = True # clear the progress bar after it's done
disable = False # if true, don't show a progress bar
assume-tty = False # if true, ALWAYS show a progress bar, unless
# disable is given
</pre>
<p>Valid entries for the format field are topic, bar, number, unit, and
item. item defaults to the last 20 characters of the item, but this
can be changed by adding either <tt class="docutils literal"><span class="pre">-<num></span></tt> which would take the last
num characters, or <tt class="docutils literal">+<num></tt> for the first num characters.</p>
</div>
<div class="section" id="purge">
<h2><a class="toc-backref" href="#id92">purge</a></h2>
<p>command to delete untracked files from the working directory</p>
<div class="section" id="id24">
<h3>Commands</h3>
<div class="section" id="id25">
<h4>purge</h4>
<pre class="literal-block">
hg purge [OPTION]... [DIR]...
</pre>
<p>Delete files not known to Mercurial. This is useful to test local
and uncommitted changes in an otherwise-clean source tree.</p>
<p>This means that purge will delete:</p>
<ul class="simple">
<li>Unknown files: files marked with "?" by <a class="reference external" href="hg.1.html#status"><tt class="docutils literal">hg status</tt></a></li>
<li>Empty directories: in fact Mercurial ignores directories unless
they contain files under source control management</li>
</ul>
<p>But it will leave untouched:</p>
<ul class="simple">
<li>Modified and unmodified tracked files</li>
<li>Ignored files (unless --all is specified)</li>
<li>New files added to the repository (with <a class="reference external" href="hg.1.html#add"><tt class="docutils literal">hg add</tt></a>)</li>
</ul>
<p>If directories are given on the command line, only files in these
directories are considered.</p>
<p>Be careful with purge, as you could irreversibly delete some files
you forgot to add to the repository. If you only want to print the
list of files that this program would delete, use the --print
option.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-a</span>, <span class="option">--abort-on-err</span></kbd></td>
</tr>
<tr><td> </td><td>abort if an error occurs</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--all</span></kbd></td>
<td>purge ignored files too</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-p</span>, <span class="option">--print</span></kbd></td>
<td>print filenames instead of deleting them</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-0</span>, <span class="option">--print0</span></kbd></td>
<td>end filenames with NUL, for use with xargs (implies -p/--print)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td><p class="first">exclude names matching the given patterns</p>
<p class="last">aliases: clean</p>
</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="rebase">
<h2><a class="toc-backref" href="#id93">rebase</a></h2>
<p>command to move sets of revisions to a different ancestor</p>
<p>This extension lets you rebase changesets in an existing Mercurial
repository.</p>
<p>For more information:
<a class="reference external" href="http://mercurial.selenic.com/wiki/RebaseExtension">http://mercurial.selenic.com/wiki/RebaseExtension</a></p>
<div class="section" id="id26">
<h3>Commands</h3>
<div class="section" id="id27">
<h4>rebase</h4>
<pre class="literal-block">
hg rebase [-s REV | -b REV] [-d REV] [options]
hg rebase {-a|-c}
</pre>
<p>Rebase uses repeated merging to graft changesets from one part of
history (the source) onto another (the destination). This can be
useful for linearizing <em>local</em> changes relative to a master
development tree.</p>
<p>You should not rebase changesets that have already been shared
with others. Doing so will force everybody else to perform the
same rebase or they will end up with duplicated changesets after
pulling in your rebased changesets.</p>
<p>If you don't specify a destination changeset (<tt class="docutils literal"><span class="pre">-d/--dest</span></tt>),
rebase uses the tipmost head of the current named branch as the
destination. (The destination changeset is not modified by
rebasing, but new changesets are added as its descendants.)</p>
<p>You can specify which changesets to rebase in two ways: as a
"source" changeset or as a "base" changeset. Both are shorthand
for a topologically related set of changesets (the "source
branch"). If you specify source (<tt class="docutils literal"><span class="pre">-s/--source</span></tt>), rebase will
rebase that changeset and all of its descendants onto dest. If you
specify base (<tt class="docutils literal"><span class="pre">-b/--base</span></tt>), rebase will select ancestors of base
back to but not including the common ancestor with dest. Thus,
<tt class="docutils literal"><span class="pre">-b</span></tt> is less precise but more convenient than <tt class="docutils literal"><span class="pre">-s</span></tt>: you can
specify any changeset in the source branch, and rebase will select
the whole branch. If you specify neither <tt class="docutils literal"><span class="pre">-s</span></tt> nor <tt class="docutils literal"><span class="pre">-b</span></tt>, rebase
uses the parent of the working directory as the base.</p>
<p>By default, rebase recreates the changesets in the source branch
as descendants of dest and then destroys the originals. Use
<tt class="docutils literal"><span class="pre">--keep</span></tt> to preserve the original source changesets. Some
changesets in the source branch (e.g. merges from the destination
branch) may be dropped if they no longer contribute any change.</p>
<p>One result of the rules for selecting the destination changeset
and source branch is that, unlike <tt class="docutils literal">merge</tt>, rebase will do
nothing if you are at the latest (tipmost) head of a named branch
with two heads. You need to explicitly specify source and/or
destination (or <tt class="docutils literal">update</tt> to the other head, if it's the head of
the intended source branch).</p>
<p>If a rebase is interrupted to manually resolve a merge, it can be
continued with --continue/-c or aborted with --abort/-a.</p>
<p>Returns 0 on success, 1 if nothing to rebase.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--source</span></kbd></td>
<td>rebase from the specified changeset</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--base</span></kbd></td>
<td>rebase from the base of the specified changeset (up to greatest common ancestor of base and dest)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--dest</span></kbd></td>
<td>rebase onto the specified changeset</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--collapse</span></kbd></td>
<td>collapse the rebased changesets</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--keep</span></kbd></td>
<td>keep original changesets</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--keepbranches</span></kbd></td>
<td>keep original branch names</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--detach</span></kbd></td>
<td>force detaching of source from its original branch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-c</span>, <span class="option">--continue</span></kbd></td>
<td>continue an interrupted rebase</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--abort</span></kbd></td>
<td>abort an interrupted rebase</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--style</span></kbd></td>
<td>display using template map file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--template</span></kbd></td>
<td>display with template</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="record">
<h2><a class="toc-backref" href="#id94">record</a></h2>
<p>commands to interactively select changes for commit/qrefresh</p>
<div class="section" id="id28">
<h3>Commands</h3>
<div class="section" id="id29">
<h4>record</h4>
<pre class="literal-block">
hg record [OPTION]... [FILE]...
</pre>
<p>If a list of files is omitted, all changes reported by <a class="reference external" href="hg.1.html#status"><tt class="docutils literal">hg status</tt></a>
will be candidates for recording.</p>
<p>See <a class="reference external" href="hg.1.html#dates"><tt class="docutils literal">hg help dates</tt></a> for a list of formats valid for -d/--date.</p>
<p>You will be prompted for whether to record changes to each
modified file, and for files with multiple changes, for each
change to use. For each query, the following responses are
possible:</p>
<pre class="literal-block">
y - record this change
n - skip this change
s - skip remaining changes to this file
f - record remaining changes to this file
d - done, skip remaining changes and files
a - record all changes to all remaining files
q - quit, recording no changes
? - display help
</pre>
<p>This command is not available when committing a merge.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-A</span>, <span class="option">--addremove</span></kbd></td>
</tr>
<tr><td> </td><td>mark new/missing files as added/removed before committing</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--close-branch</span></kbd></td>
<td>mark a branch as closed, hiding it from the branch list</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td>
<td>use text as commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td>
<td>read commit message from file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>record datecode as commit date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td>record the specified user as committer</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="relink">
<h2><a class="toc-backref" href="#id95">relink</a></h2>
<p>recreates hardlinks between repository clones</p>
<div class="section" id="id30">
<h3>Commands</h3>
<div class="section" id="id31">
<h4>relink</h4>
<pre class="literal-block">
hg relink [ORIGIN]
</pre>
<p>When repositories are cloned locally, their data files will be
hardlinked so that they only use the space of a single repository.</p>
<p>Unfortunately, subsequent pulls into either repository will break
hardlinks for any files touched by the new changesets, even if
both repositories end up pulling the same changes.</p>
<p>Similarly, passing --rev to "hg clone" will fail to use any
hardlinks, falling back to a complete copy of the source
repository.</p>
<p>This command lets you recreate those hardlinks and reclaim that
wasted space.</p>
<p>This repository will be relinked to share space with ORIGIN, which
must be on the same local disk. If ORIGIN is omitted, looks for
"default-relink", then "default", in [paths].</p>
<p>Do not attempt any read operations on this repository while the
command is running. (Both repositories will be locked against
writes.)</p>
</div>
</div>
</div>
<div class="section" id="schemes">
<h2><a class="toc-backref" href="#id96">schemes</a></h2>
<p>extend schemes with shortcuts to repository swarms</p>
<p>This extension allows you to specify shortcuts for parent URLs with a
lot of repositories to act like a scheme, for example:</p>
<pre class="literal-block">
[schemes]
py = http://code.python.org/hg/
</pre>
<p>After that you can use it like:</p>
<pre class="literal-block">
hg clone py://trunk/
</pre>
<p>Additionally there is support for some more complex schemas, for
example used by Google Code:</p>
<pre class="literal-block">
[schemes]
gcode = http://{1}.googlecode.com/hg/
</pre>
<p>The syntax is taken from Mercurial templates, and you have unlimited
number of variables, starting with <tt class="docutils literal">{1}</tt> and continuing with
<tt class="docutils literal">{2}</tt>, <tt class="docutils literal">{3}</tt> and so on. This variables will receive parts of URL
supplied, split by <tt class="docutils literal">/</tt>. Anything not specified as <tt class="docutils literal">{part}</tt> will be
just appended to an URL.</p>
<p>For convenience, the extension adds these schemes by default:</p>
<pre class="literal-block">
[schemes]
py = http://hg.python.org/
bb = https://bitbucket.org/
bb+ssh = ssh://hg@bitbucket.org/
gcode = https://{1}.googlecode.com/hg/
kiln = https://{1}.kilnhg.com/Repo/
</pre>
<p>You can override a predefined scheme by defining a new scheme with the
same name.</p>
</div>
<div class="section" id="share">
<h2><a class="toc-backref" href="#id97">share</a></h2>
<p>share a common history between several working directories</p>
<div class="section" id="id32">
<h3>Commands</h3>
<div class="section" id="id33">
<h4>share</h4>
<pre class="literal-block">
hg share [-U] SOURCE [DEST]
</pre>
<p>Initialize a new repository and working directory that shares its
history with another repository.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">using rollback or extensions that destroy/modify history (mq,
rebase, etc.) can cause considerable confusion with shared
clones. In particular, if two shared clones are both updated to
the same changeset, and one of them destroys that changeset
with rollback, the other clone will suddenly stop working: all
operations will fail with "abort: working directory has unknown
parent". The only known workaround is to use debugsetparents on
the broken clone to reset it to a changeset that still exists
(e.g. tip).</p>
</div>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-U</span>, <span class="option">--noupdate</span></kbd></td>
<td>do not create a working copy</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="transplant">
<h2><a class="toc-backref" href="#id98">transplant</a></h2>
<p>command to transplant changesets from another branch</p>
<p>This extension allows you to transplant patches from another branch.</p>
<p>Transplanted patches are recorded in .hg/transplant/transplants, as a
map from a changeset hash to its hash in the source repository.</p>
<div class="section" id="id34">
<h3>Commands</h3>
<div class="section" id="id35">
<h4>transplant</h4>
<pre class="literal-block">
hg transplant [-s REPO] [-b BRANCH [-a]] [-p REV] [-m REV] [REV]...
</pre>
<p>Selected changesets will be applied on top of the current working
directory with the log of the original changeset. If --log is
specified, log messages will have a comment appended of the form:</p>
<pre class="literal-block">
(transplanted from CHANGESETHASH)
</pre>
<p>You can rewrite the changelog message with the --filter option.
Its argument will be invoked with the current changelog message as
$1 and the patch as $2.</p>
<p>If --source/-s is specified, selects changesets from the named
repository. If --branch/-b is specified, selects changesets from
the branch holding the named revision, up to that revision. If
--all/-a is specified, all changesets on the branch will be
transplanted, otherwise you will be prompted to select the
changesets you want.</p>
<p><a class="reference external" href="hg.1.html#transplant"><tt class="docutils literal">hg transplant <span class="pre">--branch</span> REVISION <span class="pre">--all</span></tt></a> will rebase the selected
branch (up to the named revision) onto your current working
directory.</p>
<p>You can optionally mark selected transplanted changesets as merge
changesets. You will not be prompted to transplant any ancestors
of a merged transplant, and you can merge descendants of them
normally instead of transplanting them.</p>
<p>If no merges or revisions are provided, <a class="reference external" href="hg.1.html#transplant"><tt class="docutils literal">hg transplant</tt></a> will
start an interactive changeset browser.</p>
<p>If a changeset application fails, you can fix the merge by hand
and then resume where you left off by calling <a class="reference external" href="hg.1.html#transplant"><tt class="docutils literal">hg transplant
<span class="pre">--continue/-c</span></tt></a>.</p>
<p>options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--source</span></kbd></td>
<td>pull patches from REPO</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td>
<td>pull patches from branch BRANCH</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--all</span></kbd></td>
<td>pull all changesets up to BRANCH</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-p</span>, <span class="option">--prune</span></kbd></td>
<td>skip over REV</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--merge</span></kbd></td>
<td>merge at REV</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--log</span></kbd></td>
<td>append transplant info to log message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-c</span>, <span class="option">--continue</span></kbd></td>
<td>continue last transplant session after repair</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--filter</span></kbd></td>
<td>filter changesets through command</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="win32mbcs">
<h2><a class="toc-backref" href="#id99">win32mbcs</a></h2>
<p>allow the use of MBCS paths with problematic encodings</p>
<p>Some MBCS encodings are not good for some path operations (i.e.
splitting path, case conversion, etc.) with its encoded bytes. We call
such a encoding (i.e. shift_jis and big5) as "problematic encoding".
This extension can be used to fix the issue with those encodings by
wrapping some functions to convert to Unicode string before path
operation.</p>
<p>This extension is useful for:</p>
<ul class="simple">
<li>Japanese Windows users using shift_jis encoding.</li>
<li>Chinese Windows users using big5 encoding.</li>
<li>All users who use a repository with one of problematic encodings on
case-insensitive file system.</li>
</ul>
<p>This extension is not needed for:</p>
<ul class="simple">
<li>Any user who use only ASCII chars in path.</li>
<li>Any user who do not use any of problematic encodings.</li>
</ul>
<p>Note that there are some limitations on using this extension:</p>
<ul class="simple">
<li>You should use single encoding in one repository.</li>
<li>If the repository path ends with 0x5c, .hg/hgrc cannot be read.</li>
<li>win32mbcs is not compatible with fixutf8 extention.</li>
</ul>
<p>By default, win32mbcs uses encoding.encoding decided by Mercurial.
You can specify the encoding by config option:</p>
<pre class="literal-block">
[win32mbcs]
encoding = sjis
</pre>
<p>It is useful for the users who want to commit with UTF-8 log message.</p>
</div>
<div class="section" id="win32text">
<h2><a class="toc-backref" href="#id100">win32text</a></h2>
<p>perform automatic newline conversion</p>
<blockquote>
<p>Deprecation: The win32text extension requires each user to configure
the extension again and again for each clone since the configuration
is not copied when cloning.</p>
<p>We have therefore made the <tt class="docutils literal">eol</tt> as an alternative. The <tt class="docutils literal">eol</tt>
uses a version controlled file for its configuration and each clone
will therefore use the right settings from the start.</p>
</blockquote>
<p>To perform automatic newline conversion, use:</p>
<pre class="literal-block">
[extensions]
win32text =
[encode]
** = cleverencode:
# or ** = macencode:
[decode]
** = cleverdecode:
# or ** = macdecode:
</pre>
<p>If not doing conversion, to make sure you do not commit CRLF/CR by accident:</p>
<pre class="literal-block">
[hooks]
pretxncommit.crlf = python:hgext.win32text.forbidcrlf
# or pretxncommit.cr = python:hgext.win32text.forbidcr
</pre>
<p>To do the same check on a server to prevent CRLF/CR from being
pushed or pulled:</p>
<pre class="literal-block">
[hooks]
pretxnchangegroup.crlf = python:hgext.win32text.forbidcrlf
# or pretxnchangegroup.cr = python:hgext.win32text.forbidcr
</pre>
</div>
<div class="section" id="zeroconf">
<h2><a class="toc-backref" href="#id101">zeroconf</a></h2>
<p>discover and advertise repositories on the local network</p>
<p>Zeroconf-enabled repositories will be announced in a network without
the need to configure a server or a service. They can be discovered
without knowing their actual IP address.</p>
<p>To allow other people to discover your repository using run
<a class="reference external" href="hg.1.html#serve"><tt class="docutils literal">hg serve</tt></a> in your repository:</p>
<pre class="literal-block">
$ cd test
$ hg serve
</pre>
<p>You can discover Zeroconf-enabled repositories by running
<a class="reference external" href="hg.1.html#paths"><tt class="docutils literal">hg paths</tt></a>:</p>
<pre class="literal-block">
$ hg paths
zc-test = http://example.com:8000/test
</pre>
</div>
</div>
<div class="section" id="files">
<h1><a class="toc-backref" href="#contents">Files</a></h1>
<dl class="docutils">
<dt><tt class="docutils literal">.hgignore</tt></dt>
<dd>This file contains regular expressions (one per line) that
describe file names that should be ignored by <strong>hg</strong>. For details,
see <a class="reference external" href="hgignore.5.html"><strong>hgignore</strong>(5)</a>.</dd>
<dt><tt class="docutils literal">.hgtags</tt></dt>
<dd>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.</dd>
<dt><tt class="docutils literal">/etc/mercurial/hgrc</tt>, <tt class="docutils literal"><span class="pre">$HOME/.hgrc</span></tt>, <tt class="docutils literal">.hg/hgrc</tt></dt>
<dd>This file contains defaults and configuration. Values in
<tt class="docutils literal">.hg/hgrc</tt> override those in <tt class="docutils literal"><span class="pre">$HOME/.hgrc</span></tt>, and these override
settings made in the global <tt class="docutils literal">/etc/mercurial/hgrc</tt> configuration.
See <a class="reference external" href="hgrc.5.html"><strong>hgrc</strong>(5)</a> for details of the contents and format of these
files.</dd>
</dl>
<p>Some commands (e.g. revert) produce backup files ending in <tt class="docutils literal">.orig</tt>,
if the <tt class="docutils literal">.orig</tt> file already exists and is not tracked by Mercurial,
it will be overwritten.</p>
</div>
<div class="section" id="bugs">
<h1><a class="toc-backref" href="#contents">Bugs</a></h1>
<p>Probably lots, please post them to the mailing list (see <a class="reference internal" href="#resources">Resources</a>
below) when you find them.</p>
</div>
<div class="section" id="see-also">
<h1><a class="toc-backref" href="#contents">See Also</a></h1>
<p><a class="reference external" href="hgignore.5.html"><strong>hgignore</strong>(5)</a>, <a class="reference external" href="hgrc.5.html"><strong>hgrc</strong>(5)</a></p>
</div>
<div class="section" id="author">
<h1><a class="toc-backref" href="#contents">Author</a></h1>
<p>Written by Matt Mackall <<a class="reference external" href="mailto:mpm@selenic.com">mpm@selenic.com</a>></p>
</div>
<div class="section" id="resources">
<h1><a class="toc-backref" href="#contents">Resources</a></h1>
<p>Main Web Site: <a class="reference external" href="http://mercurial.selenic.com/">http://mercurial.selenic.com/</a></p>
<p>Source code repository: <a class="reference external" href="http://selenic.com/hg">http://selenic.com/hg</a></p>
<p>Mailing list: <a class="reference external" href="http://selenic.com/mailman/listinfo/mercurial">http://selenic.com/mailman/listinfo/mercurial</a></p>
</div>
<div class="section" id="copying">
<h1><a class="toc-backref" href="#contents">Copying</a></h1>
<p>Copyright (C) 2005-2010 Matt Mackall.
Free use of this software is granted under the terms of the GNU General
Public License version 2 or any later version.</p>
<!-- Common link and substitution definitions. -->
</div>
</div>
</body>
</html>