- <?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.12: 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">
- <span id="hg-1"></span>
- <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="id56">Synopsis</a></li>
- <li><a class="reference internal" href="#description" id="id57">Description</a></li>
- <li><a class="reference internal" href="#command-elements" id="id58">Command Elements</a></li>
- <li><a class="reference internal" href="#options" id="id59">Options</a></li>
- <li><a class="reference internal" href="#commands" id="id60">Commands</a></li>
- <li><a class="reference internal" href="#date-formats" id="id61">Date Formats</a></li>
- <li><a class="reference internal" href="#diff-formats" id="id62">Diff Formats</a></li>
- <li><a class="reference internal" href="#environment-variables" id="id63">Environment Variables</a></li>
- <li><a class="reference internal" href="#using-additional-features" id="id64">Using Additional Features</a></li>
- <li><a class="reference internal" href="#specifying-file-sets" id="id65">Specifying File Sets</a></li>
- <li><a class="reference internal" href="#id1" id="id66">Glossary</a></li>
- <li><a class="reference internal" href="#syntax-for-mercurial-ignore-files" id="id67">Syntax for Mercurial Ignore Files</a></li>
- <li><a class="reference internal" href="#configuring-hgweb" id="id68">Configuring hgweb</a></li>
- <li><a class="reference internal" href="#id10" id="id69">Merge Tools</a></li>
- <li><a class="reference internal" href="#specifying-multiple-revisions" id="id70">Specifying Multiple Revisions</a></li>
- <li><a class="reference internal" href="#file-name-patterns" id="id71">File Name Patterns</a></li>
- <li><a class="reference internal" href="#working-with-phases" id="id72">Working with Phases</a></li>
- <li><a class="reference internal" href="#specifying-single-revisions" id="id73">Specifying Single Revisions</a></li>
- <li><a class="reference internal" href="#specifying-revision-sets" id="id74">Specifying Revision Sets</a></li>
- <li><a class="reference internal" href="#using-mercurial-from-scripts-and-automation" id="id75">Using Mercurial from scripts and automation</a></li>
- <li><a class="reference internal" href="#subrepositories" id="id76">Subrepositories</a></li>
- <li><a class="reference internal" href="#template-usage" id="id77">Template Usage</a></li>
- <li><a class="reference internal" href="#url-paths" id="id78">URL Paths</a></li>
- <li><a class="reference internal" href="#id12" id="id79">Extensions</a></li>
- <li><a class="reference internal" href="#id54" id="id80">Files</a></li>
- <li><a class="reference internal" href="#bugs" id="id81">Bugs</a></li>
- <li><a class="reference internal" href="#see-also" id="id82">See Also</a></li>
- <li><a class="reference internal" href="#author" id="id83">Author</a></li>
- <li><a class="reference internal" href="#resources" id="id84">Resources</a></li>
- <li><a class="reference internal" href="#copying" id="id85">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 <var><REPO></var></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 <var><DIR></var></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, automatically pick the first choice for all prompts</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" colspan="2">
- <kbd><span class="option">--config <var><CONFIG[+]></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">--encoding <var><ENCODE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>set the charset encoding (default: UTF-8)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--encodingmode <var><MODE></var></span></kbd></td>
- </tr>
- <tr><td> </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>
- <tr><td class="option-group">
- <kbd><span class="option">--hidden</span></kbd></td>
- <td>consider hidden changesets</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- <div class="section" id="commands">
- <h1><a class="toc-backref" href="#contents">Commands</a></h1>
- <div class="section" id="add">
- <h2>add</h2>
- <p>add the specified files on the next commit:</p>
- <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" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </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>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- <div class="section" id="addremove">
- <h2>addremove</h2>
- <p>add all new files, delete all missing files:</p>
- <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
- <tt class="docutils literal">.hgignore</tt>. As with add, these changes take effect at the next
- commit.</p>
- <p>Use the -s/--similarity option to detect renamed files. This
- option takes a percentage between 0 (disabled) and 100 (files must
- be identical) as its parameter. With a parameter greater than 0,
- this compares every removed file with every added file and records
- those similar enough as renames. Detecting renamed files this way
- can be expensive. After using this option, <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. If
- not specified, -s/--similarity defaults to 100 and only renames of
- identical files are detected.</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 <var><SIMILARITY></var></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">-S</span>, <span class="option">--subrepos</span></kbd></td>
- <td>recurse into subrepositories</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </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>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- <div class="section" id="annotate">
- <h2>annotate</h2>
- <p>show changeset information by line for each file:</p>
- <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" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV></var></span></kbd></td>
- </tr>
- <tr><td> </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" 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" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>exclude names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-T</span>, <span class="option">--template <var><TEMPLATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>display with template (EXPERIMENTAL)</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- <blockquote>
- aliases: blame</blockquote>
- </div>
- <div class="section" id="archive">
- <h2>archive</h2>
- <p>create an unversioned archive of a repository revision:</p>
- <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>
- <div class="verbose container">
- <p>Examples:</p>
- <ul>
- <li><p class="first">create a zip file containing the 1.0 release:</p>
- <pre class="literal-block">
- hg archive -r 1.0 project-1.0.zip
- </pre>
- </li>
- <li><p class="first">create a tarball excluding .hg files:</p>
- <pre class="literal-block">
- hg archive project.tar.gz -X ".hg*"
- </pre>
- </li>
- </ul>
- </div>
- <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" colspan="2">
- <kbd><span class="option">-p</span>, <span class="option">--prefix <var><PREFIX></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>directory prefix for files in archive</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>revision to distribute</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-t</span>, <span class="option">--type <var><TYPE></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>exclude names matching the given patterns</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- <div class="section" id="backout">
- <h2>backout</h2>
- <p>reverse effect of earlier changeset:</p>
- <pre class="literal-block">
- hg backout [OPTION]... [-r] REV
- </pre>
- <p>Prepare a new changeset with the effect of REV undone in the
- current working directory.</p>
- <p>If REV is the parent of the working directory, then this new changeset
- is committed automatically. Otherwise, hg needs to merge the
- changes and the merged result is left uncommitted.</p>
- <div class="note">
- <p class="first admonition-title">Note</p>
- <p class="last">backout cannot be used to fix either an unwanted or
- incorrect merge.</p>
- </div>
- <div class="verbose container">
- <p>By default, the pending changeset will have one parent,
- maintaining a linear history. With --merge, the pending
- changeset will instead have two parents: the old parent of the
- working directory and a new child of REV that simply undoes REV.</p>
- <p>Before version 1.7, the behavior without --merge was equivalent
- to specifying --merge followed by <a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update <span class="pre">--clean</span> .</tt></a> to
- cancel the merge and leave the child of REV as a head to be
- merged separately.</p>
- </div>
- <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 to backout or 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">--merge</span></kbd></td>
- <td>merge with old dirstate parent after backout</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--commit</span></kbd></td>
- <td>commit if no conflicts were encountered</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--parent <var><REV></var></span></kbd></td>
- <td>parent to choose when backing out merge (DEPRECATED)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>revision to backout</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td>
- <td>invoke editor on commit messages</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-t</span>, <span class="option">--tool <var><VALUE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify merge tool</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>exclude names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-m</span>, <span class="option">--message <var><TEXT></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>use text as commit message</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-l</span>, <span class="option">--logfile <var><FILE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>read commit message from file</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-d</span>, <span class="option">--date <var><DATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>record the specified date as commit date</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-u</span>, <span class="option">--user <var><USER></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>record the specified user as committer</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- <div class="section" id="bisect">
- <h2>bisect</h2>
- <p>subdivision search of changesets:</p>
- <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.
- The environment variable HG_NODE will contain the ID of the
- changeset being tested. The exit status of the command will be
- used to mark revisions as good or bad: status 0 means good, 125
- means to skip the revision, 127 (command not found) will abort the
- bisection, and any other non-zero exit status means the revision
- is bad.</p>
- <div class="verbose container">
- <p>Some examples:</p>
- <ul>
- <li><p class="first">start a bisection with known bad revision 34, and good revision 12:</p>
- <pre class="literal-block">
- hg bisect --bad 34
- hg bisect --good 12
- </pre>
- </li>
- <li><p class="first">advance the current bisection by marking current revision as good or
- bad:</p>
- <pre class="literal-block">
- hg bisect --good
- hg bisect --bad
- </pre>
- </li>
- <li><p class="first">mark the current revision, or a known revision, to be skipped (e.g. if
- that revision is not usable because of another issue):</p>
- <pre class="literal-block">
- hg bisect --skip
- hg bisect --skip 23
- </pre>
- </li>
- <li><p class="first">skip all revisions that do not touch directories <tt class="docutils literal">foo</tt> or <tt class="docutils literal">bar</tt>:</p>
- <pre class="literal-block">
- hg bisect --skip "!( file('path:foo') & file('path:bar') )"
- </pre>
- </li>
- <li><p class="first">forget the current bisection:</p>
- <pre class="literal-block">
- hg bisect --reset
- </pre>
- </li>
- <li><p class="first">use 'make && make tests' to automatically find the first broken
- revision:</p>
- <pre class="literal-block">
- hg bisect --reset
- hg bisect --bad 34
- hg bisect --good 12
- hg bisect --command "make && make tests"
- </pre>
- </li>
- <li><p class="first">see all changesets whose states are already known in the current
- bisection:</p>
- <pre class="literal-block">
- hg log -r "bisect(pruned)"
- </pre>
- </li>
- <li><p class="first">see the changeset currently being bisected (especially useful
- if running with -U/--noupdate):</p>
- <pre class="literal-block">
- hg log -r "bisect(current)"
- </pre>
- </li>
- <li><p class="first">see all changesets that took part in the current bisection:</p>
- <pre class="literal-block">
- hg log -r "bisect(range)"
- </pre>
- </li>
- <li><p class="first">you can even get a nice graph:</p>
- <pre class="literal-block">
- hg log --graph -r "bisect(range)"
- </pre>
- </li>
- </ul>
- <p>See <a class="reference external" href="hg.1.html#revsets"><tt class="docutils literal">hg help revsets</tt></a> for more about the <cite>bisect()</cite> keyword.</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">-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">-e</span>, <span class="option">--extend</span></kbd></td>
- <td>extend the bisect range</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-c</span>, <span class="option">--command <var><CMD></var></span></kbd></td>
- </tr>
- <tr><td> </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="bookmarks">
- <h2>bookmarks</h2>
- <p>create a new bookmark or list existing bookmarks:</p>
- <pre class="literal-block">
- hg bookmarks [OPTIONS]... [NAME]...
- </pre>
- <p>Bookmarks are labels on changesets to help track lines of development.
- Bookmarks are unversioned and can be moved, renamed and deleted.
- Deleting or moving a bookmark has no effect on the associated changesets.</p>
- <p>Creating or updating to a bookmark causes it to be marked as 'active'.
- The active bookmark is indicated with a '*'.
- When a commit is made, the active bookmark will advance to the new commit.
- A plain <a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update</tt></a> will also advance an active bookmark, if possible.
- Updating away from a bookmark will cause it to be deactivated.</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>). If a shared bookmark has
- diverged, a new 'divergent bookmark' of the form <a class="reference external" href="mailto:'name@path">'name@path</a>' will
- be created. Using <a class="reference external" href="hg.1.html#merge"><tt class="docutils literal">hg merge</tt></a> will resolve the divergence.</p>
- <p>A bookmark named '@' has the special property that <a class="reference external" href="hg.1.html#clone"><tt class="docutils literal">hg clone</tt></a> will
- check it out by default if it exists.</p>
- <div class="verbose container">
- <p>Examples:</p>
- <ul>
- <li><p class="first">create an active bookmark for a new line of development:</p>
- <pre class="literal-block">
- hg book new-feature
- </pre>
- </li>
- <li><p class="first">create an inactive bookmark as a place marker:</p>
- <pre class="literal-block">
- hg book -i reviewed
- </pre>
- </li>
- <li><p class="first">create an inactive bookmark on another changeset:</p>
- <pre class="literal-block">
- hg book -r .^ tested
- </pre>
- </li>
- <li><p class="first">move the '@' bookmark from another branch:</p>
- <pre class="literal-block">
- hg book -f @
- </pre>
- </li>
- </ul>
- </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">-f</span>, <span class="option">--force</span></kbd></td>
- <td>force</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">-m</span>, <span class="option">--rename <var><NAME></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>rename a given bookmark</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-i</span>, <span class="option">--inactive</span></kbd></td>
- <td>mark a bookmark inactive</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-T</span>, <span class="option">--template <var><TEMPLATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td><p class="first">display with template (EXPERIMENTAL)</p>
- <p class="last">aliases: bookmark</p>
- </td></tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="branch">
- <h2>branch</h2>
- <p>set or show the current branch name:</p>
- <pre class="literal-block">
- hg branch [-fC] [NAME]
- </pre>
- <div class="note">
- <p class="first admonition-title">Note</p>
- <p class="last">Branch names are permanent and global. Use <a class="reference external" href="hg.1.html#bookmark"><tt class="docutils literal">hg bookmark</tt></a> to create a
- light-weight bookmark instead. See <a class="reference external" href="hg.1.html#glossary"><tt class="docutils literal">hg help glossary</tt></a> for more
- information about named branches and bookmarks.</p>
- </div>
- <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.</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 head as closed.
- When all heads of the branch are closed, the branch will be
- considered 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>
- <p>list repository named branches:</p>
- <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>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 (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 branches</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-T</span>, <span class="option">--template <var><TEMPLATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>display with template (EXPERIMENTAL)</td></tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="bundle">
- <h2>bundle</h2>
- <p>create a changegroup file:</p>
- <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" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>a changeset intended to be added to the destination</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-b</span>, <span class="option">--branch <var><BRANCH[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>a specific branch you would like to bundle</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--base <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">-t</span>, <span class="option">--type <var><TYPE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>bundle compression type to use (default: bzip2)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-e</span>, <span class="option">--ssh <var><CMD></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify ssh command to use</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--remotecmd <var><CMD></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify hg command to run on the remote side</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--insecure</span></kbd></td>
- <td>do not verify server certificate (ignoring web.cacerts config)</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- <div class="section" id="cat">
- <h2>cat</h2>
- <p>output the current or given revision of files:</p>
- <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.</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 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">%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>
- <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">%R</tt>:</th><td class="field-body">changeset revision number</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">%r</tt>:</th><td class="field-body">zero-padded 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>
- </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" colspan="2">
- <kbd><span class="option">-o</span>, <span class="option">--output <var><FORMAT></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>print output to file with formatted name</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>exclude names matching the given patterns</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- <div class="section" id="clone">
- <h2>clone</h2>
- <p>make a copy of an existing repository:</p>
- <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
- <tt class="docutils literal">.hg/hgrc</tt> file, as the default to be used for future pulls.</p>
- <p>Only local paths and <tt class="docutils literal"><span class="pre">ssh://</span></tt> URLs are supported as
- destinations. For <tt class="docutils literal"><span class="pre">ssh://</span></tt> destinations, no working directory or
- <tt class="docutils literal">.hg/hgrc</tt> will be created on the remote side.</p>
- <p>To pull only a subset of changesets, specify one or more revisions
- identifiers with -r/--rev or branches with -b/--branch. The
- resulting clone will contain only the specified changesets and
- their ancestors. These options (or 'clone src#rev dest') imply
- --pull, even for local source repositories. Note that specifying a
- tag will include the tagged changeset but not the changeset
- containing the tag.</p>
- <p>If the source repository has a bookmark called '@' set, that
- revision will be checked out in the new repository by default.</p>
- <p>To check out a particular version, use -u/--update, or
- -U/--noupdate to create a clone with no working directory.</p>
- <div class="verbose container">
- <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 revision marked with the '@' bookmark, if present</li>
- <li>the tipmost head of the default branch</li>
- <li>tip</li>
- </ol>
- <p>Examples:</p>
- <ul>
- <li><p class="first">clone a remote repository to a new directory named hg/:</p>
- <pre class="literal-block">
- hg clone http://selenic.com/hg
- </pre>
- </li>
- <li><p class="first">create a lightweight local clone:</p>
- <pre class="literal-block">
- hg clone project/ project-feature/
- </pre>
- </li>
- <li><p class="first">clone from an absolute path on an ssh server (note double-slash):</p>
- <pre class="literal-block">
- hg clone ssh://user@server//home/projects/alpha/
- </pre>
- </li>
- <li><p class="first">do a high-speed clone over a LAN while checking out a
- specified version:</p>
- <pre class="literal-block">
- hg clone --uncompressed http://server/repo -u 1.5
- </pre>
- </li>
- <li><p class="first">create a repository without changesets after a particular revision:</p>
- <pre class="literal-block">
- hg clone -r 04e544 experimental/ good/
- </pre>
- </li>
- <li><p class="first">clone (and track) a particular named branch:</p>
- <pre class="literal-block">
- hg clone http://selenic.com/hg#stable
- </pre>
- </li>
- </ul>
- </div>
- <p>See <a class="reference external" href="hg.1.html#urls"><tt class="docutils literal">hg help urls</tt></a> for details on specifying URLs.</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">-U</span>, <span class="option">--noupdate</span></kbd></td>
- <td>the clone will include an empty working directory (only a repository)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-u</span>, <span class="option">--updaterev <var><REV></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>revision, tag or branch to check out</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include the specified changeset</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-b</span>, <span class="option">--branch <var><BRANCH[+]></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">-e</span>, <span class="option">--ssh <var><CMD></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify ssh command to use</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--remotecmd <var><CMD></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify hg command to run on the remote side</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--insecure</span></kbd></td>
- <td>do not verify server certificate (ignoring web.cacerts config)</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- <div class="section" id="commit">
- <h2>commit</h2>
- <p>commit the specified files or all outstanding changes:</p>
- <pre class="literal-block">
- hg commit [OPTION]... [FILE]...
- </pre>
- <p>Commit changes to the given files into the repository. Unlike a
- centralized SCM, 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>The --close-branch flag can be used to mark the current branch
- head closed. When all heads of a branch are closed, the branch
- will be considered closed and no longer listed.</p>
- <p>The --amend flag can be used to amend the parent of the
- working directory with a new commit that contains the changes
- in the parent in addition to those currently reported by <a class="reference external" href="hg.1.html#status"><tt class="docutils literal">hg status</tt></a>,
- if there are any. The old commit is stored in a backup bundle in
- <tt class="docutils literal"><span class="pre">.hg/strip-backup</span></tt> (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>
- on how to restore it).</p>
- <p>Message, user and date are taken from the amended commit unless
- specified. When a message isn't specified on the command line,
- the editor will open with the message of the amended commit.</p>
- <p>It is not possible to amend public changesets (see <a class="reference external" href="hg.1.html#phases"><tt class="docutils literal">hg help phases</tt></a>)
- or changesets that have children.</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 head as closed</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--amend</span></kbd></td>
- <td>amend the parent of the working directory</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-s</span>, <span class="option">--secret</span></kbd></td>
- <td>use the secret phase for committing</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td>
- <td>invoke editor on commit messages</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-i</span>, <span class="option">--interactive</span></kbd></td>
- </tr>
- <tr><td> </td><td>use interactive mode</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>exclude names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-m</span>, <span class="option">--message <var><TEXT></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>use text as commit message</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-l</span>, <span class="option">--logfile <var><FILE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>read commit message from file</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-d</span>, <span class="option">--date <var><DATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>record the specified date as commit date</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-u</span>, <span class="option">--user <var><USER></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>record the specified user as committer</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>
- <p>[+] marked option can be specified multiple times</p>
- <blockquote>
- aliases: ci</blockquote>
- </div>
- <div class="section" id="config">
- <h2>config</h2>
- <p>show combined config settings from all hgrc files:</p>
- <pre class="literal-block">
- hg config [-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 --edit, start an editor on the user-level config file. With
- --global, edit the system-wide config file. With --local, edit the
- repository-level config file.</p>
- <p>With --debug, the source (filename and line number) is printed
- for each config item.</p>
- <p>See <a class="reference external" href="hg.1.html#config"><tt class="docutils literal">hg help config</tt></a> for more information about config files.</p>
- <p>Returns 0 on success, 1 if NAME does not exist.</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>show untrusted configuration options</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td>
- <td>edit user config</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-l</span>, <span class="option">--local</span></kbd></td>
- <td>edit repository config</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-g</span>, <span class="option">--global</span></kbd></td>
- <td><p class="first">edit global config</p>
- <p class="last">aliases: showconfig debugconfig</p>
- </td></tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="copy">
- <h2>copy</h2>
- <p>mark files as copied for the next commit:</p>
- <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" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </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>
- <p>[+] marked option can be specified multiple times</p>
- <blockquote>
- aliases: cp</blockquote>
- </div>
- <div class="section" id="diff">
- <h2>diff</h2>
- <p>diff repository (or selected files):</p>
- <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>
- <div class="verbose container">
- <p>Examples:</p>
- <ul>
- <li><p class="first">compare a file in the current working directory to its parent:</p>
- <pre class="literal-block">
- hg diff foo.c
- </pre>
- </li>
- <li><p class="first">compare two historical versions of a directory, with rename info:</p>
- <pre class="literal-block">
- hg diff --git -r 1.0:1.2 lib/
- </pre>
- </li>
- <li><p class="first">get change stats relative to the last change on some date:</p>
- <pre class="literal-block">
- hg diff --stat -r "date('may 2')"
- </pre>
- </li>
- <li><p class="first">diff all newly-added files that contain a keyword:</p>
- <pre class="literal-block">
- hg diff "set:added() and grep(GNU)"
- </pre>
- </li>
- <li><p class="first">compare a revision and its parents:</p>
- <pre class="literal-block">
- hg diff -c 9353 # compare against first parent
- hg diff -r 9353^:9353 # same using revset syntax
- hg diff -r 9353^2:9353 # compare against the second parent
- </pre>
- </li>
- </ul>
- </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" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>revision</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-c</span>, <span class="option">--change <var><REV></var></span></kbd></td>
- </tr>
- <tr><td> </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">
- <kbd><span class="option">--noprefix</span></kbd></td>
- <td>omit a/ and b/ prefixes from filenames</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" colspan="2">
- <kbd><span class="option">-U</span>, <span class="option">--unified <var><NUM></var></span></kbd></td>
- </tr>
- <tr><td> </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">--root <var><DIR></var></span></kbd></td>
- <td>produce diffs relative to subdirectory</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </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>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- <div class="section" id="export">
- <h2>export</h2>
- <p>dump the header and diffs for one or more changesets:</p>
- <pre class="literal-block">
- hg export [OPTION]... [-o OUTFILESPEC] [-r] [REV]...
- </pre>
- <p>Print the changeset header and diffs for one or more revisions.
- If no revision is given, the parent of the working directory is used.</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">%m</tt>:</th><td class="field-body">first line of the commit message (only alphanumeric characters)</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>
- <div class="verbose container">
- <p>Examples:</p>
- <ul>
- <li><p class="first">use export and import to transplant a bugfix to the current
- branch:</p>
- <pre class="literal-block">
- hg export -r 9353 | hg import -
- </pre>
- </li>
- <li><p class="first">export all the changesets between two revisions to a file with
- rename information:</p>
- <pre class="literal-block">
- hg export --git -r 123:150 > changes.txt
- </pre>
- </li>
- <li><p class="first">split outgoing changes into a series of patches with
- descriptive names:</p>
- <pre class="literal-block">
- hg export -r "outgoing()" -o "%n-%m.patch"
- </pre>
- </li>
- </ul>
- </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" colspan="2">
- <kbd><span class="option">-o</span>, <span class="option">--output <var><FORMAT></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </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>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- <div class="section" id="files">
- <h2>files</h2>
- <p>list tracked files:</p>
- <pre class="literal-block">
- hg files [OPTION]... [PATTERN]...
- </pre>
- <p>Print files under Mercurial control in the working directory or
- specified revision whose names match the given patterns (excluding
- removed files).</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>
- <div class="verbose container">
- <p>Examples:</p>
- <ul>
- <li><p class="first">list all files under the current directory:</p>
- <pre class="literal-block">
- hg files .
- </pre>
- </li>
- <li><p class="first">shows sizes and flags for current revision:</p>
- <pre class="literal-block">
- hg files -vr .
- </pre>
- </li>
- <li><p class="first">list all files named README:</p>
- <pre class="literal-block">
- hg files -I "**/README"
- </pre>
- </li>
- <li><p class="first">list all binary files:</p>
- <pre class="literal-block">
- hg files "set:binary()"
- </pre>
- </li>
- <li><p class="first">find files containing a regular expression:</p>
- <pre class="literal-block">
- hg files "set:grep('bob')"
- </pre>
- </li>
- <li><p class="first">search tracked file contents with xargs and grep:</p>
- <pre class="literal-block">
- hg files -0 | xargs -0 grep foo
- </pre>
- </li>
- </ul>
- </div>
- <p>See <a class="reference external" href="hg.1.html#patterns"><tt class="docutils literal">hg help patterns</tt></a> and <a class="reference external" href="hg.1.html#filesets"><tt class="docutils literal">hg help filesets</tt></a> for more information
- on specifying file patterns.</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" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>exclude names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-T</span>, <span class="option">--template <var><TEMPLATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>display with template (EXPERIMENTAL)</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>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- <div class="section" id="forget">
- <h2>forget</h2>
- <p>forget the specified files on the next commit:</p>
- <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 delete the file from the working directory, see <a class="reference external" href="hg.1.html#remove"><tt class="docutils literal">hg remove</tt></a>.</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>
- <div class="verbose container">
- <p>Examples:</p>
- <ul>
- <li><p class="first">forget newly-added binary files:</p>
- <pre class="literal-block">
- hg forget "set:added() and binary()"
- </pre>
- </li>
- <li><p class="first">forget files that would be excluded by .hgignore:</p>
- <pre class="literal-block">
- hg forget "set:hgignore()"
- </pre>
- </li>
- </ul>
- </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" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>exclude names matching the given patterns</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- <div class="section" id="graft">
- <h2>graft</h2>
- <p>copy changes from other branches onto the current branch:</p>
- <pre class="literal-block">
- hg graft [OPTION]... [-r] REV...
- </pre>
- <p>This command uses Mercurial's merge logic to copy individual
- changes from other branches without merging branches in the
- history graph. This is sometimes known as 'backporting' or
- 'cherry-picking'. By default, graft will copy user, date, and
- description from the source changesets.</p>
- <p>Changesets that are ancestors of the current revision, that have
- already been grafted, or that are merges will be skipped.</p>
- <p>If --log is specified, log messages will have a comment appended
- of the form:</p>
- <pre class="literal-block">
- (grafted from CHANGESETHASH)
- </pre>
- <p>If --force is specified, revisions will be grafted even if they
- are already ancestors of or have been grafted to the destination.
- This is useful when the revisions have since been backed out.</p>
- <p>If a graft merge results in conflicts, the graft process is
- interrupted so that the current merge can be manually resolved.
- Once all conflicts are addressed, the graft process can be
- continued with the -c/--continue option.</p>
- <div class="note">
- <p class="first admonition-title">Note</p>
- <p class="last">The -c/--continue option does not reapply earlier options, except
- for --force.</p>
- </div>
- <div class="verbose container">
- <p>Examples:</p>
- <ul>
- <li><p class="first">copy a single change to the stable branch and edit its description:</p>
- <pre class="literal-block">
- hg update stable
- hg graft --edit 9393
- </pre>
- </li>
- <li><p class="first">graft a range of changesets with one exception, updating dates:</p>
- <pre class="literal-block">
- hg graft -D "2085::2093 and not 2091"
- </pre>
- </li>
- <li><p class="first">continue a graft after resolving conflicts:</p>
- <pre class="literal-block">
- hg graft -c
- </pre>
- </li>
- <li><p class="first">show the source of a grafted changeset:</p>
- <pre class="literal-block">
- hg log --debug -r .
- </pre>
- </li>
- </ul>
- </div>
- <p>See <a class="reference external" href="hg.1.html#revisions"><tt class="docutils literal">hg help revisions</tt></a> and <a class="reference external" href="hg.1.html#revsets"><tt class="docutils literal">hg help revsets</tt></a> for more about
- specifying revisions.</p>
- <p>Returns 0 on successful completion.</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">-r</span>, <span class="option">--rev <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>revisions to graft</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-c</span>, <span class="option">--continue</span></kbd></td>
- <td>resume interrupted graft</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td>
- <td>invoke editor on commit messages</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--log</span></kbd></td>
- <td>append graft info to log message</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
- <td>force graft</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>record the current date as commit date</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>record the current user as committer</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-d</span>, <span class="option">--date <var><DATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>record the specified date as commit date</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-u</span>, <span class="option">--user <var><USER></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>record the specified user as committer</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-t</span>, <span class="option">--tool <var><VALUE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify merge tool</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>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- <div class="section" id="grep">
- <h2>grep</h2>
- <p>search for a pattern in specified files and revisions:</p>
- <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">-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">-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" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>exclude names matching the given patterns</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- <div class="section" id="heads">
- <h2>heads</h2>
- <p>show branch heads:</p>
- <pre class="literal-block">
- hg heads [-ct] [-r STARTREV] [REV]...
- </pre>
- <p>With no arguments, show all open branch heads in the repository.
- Branch heads are changesets that have no descendants on the
- same branch. They are where development generally takes place and
- are the usual targets for update and merge operations.</p>
- <p>If one or more REVs are given, only open branch heads on the
- branches associated with the specified changesets are shown. This
- means that you can use <a class="reference external" href="hg.1.html#heads"><tt class="docutils literal">hg heads .</tt></a> to see the heads on the
- currently checked-out branch.</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
- topological heads (changesets with no 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" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><STARTREV></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">--style <var><STYLE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>display using template map file (DEPRECATED)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-T</span>, <span class="option">--template <var><TEMPLATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>display with template</td></tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="help">
- <h2>help</h2>
- <p>show help for a given topic or a help overview:</p>
- <pre class="literal-block">
- hg help [-ec] [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>
- <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">-e</span>, <span class="option">--extension</span></kbd></td>
- </tr>
- <tr><td> </td><td>show only help for extensions</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-c</span>, <span class="option">--command</span></kbd></td>
- <td>show only help for commands</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-k</span>, <span class="option">--keyword <var><VALUE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>show topics matching keyword</td></tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="identify">
- <h2>identify</h2>
- <p>identify the working directory or specified revision:</p>
- <pre class="literal-block">
- hg identify [-nibtB] [-r REV] [SOURCE]
- </pre>
- <p>Print a summary identifying the repository state at REV using one or
- two parent hash identifiers, followed by a "+" if the working
- directory has uncommitted changes, the branch name (if not default),
- a list of tags, and a list of bookmarks.</p>
- <p>When REV is not given, 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>
- <div class="verbose container">
- <p>Examples:</p>
- <ul>
- <li><p class="first">generate a build identifier for the working directory:</p>
- <pre class="literal-block">
- hg id --id > build-id.dat
- </pre>
- </li>
- <li><p class="first">find the revision corresponding to a tag:</p>
- <pre class="literal-block">
- hg id -n -r 1.3
- </pre>
- </li>
- <li><p class="first">check the most recent revision of a remote repository:</p>
- <pre class="literal-block">
- hg id -r tip http://selenic.com/hg/
- </pre>
- </li>
- </ul>
- </div>
- <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" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV></var></span></kbd></td>
- </tr>
- <tr><td> </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>show tags</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-B</span>, <span class="option">--bookmarks</span></kbd></td>
- </tr>
- <tr><td> </td><td>show bookmarks</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-e</span>, <span class="option">--ssh <var><CMD></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify ssh command to use</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--remotecmd <var><CMD></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify hg command to run on the remote side</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--insecure</span></kbd></td>
- <td><p class="first">do not verify server certificate (ignoring web.cacerts config)</p>
- <p class="last">aliases: id</p>
- </td></tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="import">
- <h2>import</h2>
- <p>import an ordered set of patches:</p>
- <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>Because import first applies changes to the working directory,
- import will abort if there are outstanding changes.</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>Use --bypass to apply and commit patches directly to the
- repository, not touching the working directory. Without --exact,
- patches will be applied on top of the working directory parent
- revision.</p>
- <p>With -s/--similarity, hg will attempt to discover renames and
- copies in the patch in the same way as <a class="reference external" href="hg.1.html#addremove"><tt class="docutils literal">hg addremove</tt></a>.</p>
- <p>Use --partial to ensure a changeset will be created from the patch
- even if some hunks fail to apply. Hunks that fail to apply will be
- written to a <target-file>.rej file. Conflicts can then be resolved
- by hand before <a class="reference external" href="hg.1.html#commit"><tt class="docutils literal">hg commit <span class="pre">--amend</span></tt></a> is run to update the created
- changeset. This flag exists to let people import patches that
- partially apply without losing the associated metadata (author,
- date, description, ...). Note that when none of the hunk applies
- cleanly, <a class="reference external" href="hg.1.html#import"><tt class="docutils literal">hg import <span class="pre">--partial</span></tt></a> will create an empty changeset,
- importing only the patch metadata.</p>
- <p>It is possible to use external patch programs to perform the patch
- by setting the <tt class="docutils literal">ui.patch</tt> configuration option. For the default
- internal tool, the fuzz can also be configured via <tt class="docutils literal">patch.fuzz</tt>.
- See <a class="reference external" href="hg.1.html#config"><tt class="docutils literal">hg help config</tt></a> for more information about configuration
- files and how to use these options.</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>
- <div class="verbose container">
- <p>Examples:</p>
- <ul>
- <li><p class="first">import a traditional patch from a website and detect renames:</p>
- <pre class="literal-block">
- hg import -s 80 http://example.com/bugfix.patch
- </pre>
- </li>
- <li><p class="first">import a changeset from an hgweb server:</p>
- <pre class="literal-block">
- hg import http://www.selenic.com/hg/rev/5ca8c111e9aa
- </pre>
- </li>
- <li><p class="first">import all the patches in an Unix-style mbox:</p>
- <pre class="literal-block">
- hg import incoming-patches.mbox
- </pre>
- </li>
- <li><p class="first">attempt to exactly restore an exported changeset (not always
- possible):</p>
- <pre class="literal-block">
- hg import --exact proposed-fix.patch
- </pre>
- </li>
- <li><p class="first">use an external tool to apply a patch which is too fuzzy for
- the default internal tool.</p>
- <blockquote>
- <p>hg import --config ui.patch="patch --merge" fuzzy.patch</p>
- </blockquote>
- </li>
- <li><p class="first">change the default fuzzing from 2 to a less strict 7</p>
- <blockquote>
- <p>hg import --config ui.fuzz=7 fuzz.patch</p>
- </blockquote>
- </li>
- </ul>
- </div>
- <p>Returns 0 on success, 1 on partial success (see --partial).</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">-p</span>, <span class="option">--strip <var><NUM></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">-b</span>, <span class="option">--base <var><PATH></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>base path (DEPRECATED)</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td>
- <td>invoke editor on commit messages</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 (DEPRECATED)</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">--bypass</span></kbd></td>
- <td>apply patch without touching the working directory</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--partial</span></kbd></td>
- <td>commit even if some hunks fail</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">
- <kbd><span class="option">--prefix <var><DIR></var></span></kbd></td>
- <td>apply patch to subdirectory</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" colspan="2">
- <kbd><span class="option">-m</span>, <span class="option">--message <var><TEXT></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>use text as commit message</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-l</span>, <span class="option">--logfile <var><FILE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>read commit message from file</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-d</span>, <span class="option">--date <var><DATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>record the specified date as commit date</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-u</span>, <span class="option">--user <var><USER></var></span></kbd></td>
- </tr>
- <tr><td> </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 <var><SIMILARITY></var></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>
- <p>show new changesets found in source:</p>
- <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>See pull for valid source format details.</p>
- <div class="verbose container">
- <p>With -B/--bookmarks, the result of bookmark comparison between
- local and remote repositories is displayed. With -v/--verbose,
- status is also displayed for each bookmark like below:</p>
- <pre class="literal-block">
- BM1 01234567890a added
- BM2 1234567890ab advanced
- BM3 234567890abc diverged
- BM4 34567890abcd changed
- </pre>
- <p>The action taken locally when pulling depends on the
- status of each bookmark:</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">added</tt>:</th><td class="field-body">pull will create it</td>
- </tr>
- <tr class="field"><th class="field-name"><tt class="docutils literal">advanced</tt>:</th><td class="field-body">pull will update it</td>
- </tr>
- <tr class="field"><th class="field-name"><tt class="docutils literal">diverged</tt>:</th><td class="field-body">pull will create a divergent bookmark</td>
- </tr>
- <tr class="field"><th class="field-name"><tt class="docutils literal">changed</tt>:</th><td class="field-body">result depends on remote changesets</td>
- </tr>
- </tbody>
- </table>
- <p>From the point of view of pulling behavior, bookmark
- existing only in the remote repository are treated as <tt class="docutils literal">added</tt>,
- even if it is in fact locally deleted.</p>
- </div>
- <div class="verbose container">
- <p>For remote repository, using --bundle avoids downloading the
- changesets twice if the incoming is followed by a pull.</p>
- <p>Examples:</p>
- <ul>
- <li><p class="first">show incoming changes with patches and full description:</p>
- <pre class="literal-block">
- hg incoming -vp
- </pre>
- </li>
- <li><p class="first">show incoming changes excluding merges, store a bundle:</p>
- <pre class="literal-block">
- hg in -vpM --bundle incoming.hg
- hg pull incoming.hg
- </pre>
- </li>
- <li><p class="first">briefly list changes inside a bundle:</p>
- <pre class="literal-block">
- hg in changes.hg -T "{desc|firstline}\n"
- </pre>
- </li>
- </ul>
- </div>
- <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" colspan="2">
- <kbd><span class="option">--bundle <var><FILE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>file to store the bundles into</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>a remote changeset intended to be added</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-B</span>, <span class="option">--bookmarks</span></kbd></td>
- </tr>
- <tr><td> </td><td>compare bookmarks</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-b</span>, <span class="option">--branch <var><BRANCH[+]></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">-l</span>, <span class="option">--limit <var><NUM></var></span></kbd></td>
- </tr>
- <tr><td> </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">-G</span>, <span class="option">--graph</span></kbd></td>
- <td>show the revision DAG</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--style <var><STYLE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>display using template map file (DEPRECATED)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-T</span>, <span class="option">--template <var><TEMPLATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>display with template</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-e</span>, <span class="option">--ssh <var><CMD></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify ssh command to use</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--remotecmd <var><CMD></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify hg command to run on the remote side</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--insecure</span></kbd></td>
- <td>do not verify server certificate (ignoring web.cacerts config)</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>
- <p>[+] marked option can be specified multiple times</p>
- <blockquote>
- aliases: in</blockquote>
- </div>
- <div class="section" id="init">
- <h2>init</h2>
- <p>create a new repository in the given directory:</p>
- <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" colspan="2">
- <kbd><span class="option">-e</span>, <span class="option">--ssh <var><CMD></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify ssh command to use</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--remotecmd <var><CMD></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify hg command to run on the remote side</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--insecure</span></kbd></td>
- <td>do not verify server certificate (ignoring web.cacerts config)</td></tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="locate">
- <h2>locate</h2>
- <p>locate files matching specific patterns (DEPRECATED):</p>
- <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>See <a class="reference external" href="hg.1.html#files"><tt class="docutils literal">hg help files</tt></a> for a more versatile command.</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" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>exclude names matching the given patterns</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- <div class="section" id="log">
- <h2>log</h2>
- <p>show revision history of entire repository or files:</p>
- <pre class="literal-block">
- hg log [OPTION]... [FILE]
- </pre>
- <p>Print the revision history of the specified files or the entire
- project.</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.</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.</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>
- <p>With --graph the revisions are shown as an ASCII art DAG with the most
- recent changeset at the top.
- 'o' is a changeset, '@' is a working directory parent, 'x' is obsolete,
- and '+' represents a fork where the changeset from the lines below is a
- parent of the 'o' merge on the same line.</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>
- <div class="note">
- <p class="first admonition-title">Note</p>
- <p class="last">for performance reasons, log FILE may omit duplicate changes
- made on branches and will not show removals or mode changes. To
- see all such changes, use the --removed switch.</p>
- </div>
- <div class="verbose container">
- <p>Some examples:</p>
- <ul>
- <li><p class="first">changesets with full descriptions and file lists:</p>
- <pre class="literal-block">
- hg log -v
- </pre>
- </li>
- <li><p class="first">changesets ancestral to the working directory:</p>
- <pre class="literal-block">
- hg log -f
- </pre>
- </li>
- <li><p class="first">last 10 commits on the current branch:</p>
- <pre class="literal-block">
- hg log -l 10 -b .
- </pre>
- </li>
- <li><p class="first">changesets showing all modifications of a file, including removals:</p>
- <pre class="literal-block">
- hg log --removed file.c
- </pre>
- </li>
- <li><p class="first">all changesets that touch a directory, with diffs, excluding merges:</p>
- <pre class="literal-block">
- hg log -Mp lib/
- </pre>
- </li>
- <li><p class="first">all revision numbers that match a keyword:</p>
- <pre class="literal-block">
- hg log -k bug --template "{rev}\n"
- </pre>
- </li>
- <li><p class="first">list available log templates:</p>
- <pre class="literal-block">
- hg log -T list
- </pre>
- </li>
- <li><p class="first">check if a given changeset is included in a tagged release:</p>
- <pre class="literal-block">
- hg log -r "a21ccf and ancestor(1.9)"
- </pre>
- </li>
- <li><p class="first">find all changesets by some user in a date range:</p>
- <pre class="literal-block">
- hg log -k alice -d "may 2008 to jul 2008"
- </pre>
- </li>
- <li><p class="first">summary of all changesets after the last tag:</p>
- <pre class="literal-block">
- hg log -r "last(tagged())::" --template "{desc|firstline}\n"
- </pre>
- </li>
- </ul>
- </div>
- <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>See <a class="reference external" href="hg.1.html#revisions"><tt class="docutils literal">hg help revisions</tt></a> and <a class="reference external" href="hg.1.html#revsets"><tt class="docutils literal">hg help revsets</tt></a> for more about
- specifying revisions.</p>
- <p>See <a class="reference external" href="hg.1.html#templates"><tt class="docutils literal">hg help templates</tt></a> for more about pre-packaged styles and
- specifying custom templates.</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">--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 (DEPRECATED)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-d</span>, <span class="option">--date <var><DATE></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">-k</span>, <span class="option">--keyword <var><TEXT[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>do case-insensitive search for a given text</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>show the specified revision or revset</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 (DEPRECATED)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-u</span>, <span class="option">--user <var><USER[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>revisions committed by user</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--only-branch <var><BRANCH[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>show only changesets within the given named branch (DEPRECATED)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-b</span>, <span class="option">--branch <var><BRANCH[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>show changesets within the given named branch</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-P</span>, <span class="option">--prune <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">-l</span>, <span class="option">--limit <var><NUM></var></span></kbd></td>
- </tr>
- <tr><td> </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">-G</span>, <span class="option">--graph</span></kbd></td>
- <td>show the revision DAG</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--style <var><STYLE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>display using template map file (DEPRECATED)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-T</span>, <span class="option">--template <var><TEMPLATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>display with template</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>exclude names matching the given patterns</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- <blockquote>
- aliases: history</blockquote>
- </div>
- <div class="section" id="manifest">
- <h2>manifest</h2>
- <p>output the current or given revision of the project manifest:</p>
- <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>If option --all is specified, the list of all files from all revisions
- is printed. This includes deleted and renamed files.</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">-r</span>, <span class="option">--rev <var><REV></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>revision to display</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--all</span></kbd></td>
- <td>list files from all revisions</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-T</span>, <span class="option">--template <var><TEMPLATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>display with template (EXPERIMENTAL)</td></tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="merge">
- <h2>merge</h2>
- <p>merge another revision into working directory:</p>
- <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. See <a class="reference external" href="hg.1.html#merge-tools"><tt class="docutils literal">hg help <span class="pre">merge-tools</span></tt></a> for options.</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 including outstanding changes (DEPRECATED)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV></var></span></kbd></td>
- </tr>
- <tr><td> </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>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-t</span>, <span class="option">--tool <var><VALUE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify merge tool</td></tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="outgoing">
- <h2>outgoing</h2>
- <p>show changesets not found in the destination:</p>
- <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>
- <div class="verbose container">
- <p>With -B/--bookmarks, the result of bookmark comparison between
- local and remote repositories is displayed. With -v/--verbose,
- status is also displayed for each bookmark like below:</p>
- <pre class="literal-block">
- BM1 01234567890a added
- BM2 deleted
- BM3 234567890abc advanced
- BM4 34567890abcd diverged
- BM5 4567890abcde changed
- </pre>
- <p>The action taken when pushing depends on the
- status of each bookmark:</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">added</tt>:</th><td class="field-body">push with <tt class="docutils literal"><span class="pre">-B</span></tt> will create it</td>
- </tr>
- <tr class="field"><th class="field-name"><tt class="docutils literal">deleted</tt>:</th><td class="field-body">push with <tt class="docutils literal"><span class="pre">-B</span></tt> will delete it</td>
- </tr>
- <tr class="field"><th class="field-name"><tt class="docutils literal">advanced</tt>:</th><td class="field-body">push will update it</td>
- </tr>
- <tr class="field"><th class="field-name"><tt class="docutils literal">diverged</tt>:</th><td class="field-body">push with <tt class="docutils literal"><span class="pre">-B</span></tt> will update it</td>
- </tr>
- <tr class="field"><th class="field-name"><tt class="docutils literal">changed</tt>:</th><td class="field-body">push with <tt class="docutils literal"><span class="pre">-B</span></tt> will update it</td>
- </tr>
- </tbody>
- </table>
- <p>From the point of view of pushing behavior, bookmarks
- existing only in the remote repository are treated as
- <tt class="docutils literal">deleted</tt>, even if it is in fact added remotely.</p>
- </div>
- <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" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">-B</span>, <span class="option">--bookmarks</span></kbd></td>
- </tr>
- <tr><td> </td><td>compare bookmarks</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-b</span>, <span class="option">--branch <var><BRANCH[+]></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">-l</span>, <span class="option">--limit <var><NUM></var></span></kbd></td>
- </tr>
- <tr><td> </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">-G</span>, <span class="option">--graph</span></kbd></td>
- <td>show the revision DAG</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--style <var><STYLE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>display using template map file (DEPRECATED)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-T</span>, <span class="option">--template <var><TEMPLATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>display with template</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-e</span>, <span class="option">--ssh <var><CMD></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify ssh command to use</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--remotecmd <var><CMD></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify hg command to run on the remote side</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--insecure</span></kbd></td>
- <td>do not verify server certificate (ignoring web.cacerts config)</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>
- <p>[+] marked option can be specified multiple times</p>
- <blockquote>
- aliases: out</blockquote>
- </div>
- <div class="section" id="parents">
- <h2>parents</h2>
- <p>show the parents of the working directory or revision (DEPRECATED):</p>
- <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>See <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#revsets"><tt class="docutils literal">hg help revsets</tt></a> for related 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" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>show parents of the specified revision</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--style <var><STYLE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>display using template map file (DEPRECATED)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-T</span>, <span class="option">--template <var><TEMPLATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>display with template</td></tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="paths">
- <h2>paths</h2>
- <p>show aliases for remote repositories:</p>
- <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>Option -q/--quiet suppresses all output when searching for NAME
- and shows only the path names when listing all definitions.</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="phase">
- <h2>phase</h2>
- <p>set or show the current phase name:</p>
- <pre class="literal-block">
- hg phase [-p|-d|-s] [-f] [-r] [REV...]
- </pre>
- <p>With no argument, show the phase name of the current revision(s).</p>
- <p>With one of -p/--public, -d/--draft or -s/--secret, change the
- phase value of the specified revisions.</p>
- <p>Unless -f/--force is specified, <a class="reference external" href="hg.1.html#phase"><tt class="docutils literal">hg phase</tt></a> won't move changeset from a
- lower phase to an higher phase. Phases are ordered as follows:</p>
- <pre class="literal-block">
- public < draft < secret
- </pre>
- <p>Returns 0 on success, 1 if no phases were changed or some could not
- be changed.</p>
- <p>(For more information about the phases concept, see <a class="reference external" href="hg.1.html#phases"><tt class="docutils literal">hg help phases</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">-p</span>, <span class="option">--public</span></kbd></td>
- <td>set changeset phase to public</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-d</span>, <span class="option">--draft</span></kbd></td>
- <td>set changeset phase to draft</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-s</span>, <span class="option">--secret</span></kbd></td>
- <td>set changeset phase to secret</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
- <td>allow to move boundary backward</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>target revision</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- <div class="section" id="pull">
- <h2>pull</h2>
- <p>pull changes from the specified source:</p>
- <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" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>a remote changeset intended to be added</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-B</span>, <span class="option">--bookmark <var><BOOKMARK[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>bookmark to pull</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-b</span>, <span class="option">--branch <var><BRANCH[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>a specific branch you would like to pull</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-e</span>, <span class="option">--ssh <var><CMD></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify ssh command to use</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--remotecmd <var><CMD></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify hg command to run on the remote side</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--insecure</span></kbd></td>
- <td>do not verify server certificate (ignoring web.cacerts config)</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- <div class="section" id="push">
- <h2>push</h2>
- <p>push changes to the specified destination:</p>
- <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>
- <div class="note">
- <p class="first admonition-title">Note</p>
- <p class="last">Extra care should be taken with the -f/--force option,
- which will push all new heads on all branches, an action which will
- almost always cause confusion for collaborators.</p>
- </div>
- <p>If -r/--rev is used, the specified revision and all its ancestors
- will be pushed to the remote repository.</p>
- <p>If -B/--bookmark is used, the specified bookmarked revision, its
- ancestors, and the bookmark 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" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>a changeset intended to be included in the destination</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-B</span>, <span class="option">--bookmark <var><BOOKMARK[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>bookmark to push</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-b</span>, <span class="option">--branch <var><BRANCH[+]></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">-e</span>, <span class="option">--ssh <var><CMD></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify ssh command to use</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--remotecmd <var><CMD></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify hg command to run on the remote side</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--insecure</span></kbd></td>
- <td>do not verify server certificate (ignoring web.cacerts config)</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- <div class="section" id="recover">
- <h2>recover</h2>
- <p>roll back an interrupted transaction:</p>
- <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>
- <p>remove the specified files on the next commit:</p>
- <pre class="literal-block">
- hg remove [OPTION]... FILE...
- </pre>
- <p>Schedule the indicated files for removal from the current branch.</p>
- <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>. To undo added
- files, see <a class="reference external" href="hg.1.html#forget"><tt class="docutils literal">hg forget</tt></a>.</p>
- <div class="verbose container">
- <p>-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>
- <table border="1" class="docutils">
- <colgroup>
- <col width="53%" />
- <col width="12%" />
- <col width="12%" />
- <col width="12%" />
- <col width="12%" />
- </colgroup>
- <thead valign="bottom">
- <tr><th class="head">opt/state</th>
- <th class="head">A</th>
- <th class="head">C</th>
- <th class="head">M</th>
- <th class="head">!</th>
- </tr>
- </thead>
- <tbody valign="top">
- <tr><td>none</td>
- <td>W</td>
- <td>RD</td>
- <td>W</td>
- <td>R</td>
- </tr>
- <tr><td>-f</td>
- <td>R</td>
- <td>RD</td>
- <td>RD</td>
- <td>R</td>
- </tr>
- <tr><td>-A</td>
- <td>W</td>
- <td>W</td>
- <td>W</td>
- <td>R</td>
- </tr>
- <tr><td>-Af</td>
- <td>R</td>
- <td>R</td>
- <td>R</td>
- <td>R</td>
- </tr>
- </tbody>
- </table>
- <p>Note that remove never deletes files in Added [A] state from the
- working directory, not even if option --force is specified.</p>
- </div>
- <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">-S</span>, <span class="option">--subrepos</span></kbd></td>
- <td>recurse into subrepositories</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>exclude names matching the given patterns</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- <blockquote>
- aliases: rm</blockquote>
- </div>
- <div class="section" id="rename">
- <h2>rename</h2>
- <p>rename files; equivalent of copy + remove:</p>
- <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" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </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>
- <p>[+] marked option can be specified multiple times</p>
- <blockquote>
- aliases: move mv</blockquote>
- </div>
- <div class="section" id="resolve">
- <h2>resolve</h2>
- <p>redo merges or set/view the merge status of files:</p>
- <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). See <a class="reference external" href="hg.1.html#merge-tools"><tt class="docutils literal">hg help
- <span class="pre">merge-tools</span></tt></a> for information on configuring merge tools.</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 select 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. Previous file
- contents are saved with a <tt class="docutils literal">.orig</tt> suffix.</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" 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" colspan="2">
- <kbd><span class="option">-t</span>, <span class="option">--tool <var><VALUE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify merge tool</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>exclude names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-T</span>, <span class="option">--template <var><TEMPLATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>display with template (EXPERIMENTAL)</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- <div class="section" id="revert">
- <h2>revert</h2>
- <p>restore files to their checkout state:</p>
- <pre class="literal-block">
- hg revert [OPTION]... [-r REV] [NAME]...
- </pre>
- <div class="note">
- <p class="first admonition-title">Note</p>
- <p class="last">To check out earlier revisions, you should use <a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update REV</tt></a>.
- To cancel an uncommitted merge (and lose your changes),
- use <a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update <span class="pre">--clean</span> .</tt></a>.</p>
- </div>
- <p>With no revision specified, revert the specified files or directories
- to the contents they had in the parent of the working directory.
- This restores the contents of 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 or -d/--date options, revert the given files or
- directories to their states as of a specific revision. Because
- revert does not change the working directory parents, this will
- cause these files to appear modified. This can be helpful to "back
- out" some or all of an earlier change. See <a class="reference external" href="hg.1.html#backout"><tt class="docutils literal">hg backout</tt></a> for a
- related method.</p>
- <p>Modified files are saved with a .orig suffix before reverting.
- To disable these backups, use --no-backup.</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">-a</span>, <span class="option">--all</span></kbd></td>
- <td>revert all changes when no arguments given</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-d</span>, <span class="option">--date <var><DATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>tipmost revision matching date</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>revert to the specified revision</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-C</span>, <span class="option">--no-backup</span></kbd></td>
- </tr>
- <tr><td> </td><td>do not save backup copies of files</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-i</span>, <span class="option">--interactive</span></kbd></td>
- </tr>
- <tr><td> </td><td>interactively select the changes (EXPERIMENTAL)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </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>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- <div class="section" id="rollback">
- <h2>rollback</h2>
- <p>roll back the last transaction (DANGEROUS) (DEPRECATED):</p>
- <pre class="literal-block">
- hg rollback
- </pre>
- <p>Please use <a class="reference external" href="hg.1.html#commit"><tt class="docutils literal">hg commit <span class="pre">--amend</span></tt></a> instead of rollback to correct
- mistakes in the last commit.</p>
- <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.</p>
- <div class="verbose container">
- <p>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>To avoid permanent data loss, rollback will refuse to rollback a
- commit transaction if it isn't checked out. Use --force to
- override this protection.</p>
- </div>
- <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>
- <tr><td class="option-group">
- <kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
- <td>ignore safety measures</td></tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="root">
- <h2>root</h2>
- <p>print the root (top) of the current working directory:</p>
- <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>
- <p>start stand-alone webserver:</p>
- <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 <var><FILE></var></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 <var><FILE></var></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">-E</span>, <span class="option">--errorlog <var><FILE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>name of error log file to write to</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-p</span>, <span class="option">--port <var><PORT></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>port to listen on (default: 8000)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-a</span>, <span class="option">--address <var><ADDR></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>address to listen on (default: all interfaces)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--prefix <var><PREFIX></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>prefix path to serve from (default: server root)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-n</span>, <span class="option">--name <var><NAME></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>name to show in web pages (default: working directory)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--web-conf <var><FILE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>name of the hgweb config file (see "hg help hgweb")</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--webdir-conf <var><FILE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>name of the hgweb config file (DEPRECATED)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--pid-file <var><FILE></var></span></kbd></td>
- </tr>
- <tr><td> </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">--cmdserver <var><MODE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>for remote clients</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-t</span>, <span class="option">--templates <var><TEMPLATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>web templates to use</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--style <var><STYLE></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">--certificate <var><FILE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>SSL certificate file</td></tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="status">
- <h2>status</h2>
- <p>show changed files in the working directory:</p>
- <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 (with --copies)
- </pre>
- <div class="verbose container">
- <p>Examples:</p>
- <ul>
- <li><p class="first">show changes in the working directory relative to a
- changeset:</p>
- <pre class="literal-block">
- hg status --rev 9353
- </pre>
- </li>
- <li><p class="first">show changes in the working directory relative to the
- current directory (see <a class="reference external" href="hg.1.html#patterns"><tt class="docutils literal">hg help patterns</tt></a> for more information):</p>
- <pre class="literal-block">
- hg status re:
- </pre>
- </li>
- <li><p class="first">show all changes including copies in an existing changeset:</p>
- <pre class="literal-block">
- hg status --copies --change 9353
- </pre>
- </li>
- <li><p class="first">get a NUL separated list of added files, suitable for xargs:</p>
- <pre class="literal-block">
- hg status -an0
- </pre>
- </li>
- </ul>
- </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">-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 <var><REV[+]></var></span></kbd></td>
- <td>show difference from revision</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--change <var><REV></var></span></kbd></td>
- <td>list the changed files of a revision</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">-T</span>, <span class="option">--template <var><TEMPLATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>display with template (EXPERIMENTAL)</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- <blockquote>
- aliases: st</blockquote>
- </div>
- <div class="section" id="summary">
- <h2>summary</h2>
- <p>summarize working directory state:</p>
- <pre class="literal-block">
- hg summary [--remote]
- </pre>
- <p>This generates a brief summary of the working directory state,
- including parents, branch, commit status, phase 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>
- <p>add one or more tags for the current or given revision:</p>
- <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.</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" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV></var></span></kbd></td>
- </tr>
- <tr><td> </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>invoke editor on commit messages</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-m</span>, <span class="option">--message <var><TEXT></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>use text as commit message</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-d</span>, <span class="option">--date <var><DATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>record the specified date as commit date</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-u</span>, <span class="option">--user <var><USER></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>record the specified user as committer</td></tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="tags">
- <h2>tags</h2>
- <p>list repository tags:</p>
- <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>
- <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">-T</span>, <span class="option">--template <var><TEMPLATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>display with template (EXPERIMENTAL)</td></tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="tip">
- <h2>tip</h2>
- <p>show the tip revision (DEPRECATED):</p>
- <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>This command is deprecated, please use <a class="reference external" href="hg.1.html#heads"><tt class="docutils literal">hg heads</tt></a> instead.</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" colspan="2">
- <kbd><span class="option">--style <var><STYLE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>display using template map file (DEPRECATED)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-T</span>, <span class="option">--template <var><TEMPLATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>display with template</td></tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="unbundle">
- <h2>unbundle</h2>
- <p>apply one or more changegroup files:</p>
- <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>
- <p>update working directory (or switch revisions):</p>
- <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 and move the active bookmark (see <a class="reference external" href="hg.1.html#bookmarks"><tt class="docutils literal">hg help
- bookmarks</tt></a>).</p>
- <p>Update sets the working directory's parent revision to the specified
- changeset (see <a class="reference external" href="hg.1.html#parents"><tt class="docutils literal">hg help parents</tt></a>).</p>
- <p>If the changeset is not a descendant or ancestor 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>
- <div class="verbose container">
- <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>
- </div>
- <p>To cancel an uncommitted merge (and lose your changes), use
- <a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update <span class="pre">--clean</span> .</tt></a>.</p>
- <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 revert just one file to an older revision, use
- <a class="reference external" href="hg.1.html#revert"><tt class="docutils literal">hg revert <span class="pre">[-r</span> REV] NAME</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" colspan="2">
- <kbd><span class="option">-d</span>, <span class="option">--date <var><DATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>tipmost revision matching date</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>revision</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-t</span>, <span class="option">--tool <var><VALUE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td><p class="first">specify merge tool</p>
- <p class="last">aliases: up checkout co</p>
- </td></tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="verify">
- <h2>verify</h2>
- <p>verify the integrity of the repository:</p>
- <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>Please see <a class="reference external" href="http://mercurial.selenic.com/wiki/RepositoryCorruption">http://mercurial.selenic.com/wiki/RepositoryCorruption</a>
- for more information about recovery from corruption of the
- repository.</p>
- <p>Returns 0 on success, 1 if errors are encountered.</p>
- </div>
- <div class="section" id="version">
- <h2>version</h2>
- <p>output version and copyright information:</p>
- <pre class="literal-block">
- hg version
- </pre>
- <p>output version and copyright information</p>
- </div>
- </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>
- <li><tt class="docutils literal">today</tt> (midnight)</li>
- <li><tt class="docutils literal">yesterday</tt> (midnight)</li>
- <li><tt class="docutils literal">now</tt> - right now</li>
- </ul>
- <p>Lastly, there is Mercurial's internal format:</p>
- <ul class="simple">
- <li><tt class="docutils literal">1165411109 0</tt> (Wed Dec 6 13:18:29 2006 UTC)</li>
- </ul>
- <p>This is the internal representation format for dates. The first number
- is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
- second 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"><DATE</tt> - at or before a given date/time</li>
- <li><tt class="docutils literal">>DATE</tt> - on or after a given date/time</li>
- <li><tt class="docutils literal">DATE to DATE</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="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="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>HGPLAINEXCEPT</dt>
- <dd><p class="first">This is a comma-separated list of features to preserve when
- HGPLAIN is enabled. Currently the only value supported is "i18n",
- which preserves internationalization in plain mode.</p>
- <p class="last">Setting HGPLAINEXCEPT to anything (even an empty string) will
- enable plain mode.</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="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>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>See <a class="reference external" href="hg.1.html#config"><tt class="docutils literal">hg help config</tt></a> for more information on configuration files.</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 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">blackbox:</th><td class="field-body">log repository events to a blackbox for debugging</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">censor:</th><td class="field-body">erase file content at a given revision</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">factotum:</th><td class="field-body">http authentication with factotum</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">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">histedit:</th><td class="field-body">interactive history editing</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">largefiles:</th><td class="field-body">track large binary 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 push notifications</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">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">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">shelve:</th><td class="field-body">save and restore changes to the working directory</td>
- </tr>
- <tr class="field"><th class="field-name">strip:</th><td class="field-body">strip changesets and their descendants from history</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">zeroconf:</th><td class="field-body">discover and advertise repositories on the local network</td>
- </tr>
- </tbody>
- </table>
- </blockquote>
- </div>
- <div class="section" id="specifying-file-sets">
- <span id="fileset"></span><span id="filesets"></span><h1><a class="toc-backref" href="#contents">Specifying File Sets</a></h1>
- <p>Mercurial supports a functional language for selecting a set of
- files.</p>
- <p>Like other file patterns, this pattern type is indicated by a prefix,
- 'set:'. The language supports a number of predicates which are joined
- by infix operators. Parenthesis can be used for grouping.</p>
- <p>Identifiers such as filenames or patterns 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. This generally applies to file patterns other
- than globs and arguments for 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>Files 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">x and y</tt></dt>
- <dd>The intersection of files 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 files 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>Files in x but not in y.</dd>
- </dl>
- <p>The following predicates are supported:</p>
- <dl class="docutils">
- <dt><tt class="docutils literal">added()</tt></dt>
- <dd>File that is added according to status.</dd>
- <dt><tt class="docutils literal">binary()</tt></dt>
- <dd>File that appears to be binary (contains NUL bytes).</dd>
- <dt><tt class="docutils literal">clean()</tt></dt>
- <dd>File that is clean according to status.</dd>
- <dt><tt class="docutils literal">copied()</tt></dt>
- <dd>File that is recorded as being copied.</dd>
- <dt><tt class="docutils literal">deleted()</tt></dt>
- <dd>File that is deleted according to status.</dd>
- <dt><tt class="docutils literal">encoding(name)</tt></dt>
- <dd>File can be successfully decoded with the given character
- encoding. May not be useful for encodings other than ASCII and
- UTF-8.</dd>
- <dt><tt class="docutils literal">eol(style)</tt></dt>
- <dd>File contains newlines of the given style (dos, unix, mac). Binary
- files are excluded, files with mixed line endings match multiple
- styles.</dd>
- <dt><tt class="docutils literal">exec()</tt></dt>
- <dd>File that is marked as executable.</dd>
- <dt><tt class="docutils literal">grep(regex)</tt></dt>
- <dd>File contains the given regular expression.</dd>
- <dt><tt class="docutils literal">hgignore()</tt></dt>
- <dd>File that matches the active .hgignore pattern.</dd>
- <dt><tt class="docutils literal">ignored()</tt></dt>
- <dd>File that is ignored according to status. These files will only be
- considered if this predicate is used.</dd>
- <dt><tt class="docutils literal">modified()</tt></dt>
- <dd>File that is modified according to status.</dd>
- <dt><tt class="docutils literal">portable()</tt></dt>
- <dd>File that has a portable name. (This doesn't include filenames with case
- collisions.)</dd>
- <dt><tt class="docutils literal">removed()</tt></dt>
- <dd>File that is removed according to status.</dd>
- <dt><tt class="docutils literal">resolved()</tt></dt>
- <dd>File that is marked resolved according to the resolve state.</dd>
- <dt><tt class="docutils literal">size(expression)</tt></dt>
- <dd><p class="first">File size matches the given expression. Examples:</p>
- <ul class="last simple">
- <li>1k (files from 1024 to 2047 bytes)</li>
- <li>< 20k (files less than 20480 bytes)</li>
- <li>>= .5MB (files at least 524288 bytes)</li>
- <li>4k - 1MB (files from 4096 bytes to 1048576 bytes)</li>
- </ul>
- </dd>
- <dt><tt class="docutils literal"><span class="pre">subrepo([pattern])</span></tt></dt>
- <dd>Subrepositories whose paths match the given pattern.</dd>
- <dt><tt class="docutils literal">symlink()</tt></dt>
- <dd>File that is marked as a symlink.</dd>
- <dt><tt class="docutils literal">unknown()</tt></dt>
- <dd>File that is unknown according to status. These files will only be
- considered if this predicate is used.</dd>
- <dt><tt class="docutils literal">unresolved()</tt></dt>
- <dd>File that is marked unresolved according to the resolve state.</dd>
- </dl>
- <p>Some sample queries:</p>
- <ul>
- <li><p class="first">Show status of files that appear to be binary in the working directory:</p>
- <pre class="literal-block">
- hg status -A "set:binary()"
- </pre>
- </li>
- <li><p class="first">Forget files that are in .hgignore but are already tracked:</p>
- <pre class="literal-block">
- hg forget "set:hgignore() and not ignored()"
- </pre>
- </li>
- <li><p class="first">Find text files that contain a string:</p>
- <pre class="literal-block">
- hg files "set:grep(magic) and not binary()"
- </pre>
- </li>
- <li><p class="first">Find C files in a non-standard encoding:</p>
- <pre class="literal-block">
- hg files "set:**.c and not encoding('UTF-8')"
- </pre>
- </li>
- <li><p class="first">Revert copies of large binary files:</p>
- <pre class="literal-block">
- hg revert "set:copied() and binary() and size('>1M')"
- </pre>
- </li>
- <li><p class="first">Remove files listed in foo.lst that contain the letter a or b:</p>
- <pre class="literal-block">
- hg remove "set: 'listfile:foo.lst' and (**a* or **b*)"
- </pre>
- </li>
- </ul>
- <p>See also <a class="reference external" href="hg.1.html#patterns"><tt class="docutils literal">hg help patterns</tt></a>.</p>
- </div>
- <div class="section" id="id1">
- <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>Bookmark</dt>
- <dd><p class="first">Bookmarks are pointers to certain commits that move when
- committing. They are similar to tags in that it is possible to use
- bookmark names in all places where Mercurial expects a changeset
- ID, e.g., with <a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update</tt></a>. Unlike tags, bookmarks move along
- when you make a commit.</p>
- <p class="last">Bookmarks can be renamed, copied and deleted. Bookmarks are local,
- unless they are explicitly pushed or pulled between repositories.
- Pushing and pulling bookmarks allow you to collaborate with others
- on a branch without creating a named branch.</p>
- </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 'Head, closed branch'</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#log"><tt class="docutils literal">hg log <span class="pre">--graph</span></tt></a>. In
- Mercurial, the DAG is limited by the requirement for children to
- have at most two parents.</dd>
- <dt>Deprecated</dt>
- <dd>Feature removed from documentation, but not scheduled for removal.</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>Draft</dt>
- <dd>Changesets in the draft phase have not been shared with publishing
- repositories and may thus be safely changed by history-modifying
- extensions. See <a class="reference external" href="hg.1.html#phases"><tt class="docutils literal">hg help phases</tt></a>.</dd>
- <dt>Experimental</dt>
- <dd>Feature that may change or be removed at a later date.</dd>
- <dt>Graph</dt>
- <dd>See DAG and <a class="reference external" href="hg.1.html#log"><tt class="docutils literal">hg log <span class="pre">--graph</span></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><p class="first">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>.</p>
- <p class="last">Closed heads can be re-opened by committing new changeset as the
- child of the changeset that marks a head as closed.</p>
- </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>Phase</dt>
- <dd>A per-changeset state tracking how the changeset has been or
- should be shared. See <a class="reference external" href="hg.1.html#phases"><tt class="docutils literal">hg help phases</tt></a>.</dd>
- <dt>Public</dt>
- <dd>Changesets in the public phase have been shared with publishing
- repositories and are therefore considered immutable. See <a class="reference external" href="hg.1.html#phases"><tt class="docutils literal">hg help
- phases</tt></a>.</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>Secret</dt>
- <dd>Changesets in the secret phase may not be shared via push, pull,
- or clone. See <a class="reference external" href="hg.1.html#phases"><tt class="docutils literal">hg help phases</tt></a>.</dd>
- <dt>Tag</dt>
- <dd>An alternative name given to a changeset. Tags can be used in all
- places where Mercurial expects a changeset ID, e.g., with
- <a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update</tt></a>. The creation of a tag is stored in the history and
- will thus automatically be shared with other using push and pull.</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="syntax-for-mercurial-ignore-files">
- <span id="ignore"></span><span id="hgignore"></span><h1><a class="toc-backref" href="#contents">Syntax for Mercurial Ignore Files</a></h1>
- <div class="section" id="id2">
- <h2>Synopsis</h2>
- <p>The Mercurial system uses a file called <tt class="docutils literal">.hgignore</tt> in the root
- directory of a repository to control its behavior when it searches
- for files that it is not currently tracking.</p>
- </div>
- <div class="section" id="id3">
- <h2>Description</h2>
- <p>The working directory of a Mercurial repository will often contain
- files that should not be tracked by Mercurial. These include backup
- files created by editors and build products created by compilers.
- These files can be ignored by listing them in a <tt class="docutils literal">.hgignore</tt> file in
- the root of the working directory. The <tt class="docutils literal">.hgignore</tt> file must be
- created manually. It is typically put under version control, so that
- the settings will propagate to other repositories with push and pull.</p>
- <p>An untracked file is ignored if its path relative to the repository
- root directory, or any prefix path of that path, is matched against
- any pattern in <tt class="docutils literal">.hgignore</tt>.</p>
- <p>For example, say we have an untracked file, <tt class="docutils literal">file.c</tt>, at
- <tt class="docutils literal">a/b/file.c</tt> inside our repository. Mercurial will ignore <tt class="docutils literal">file.c</tt>
- if any pattern in <tt class="docutils literal">.hgignore</tt> matches <tt class="docutils literal">a/b/file.c</tt>, <tt class="docutils literal">a/b</tt> or <tt class="docutils literal">a</tt>.</p>
- <p>In addition, a Mercurial configuration file can reference a set of
- per-user or global ignore files. See the <tt class="docutils literal">ignore</tt> configuration
- key on the <tt class="docutils literal">[ui]</tt> section of <a class="reference external" href="hg.1.html#config"><tt class="docutils literal">hg help config</tt></a> for details of how to
- configure these files.</p>
- <p>To control Mercurial's handling of files that it manages, many
- commands support the <tt class="docutils literal"><span class="pre">-I</span></tt> and <tt class="docutils literal"><span class="pre">-X</span></tt> options; see
- <a class="reference external" href="hg.1.html#<command>"><tt class="docutils literal">hg help <command></tt></a> and <a class="reference external" href="hg.1.html#patterns"><tt class="docutils literal">hg help patterns</tt></a> for details.</p>
- <p>Files that are already tracked are not affected by .hgignore, even
- if they appear in .hgignore. An untracked file X can be explicitly
- added with <a class="reference external" href="hg.1.html#add"><tt class="docutils literal">hg add X</tt></a>, even if X would be excluded by a pattern
- in .hgignore.</p>
- </div>
- <div class="section" id="syntax">
- <h2>Syntax</h2>
- <p>An ignore file is a plain text file consisting of a list of patterns,
- with one pattern per line. Empty lines are skipped. The <tt class="docutils literal">#</tt>
- character is treated as a comment character, and the <tt class="docutils literal">\</tt> character
- is treated as an escape character.</p>
- <p>Mercurial supports several pattern syntaxes. The default syntax used
- is Python/Perl-style regular expressions.</p>
- <p>To change the syntax used, use a line of the following form:</p>
- <pre class="literal-block">
- syntax: NAME
- </pre>
- <p>where <tt class="docutils literal">NAME</tt> is one of the following:</p>
- <dl class="docutils">
- <dt><tt class="docutils literal">regexp</tt></dt>
- <dd>Regular expression, Python/Perl syntax.</dd>
- <dt><tt class="docutils literal">glob</tt></dt>
- <dd>Shell-style glob.</dd>
- </dl>
- <p>The chosen syntax stays in effect when parsing all patterns that
- follow, until another syntax is selected.</p>
- <p>Neither glob nor regexp patterns are rooted. A glob-syntax pattern of
- the form <tt class="docutils literal">*.c</tt> will match a file ending in <tt class="docutils literal">.c</tt> in any directory,
- and a regexp pattern of the form <tt class="docutils literal">\.c$</tt> will do the same. To root a
- regexp pattern, start it with <tt class="docutils literal">^</tt>.</p>
- <p>Subdirectories can have their own .hgignore settings by adding
- <tt class="docutils literal"><span class="pre">subinclude:path/to/subdir/.hgignore</span></tt> to the root <tt class="docutils literal">.hgignore</tt>. See
- <a class="reference external" href="hg.1.html#patterns"><tt class="docutils literal">hg help patterns</tt></a> for details on <tt class="docutils literal">subinclude:</tt> and <tt class="docutils literal">include:</tt>.</p>
- <div class="note">
- <p class="first admonition-title">Note</p>
- <p class="last">Patterns specified in other than <tt class="docutils literal">.hgignore</tt> are always rooted.
- Please see <a class="reference external" href="hg.1.html#patterns"><tt class="docutils literal">hg help patterns</tt></a> for details.</p>
- </div>
- </div>
- <div class="section" id="example">
- <h2>Example</h2>
- <p>Here is an example ignore file.</p>
- <pre class="literal-block">
- # use glob syntax.
- syntax: glob
- *.elc
- *.pyc
- *~
- # switch to regexp syntax.
- syntax: regexp
- ^\.pc/
- </pre>
- </div>
- </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 tree of repositories. In the second case, repository
- paths and global options can be defined using a dedicated
- configuration file common to <a class="reference external" href="hg.1.html#serve"><tt class="docutils literal">hg serve</tt></a>, <tt class="docutils literal">hgweb.wsgi</tt>,
- <tt class="docutils literal">hgweb.cgi</tt> and <tt class="docutils literal">hgweb.fcgi</tt>.</p>
- <p>This file uses the same syntax as other Mercurial configuration files
- but recognizes only the following sections:</p>
- <blockquote>
- <ul class="simple">
- <li>web</li>
- <li>paths</li>
- <li>collections</li>
- </ul>
- </blockquote>
- <p>The <tt class="docutils literal">web</tt> options are thoroughly described in <a class="reference external" href="hg.1.html#config"><tt class="docutils literal">hg help config</tt></a>.</p>
- <p>The <tt class="docutils literal">paths</tt> section maps URL paths to paths of repositories in the
- filesystem. hgweb will not expose the filesystem directly - only
- Mercurial repositories can be published and only according to the
- configuration.</p>
- <p>The left hand side is the path in the URL. Note that hgweb reserves
- subpaths like <tt class="docutils literal">rev</tt> or <tt class="docutils literal">file</tt>, try using different names for
- nested repositories to avoid confusing effects.</p>
- <p>The right hand side is the path in the filesystem. If the specified
- path ends with <tt class="docutils literal">*</tt> or <tt class="docutils literal">**</tt> the filesystem will be searched
- recursively for repositories below that point.
- With <tt class="docutils literal">*</tt> it will not recurse into the repositories it finds (except for
- <tt class="docutils literal">.hg/patches</tt>).
- With <tt class="docutils literal">**</tt> it will also search inside repository working directories
- and possibly find subrepositories.</p>
- <p>In this example:</p>
- <pre class="literal-block">
- [paths]
- /projects/a = /srv/tmprepos/a
- /projects/b = c:/repos/b
- / = /srv/repos/*
- /user/bob = /home/bob/repos/**
- </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 will publish every Mercurial repository found in
- <tt class="docutils literal">/srv/repos/</tt>, for instance the repository <tt class="docutils literal">/srv/repos/quux/</tt>
- will appear as <tt class="docutils literal"><span class="pre">http://server/quux/</span></tt></li>
- <li>The fourth entry will publish both <tt class="docutils literal"><span class="pre">http://server/user/bob/quux/</span></tt>
- and <tt class="docutils literal"><span class="pre">http://server/user/bob/quux/testsubrepo/</span></tt></li>
- </ul>
- <p>The <tt class="docutils literal">collections</tt> section is deprecated and has been superseded by
- <tt class="docutils literal">paths</tt>.</p>
- <div class="section" id="urls-and-common-arguments">
- <h2>URLs and Common Arguments</h2>
- <p>URLs under each repository have the form <tt class="docutils literal"><span class="pre">/{command}[/{arguments}]</span></tt>
- where <tt class="docutils literal">{command}</tt> represents the name of a command or handler and
- <tt class="docutils literal">{arguments}</tt> represents any number of additional URL parameters
- to that command.</p>
- <p>The web server has a default style associated with it. Styles map to
- a collection of named templates. Each template is used to render a
- specific piece of data, such as a changeset or diff.</p>
- <p>The style for the current request can be overwritten two ways. First,
- if <tt class="docutils literal">{command}</tt> contains a hyphen (<tt class="docutils literal">-</tt>), the text before the hyphen
- defines the style. For example, <tt class="docutils literal"><span class="pre">/atom-log</span></tt> will render the <tt class="docutils literal">log</tt>
- command handler with the <tt class="docutils literal">atom</tt> style. The second way to set the
- style is with the <tt class="docutils literal">style</tt> query string argument. For example,
- <tt class="docutils literal"><span class="pre">/log?style=atom</span></tt>. The hyphenated URL parameter is preferred.</p>
- <p>Not all templates are available for all styles. Attempting to use
- a style that doesn't have all templates defined may result in an error
- rendering the page.</p>
- <p>Many commands take a <tt class="docutils literal">{revision}</tt> URL parameter. This defines the
- changeset to operate on. This is commonly specified as the short,
- 12 digit hexidecimal abbreviation for the full 40 character unique
- revision identifier. However, any value described by
- <a class="reference external" href="hg.1.html#revisions"><tt class="docutils literal">hg help revisions</tt></a> typically works.</p>
- </div>
- <div class="section" id="commands-and-urls">
- <h2>Commands and URLs</h2>
- <p>The following web commands and their URLs are available:</p>
- <div class="section" id="annotate-revision-path">
- <h3>/annotate/{revision}/{path}</h3>
- <p>Show changeset information for each line in a file.</p>
- <p>The <tt class="docutils literal">fileannotate</tt> template is rendered.</p>
- </div>
- <div class="section" id="archive-revision-format-path">
- <h3>/archive/{revision}.{format}[/{path}]</h3>
- <p>Obtain an archive of repository content.</p>
- <p>The content and type of the archive is defined by a URL path parameter.
- <tt class="docutils literal">format</tt> is the file extension of the archive type to be generated. e.g.
- <tt class="docutils literal">zip</tt> or <tt class="docutils literal">tar.bz2</tt>. Not all archive types may be allowed by your
- server configuration.</p>
- <p>The optional <tt class="docutils literal">path</tt> URL parameter controls content to include in the
- archive. If omitted, every file in the specified revision is present in the
- archive. If included, only the specified file or contents of the specified
- directory will be included in the archive.</p>
- <p>No template is used for this handler. Raw, binary content is generated.</p>
- </div>
- <div class="section" id="id4">
- <h3>/bookmarks</h3>
- <p>Show information about bookmarks.</p>
- <p>No arguments are accepted.</p>
- <p>The <tt class="docutils literal">bookmarks</tt> template is rendered.</p>
- </div>
- <div class="section" id="id5">
- <h3>/branches</h3>
- <p>Show information about branches.</p>
- <p>All known branches are contained in the output, even closed branches.</p>
- <p>No arguments are accepted.</p>
- <p>The <tt class="docutils literal">branches</tt> template is rendered.</p>
- </div>
- <div class="section" id="changelog-revision">
- <h3>/changelog[/{revision}]</h3>
- <p>Show information about multiple changesets.</p>
- <p>If the optional <tt class="docutils literal">revision</tt> URL argument is absent, information about
- all changesets starting at <tt class="docutils literal">tip</tt> will be rendered. If the <tt class="docutils literal">revision</tt>
- argument is present, changesets will be shown starting from the specified
- revision.</p>
- <p>If <tt class="docutils literal">revision</tt> is absent, the <tt class="docutils literal">rev</tt> query string argument may be
- defined. This will perform a search for changesets.</p>
- <p>The argument for <tt class="docutils literal">rev</tt> can be a single revision, a revision set,
- or a literal keyword to search for in changeset data (equivalent to
- <a class="reference external" href="hg.1.html#log"><tt class="docutils literal">hg log <span class="pre">-k</span></tt></a>).</p>
- <p>The <tt class="docutils literal">revcount</tt> query string argument defines the maximum numbers of
- changesets to render.</p>
- <p>For non-searches, the <tt class="docutils literal">changelog</tt> template will be rendered.</p>
- </div>
- <div class="section" id="changeset-revision">
- <h3>/changeset[/{revision}]</h3>
- <p>Show information about a single changeset.</p>
- <p>A URL path argument is the changeset identifier to show. See <tt class="docutils literal">hg help
- revisions</tt> for possible values. If not defined, the <tt class="docutils literal">tip</tt> changeset
- will be shown.</p>
- <p>The <tt class="docutils literal">changeset</tt> template is rendered. Contents of the <tt class="docutils literal">changesettag</tt>,
- <tt class="docutils literal">changesetbookmark</tt>, <tt class="docutils literal">filenodelink</tt>, <tt class="docutils literal">filenolink</tt>, and the many
- templates related to diffs may all be used to produce the output.</p>
- </div>
- <div class="section" id="comparison-revision-path">
- <h3>/comparison/{revision}/{path}</h3>
- <p>Show a comparison between the old and new versions of a file from changes
- made on a particular revision.</p>
- <p>This is similar to the <tt class="docutils literal">diff</tt> handler. However, this form features
- a split or side-by-side diff rather than a unified diff.</p>
- <p>The <tt class="docutils literal">context</tt> query string argument can be used to control the lines of
- context in the diff.</p>
- <p>The <tt class="docutils literal">filecomparison</tt> template is rendered.</p>
- </div>
- <div class="section" id="diff-revision-path">
- <h3>/diff/{revision}/{path}</h3>
- <p>Show how a file changed in a particular commit.</p>
- <p>The <tt class="docutils literal">filediff</tt> template is rendered.</p>
- <p>This hander is registered under both the <tt class="docutils literal">/diff</tt> and <tt class="docutils literal">/filediff</tt>
- paths. <tt class="docutils literal">/diff</tt> is used in modern code.</p>
- </div>
- <div class="section" id="file-revision-path">
- <h3>/file/{revision}[/{path}]</h3>
- <p>Show information about a directory or file in the repository.</p>
- <p>Info about the <tt class="docutils literal">path</tt> given as a URL parameter will be rendered.</p>
- <p>If <tt class="docutils literal">path</tt> is a directory, information about the entries in that
- directory will be rendered. This form is equivalent to the <tt class="docutils literal">manifest</tt>
- handler.</p>
- <p>If <tt class="docutils literal">path</tt> is a file, information about that file will be shown via
- the <tt class="docutils literal">filerevision</tt> template.</p>
- <p>If <tt class="docutils literal">path</tt> is not defined, information about the root directory will
- be rendered.</p>
- </div>
- <div class="section" id="id6">
- <h3>/diff/{revision}/{path}</h3>
- <p>Show how a file changed in a particular commit.</p>
- <p>The <tt class="docutils literal">filediff</tt> template is rendered.</p>
- <p>This hander is registered under both the <tt class="docutils literal">/diff</tt> and <tt class="docutils literal">/filediff</tt>
- paths. <tt class="docutils literal">/diff</tt> is used in modern code.</p>
- </div>
- <div class="section" id="filelog-revision-path">
- <h3>/filelog/{revision}/{path}</h3>
- <p>Show information about the history of a file in the repository.</p>
- <p>The <tt class="docutils literal">revcount</tt> query string argument can be defined to control the
- maximum number of entries to show.</p>
- <p>The <tt class="docutils literal">filelog</tt> template will be rendered.</p>
- </div>
- <div class="section" id="graph-revision">
- <h3>/graph[/{revision}]</h3>
- <p>Show information about the graphical topology of the repository.</p>
- <p>Information rendered by this handler can be used to create visual
- representations of repository topology.</p>
- <p>The <tt class="docutils literal">revision</tt> URL parameter controls the starting changeset.</p>
- <p>The <tt class="docutils literal">revcount</tt> query string argument can define the number of changesets
- to show information for.</p>
- <p>This handler will render the <tt class="docutils literal">graph</tt> template.</p>
- </div>
- <div class="section" id="help-topic">
- <h3>/help[/{topic}]</h3>
- <p>Render help documentation.</p>
- <p>This web command is roughly equivalent to <a class="reference external" href="hg.1.html#help"><tt class="docutils literal">hg help</tt></a>. If a <tt class="docutils literal">topic</tt>
- is defined, that help topic will be rendered. If not, an index of
- available help topics will be rendered.</p>
- <p>The <tt class="docutils literal">help</tt> template will be rendered when requesting help for a topic.
- <tt class="docutils literal">helptopics</tt> will be rendered for the index of help topics.</p>
- </div>
- <div class="section" id="log-revision-path">
- <h3>/log[/{revision}[/{path}]]</h3>
- <p>Show repository or file history.</p>
- <p>For URLs of the form <tt class="docutils literal"><span class="pre">/log/{revision}</span></tt>, a list of changesets starting at
- the specified changeset identifier is shown. If <tt class="docutils literal">{revision}</tt> is not
- defined, the default is <tt class="docutils literal">tip</tt>. This form is equivalent to the
- <tt class="docutils literal">changelog</tt> handler.</p>
- <p>For URLs of the form <tt class="docutils literal"><span class="pre">/log/{revision}/{file}</span></tt>, the history for a specific
- file will be shown. This form is equivalent to the <tt class="docutils literal">filelog</tt> handler.</p>
- </div>
- <div class="section" id="manifest-revision-path">
- <h3>/manifest[/{revision}[/{path}]]</h3>
- <p>Show information about a directory.</p>
- <p>If the URL path arguments are omitted, information about the root
- directory for the <tt class="docutils literal">tip</tt> changeset will be shown.</p>
- <p>Because this handler can only show information for directories, it
- is recommended to use the <tt class="docutils literal">file</tt> handler instead, as it can handle both
- directories and files.</p>
- <p>The <tt class="docutils literal">manifest</tt> template will be rendered for this handler.</p>
- </div>
- <div class="section" id="id7">
- <h3>/changeset[/{revision}]</h3>
- <p>Show information about a single changeset.</p>
- <p>A URL path argument is the changeset identifier to show. See <tt class="docutils literal">hg help
- revisions</tt> for possible values. If not defined, the <tt class="docutils literal">tip</tt> changeset
- will be shown.</p>
- <p>The <tt class="docutils literal">changeset</tt> template is rendered. Contents of the <tt class="docutils literal">changesettag</tt>,
- <tt class="docutils literal">changesetbookmark</tt>, <tt class="docutils literal">filenodelink</tt>, <tt class="docutils literal">filenolink</tt>, and the many
- templates related to diffs may all be used to produce the output.</p>
- </div>
- <div class="section" id="shortlog">
- <h3>/shortlog</h3>
- <p>Show basic information about a set of changesets.</p>
- <p>This accepts the same parameters as the <tt class="docutils literal">changelog</tt> handler. The only
- difference is the <tt class="docutils literal">shortlog</tt> template will be rendered instead of the
- <tt class="docutils literal">changelog</tt> template.</p>
- </div>
- <div class="section" id="id8">
- <h3>/summary</h3>
- <p>Show a summary of repository state.</p>
- <p>Information about the latest changesets, bookmarks, tags, and branches
- is captured by this handler.</p>
- <p>The <tt class="docutils literal">summary</tt> template is rendered.</p>
- </div>
- <div class="section" id="id9">
- <h3>/tags</h3>
- <p>Show information about tags.</p>
- <p>No arguments are accepted.</p>
- <p>The <tt class="docutils literal">tags</tt> template is rendered.</p>
- </div>
- </div>
- </div>
- <div class="section" id="id10">
- <span id="mergetools"></span><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">: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>
- <dt><tt class="docutils literal">: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">:local</tt></dt>
- <dd>Uses the local version of files as the merged version.</dd>
- <dt><tt class="docutils literal">: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. Markers will have two sections, one for each side
- of merge.</dd>
- <dt><tt class="docutils literal">:merge3</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. Marker will have three sections, one from each
- side of the merge and one for the base content.</dd>
- <dt><tt class="docutils literal">:other</tt></dt>
- <dd>Uses the other version of files as the merged version.</dd>
- <dt><tt class="docutils literal">: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">:tagmerge</tt></dt>
- <dd>Uses the internal tag merge algorithm (experimental).</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
- internal <tt class="docutils literal">: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="specifying-multiple-revisions">
- <span id="mrevs"></span><span id="multirevs"></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="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>
- <div class="note">
- <p class="first admonition-title">Note</p>
- <p class="last">Patterns specified in <tt class="docutils literal">.hgignore</tt> are not rooted.
- Please see <a class="reference external" href="hg.1.html#hgignore"><tt class="docutils literal">hg help hgignore</tt></a> for details.</p>
- </div>
- <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>To read name patterns from a file, use <tt class="docutils literal">listfile:</tt> or <tt class="docutils literal">listfile0:</tt>.
- The latter expects null delimited patterns while the former expects line
- feeds. Each string read from the file is itself treated as a file
- pattern.</p>
- <p>To read a set of patterns from a file, use <tt class="docutils literal">include:</tt> or <tt class="docutils literal">subinclude:</tt>.
- <tt class="docutils literal">include:</tt> will use all the patterns from the given file and treat them as if
- they had been passed in manually. <tt class="docutils literal">subinclude:</tt> will only apply the patterns
- against files that are under the subinclude file's directory. See <a class="reference external" href="hg.1.html#hgignore"><tt class="docutils literal">hg help
- hgignore</tt></a> for details on the format of these files.</p>
- <p>All patterns, except for <tt class="docutils literal">glob:</tt> specified in command line (not for
- <tt class="docutils literal"><span class="pre">-I</span></tt> or <tt class="docutils literal"><span class="pre">-X</span></tt> options), can match also against directories: files
- under matched directories are treated as matched.</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>
- <p>File examples:</p>
- <pre class="literal-block">
- listfile:list.txt read list from list.txt with one file pattern per line
- listfile0:list.txt read list from list.txt with null byte delimiters
- </pre>
- <p>See also <a class="reference external" href="hg.1.html#filesets"><tt class="docutils literal">hg help filesets</tt></a>.</p>
- <p>Include examples:</p>
- <pre class="literal-block">
- include:path/to/mypatternfile reads patterns to be applied to all paths
- subinclude:path/to/subignorefile reads patterns specifically for paths in the
- subdirectory
- </pre>
- </div>
- <div class="section" id="working-with-phases">
- <span id="phases"></span><h1><a class="toc-backref" href="#contents">Working with Phases</a></h1>
- <div class="section" id="what-are-phases">
- <h2>What are phases?</h2>
- <p>Phases are a system for tracking which changesets have been or should
- be shared. This helps prevent common mistakes when modifying history
- (for instance, with the mq or rebase extensions).</p>
- <p>Each changeset in a repository is in one of the following phases:</p>
- <blockquote>
- <ul class="simple">
- <li>public : changeset is visible on a public server</li>
- <li>draft : changeset is not yet published</li>
- <li>secret : changeset should not be pushed, pulled, or cloned</li>
- </ul>
- </blockquote>
- <p>These phases are ordered (public < draft < secret) and no changeset
- can be in a lower phase than its ancestors. For instance, if a
- changeset is public, all its ancestors are also public. Lastly,
- changeset phases should only be changed towards the public phase.</p>
- </div>
- <div class="section" id="how-are-phases-managed">
- <h2>How are phases managed?</h2>
- <p>For the most part, phases should work transparently. By default, a
- changeset is created in the draft phase and is moved into the public
- phase when it is pushed to another repository.</p>
- <p>Once changesets become public, extensions like mq and rebase will
- refuse to operate on them to prevent creating duplicate changesets.
- Phases can also be manually manipulated with the <a class="reference external" href="hg.1.html#phase"><tt class="docutils literal">hg phase</tt></a> command
- if needed. See <a class="reference external" href="hg.1.html#-v"><tt class="docutils literal">hg help <span class="pre">-v</span> phase</tt></a> for examples.</p>
- </div>
- <div class="section" id="phases-and-servers">
- <h2>Phases and servers</h2>
- <p>Normally, all servers are <tt class="docutils literal">publishing</tt> by default. This means:</p>
- <pre class="literal-block">
- - all draft changesets that are pulled or cloned appear in phase
- public on the client
- - all draft changesets that are pushed appear as public on both
- client and server
- - secret changesets are neither pushed, pulled, or cloned
- </pre>
- <div class="note">
- <p class="first admonition-title">Note</p>
- <p class="last">Pulling a draft changeset from a publishing server does not mark it
- as public on the server side due to the read-only nature of pull.</p>
- </div>
- <p>Sometimes it may be desirable to push and pull changesets in the draft
- phase to share unfinished work. This can be done by setting a
- repository to disable publishing in its configuration file:</p>
- <pre class="literal-block">
- [phases]
- publish = False
- </pre>
- <p>See <a class="reference external" href="hg.1.html#config"><tt class="docutils literal">hg help config</tt></a> for more information on configuration files.</p>
- <div class="note">
- <p class="first admonition-title">Note</p>
- <p class="last">Servers running older versions of Mercurial are treated as
- publishing.</p>
- </div>
- <div class="note">
- <p class="first admonition-title">Note</p>
- <p class="last">Changesets in secret phase are not exchanged with the server. This
- applies to their content: file names, file contents, and changeset
- metadata. For technical reasons, the identifier (e.g. d825e4025e39)
- of the secret changeset may be communicated to the server.</p>
- </div>
- </div>
- <div class="section" id="examples">
- <h2>Examples</h2>
- <blockquote>
- <ul>
- <li><p class="first">list changesets in draft or secret phase:</p>
- <pre class="literal-block">
- hg log -r "not public()"
- </pre>
- </li>
- <li><p class="first">change all secret changesets to draft:</p>
- <pre class="literal-block">
- hg phase --draft "secret()"
- </pre>
- </li>
- <li><p class="first">forcibly move the current changeset and descendants from public to draft:</p>
- <pre class="literal-block">
- hg phase --force --draft .
- </pre>
- </li>
- <li><p class="first">show a list of changeset revision and phase:</p>
- <pre class="literal-block">
- hg log --template "{rev} {phase}\n"
- </pre>
- </li>
- <li><p class="first">resynchronize draft changesets relative to a remote repository:</p>
- <pre class="literal-block">
- hg phase -fd "outgoing(URL)"
- </pre>
- </li>
- </ul>
- </blockquote>
- <p>See <a class="reference external" href="hg.1.html#phase"><tt class="docutils literal">hg help phase</tt></a> for more information on manually manipulating phases.</p>
- </div>
- </div>
- <div class="section" id="specifying-single-revisions">
- <span id="revs"></span><span id="revisions"></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 bookmark, tag, or branch name. A
- bookmark is a movable pointer to a revision. A tag is a permanent name
- associated with a revision. A branch name denotes the tipmost open branch head
- of that branch - or if they are all closed, the tipmost closed head of the
- branch. Bookmark, tag, and branch names must not contain the ":" character.</p>
- <p>The reserved name "tip" 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-revision-sets">
- <span id="revset"></span><span id="revsets"></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 may need quoting with single or
- double quotes if they contain characters like <tt class="docutils literal">-</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>
- <dt><tt class="docutils literal">x^n</tt></dt>
- <dd>The nth parent of x, n == 0, 1, or 2.
- For n == 0, x; for n == 1, the first parent of each changeset in x;
- for n == 2, the second parent of changeset in x.</dd>
- <dt><tt class="docutils literal">x~n</tt></dt>
- <dd>The nth first ancestor of x; <tt class="docutils literal">x~0</tt> is x; <tt class="docutils literal">x~3</tt> is <tt class="docutils literal"><span class="pre">x^^^</span></tt>.</dd>
- </dl>
- <p>There is a single postfix operator:</p>
- <dl class="docutils">
- <dt><tt class="docutils literal">x^</tt></dt>
- <dd>Equivalent to <tt class="docutils literal">x^1</tt>, the first parent of each changeset in x.</dd>
- </dl>
- <p>The following predicates are supported:</p>
- <dl class="docutils">
- <dt><tt class="docutils literal">adds(pattern)</tt></dt>
- <dd><p class="first">Changesets that add a file matching pattern.</p>
- <p class="last">The pattern without explicit kind like <tt class="docutils literal">glob:</tt> is expected to be
- relative to the current directory and match against a file or a
- directory.</p>
- </dd>
- <dt><tt class="docutils literal">all()</tt></dt>
- <dd>All changesets, the same as <tt class="docutils literal">0:tip</tt>.</dd>
- <dt><tt class="docutils literal"><span class="pre">ancestor(*changeset)</span></tt></dt>
- <dd><p class="first">A greatest common ancestor of the changesets.</p>
- <p class="last">Accepts 0 or more changesets.
- Will return empty list when passed no args.
- Greatest common ancestor of a single changeset is that changeset.</p>
- </dd>
- <dt><tt class="docutils literal">ancestors(set)</tt></dt>
- <dd>Changesets that are ancestors of a changeset in set.</dd>
- <dt><tt class="docutils literal">author(string)</tt></dt>
- <dd>Alias for <tt class="docutils literal">user(string)</tt>.</dd>
- <dt><tt class="docutils literal">bisect(string)</tt></dt>
- <dd><p class="first">Changesets marked in the specified bisect status:</p>
- <ul class="last simple">
- <li><tt class="docutils literal">good</tt>, <tt class="docutils literal">bad</tt>, <tt class="docutils literal">skip</tt>: csets explicitly marked as good/bad/skip</li>
- <li><tt class="docutils literal">goods</tt>, <tt class="docutils literal">bads</tt> : csets topologically good/bad</li>
- <li><tt class="docutils literal">range</tt> : csets taking part in the bisection</li>
- <li><tt class="docutils literal">pruned</tt> : csets that are goods, bads or skipped</li>
- <li><tt class="docutils literal">untested</tt> : csets whose fate is yet unknown</li>
- <li><tt class="docutils literal">ignored</tt> : csets ignored due to DAG topology</li>
- <li><tt class="docutils literal">current</tt> : the cset currently being bisected</li>
- </ul>
- </dd>
- <dt><tt class="docutils literal"><span class="pre">bookmark([name])</span></tt></dt>
- <dd><p class="first">The named bookmark or all bookmarks.</p>
- <p class="last">If <cite>name</cite> starts with <cite>re:</cite>, the remainder of the name is treated as
- a regular expression. To match a bookmark that actually starts with <cite>re:</cite>,
- use the prefix <cite>literal:</cite>.</p>
- </dd>
- <dt><tt class="docutils literal">branch(string or set)</tt></dt>
- <dd><p class="first">All changesets belonging to the given branch or the branches of the given
- changesets.</p>
- <p class="last">If <cite>string</cite> starts with <cite>re:</cite>, the remainder of the name is treated as
- a regular expression. To match a branch that actually starts with <cite>re:</cite>,
- use the prefix <cite>literal:</cite>.</p>
- </dd>
- <dt><tt class="docutils literal">branchpoint()</tt></dt>
- <dd>Changesets with more than one child.</dd>
- <dt><tt class="docutils literal">bumped()</tt></dt>
- <dd><p class="first">Mutable changesets marked as successors of public changesets.</p>
- <p class="last">Only non-public and non-obsolete changesets can be <cite>bumped</cite>.</p>
- </dd>
- <dt><tt class="docutils literal">bundle()</tt></dt>
- <dd><p class="first">Changesets in the bundle.</p>
- <p class="last">Bundle must be specified by the -R option.</p>
- </dd>
- <dt><tt class="docutils literal">children(set)</tt></dt>
- <dd>Child changesets of changesets in set.</dd>
- <dt><tt class="docutils literal">closed()</tt></dt>
- <dd>Changeset is closed.</dd>
- <dt><tt class="docutils literal">contains(pattern)</tt></dt>
- <dd><p class="first">The revision's manifest contains a file matching pattern (but might not
- modify it). See <a class="reference external" href="hg.1.html#patterns"><tt class="docutils literal">hg help patterns</tt></a> for information about file patterns.</p>
- <p class="last">The pattern without explicit kind like <tt class="docutils literal">glob:</tt> is expected to be
- relative to the current directory and match against a file exactly
- for efficiency.</p>
- </dd>
- <dt><tt class="docutils literal"><span class="pre">converted([id])</span></tt></dt>
- <dd>Changesets converted from the given identifier in the old repository if
- present, or all converted changesets if no identifier is specified.</dd>
- <dt><tt class="docutils literal">date(interval)</tt></dt>
- <dd>Changesets within the interval, see <a class="reference external" href="hg.1.html#dates"><tt class="docutils literal">hg help dates</tt></a>.</dd>
- <dt><tt class="docutils literal">desc(string)</tt></dt>
- <dd>Search commit message for string. The match is case-insensitive.</dd>
- <dt><tt class="docutils literal">descendants(set)</tt></dt>
- <dd>Changesets which are descendants of changesets in set.</dd>
- <dt><tt class="docutils literal"><span class="pre">destination([set])</span></tt></dt>
- <dd>Changesets that were created by a graft, transplant or rebase operation,
- with the given revisions specified as the source. Omitting the optional set
- is the same as passing all().</dd>
- <dt><tt class="docutils literal">divergent()</tt></dt>
- <dd>Final successors of changesets with an alternative set of final successors.</dd>
- <dt><tt class="docutils literal">draft()</tt></dt>
- <dd>Changeset in draft phase.</dd>
- <dt><tt class="docutils literal">extinct()</tt></dt>
- <dd>Obsolete changesets with obsolete descendants only.</dd>
- <dt><tt class="docutils literal">extra(label, [value])</tt></dt>
- <dd><p class="first">Changesets with the given label in the extra metadata, with the given
- optional value.</p>
- <p class="last">If <cite>value</cite> starts with <cite>re:</cite>, the remainder of the value is treated as
- a regular expression. To match a value that actually starts with <cite>re:</cite>,
- use the prefix <cite>literal:</cite>.</p>
- </dd>
- <dt><tt class="docutils literal">file(pattern)</tt></dt>
- <dd><p class="first">Changesets affecting files matched by pattern.</p>
- <p>For a faster but less accurate result, consider using <tt class="docutils literal">filelog()</tt>
- instead.</p>
- <p class="last">This predicate uses <tt class="docutils literal">glob:</tt> as the default kind of pattern.</p>
- </dd>
- <dt><tt class="docutils literal">filelog(pattern)</tt></dt>
- <dd><p class="first">Changesets connected to the specified filelog.</p>
- <p>For performance reasons, visits only revisions mentioned in the file-level
- filelog, rather than filtering through all changesets (much faster, but
- doesn't include deletes or duplicate changes). For a slower, more accurate
- result, use <tt class="docutils literal">file()</tt>.</p>
- <p>The pattern without explicit kind like <tt class="docutils literal">glob:</tt> is expected to be
- relative to the current directory and match against a file exactly
- for efficiency.</p>
- <p class="last">If some linkrev points to revisions filtered by the current repoview, we'll
- work around it to return a non-filtered value.</p>
- </dd>
- <dt><tt class="docutils literal">first(set, [n])</tt></dt>
- <dd>An alias for limit().</dd>
- <dt><tt class="docutils literal"><span class="pre">follow([file])</span></tt></dt>
- <dd>An alias for <tt class="docutils literal">::.</tt> (ancestors of the working directory's first parent).
- If a filename is specified, the history of the given file is followed,
- including copies.</dd>
- <dt><tt class="docutils literal">grep(regex)</tt></dt>
- <dd>Like <tt class="docutils literal">keyword(string)</tt> but accepts a regex. Use <tt class="docutils literal"><span class="pre">grep(r'...')</span></tt>
- to ensure special escape characters are handled correctly. Unlike
- <tt class="docutils literal">keyword(string)</tt>, the match is case-sensitive.</dd>
- <dt><tt class="docutils literal">head()</tt></dt>
- <dd>Changeset is a named branch head.</dd>
- <dt><tt class="docutils literal">heads(set)</tt></dt>
- <dd>Members of set with no children in set.</dd>
- <dt><tt class="docutils literal">hidden()</tt></dt>
- <dd>Hidden changesets.</dd>
- <dt><tt class="docutils literal">id(string)</tt></dt>
- <dd>Revision non-ambiguously specified by the given hex string prefix.</dd>
- <dt><tt class="docutils literal">keyword(string)</tt></dt>
- <dd>Search commit message, user name, and names of changed files for
- string. The match is case-insensitive.</dd>
- <dt><tt class="docutils literal">last(set, [n])</tt></dt>
- <dd>Last n members of set, defaulting to 1.</dd>
- <dt><tt class="docutils literal">limit(set, [n])</tt></dt>
- <dd>First n members of set, defaulting to 1.</dd>
- <dt><tt class="docutils literal">matching(revision [, field])</tt></dt>
- <dd><p class="first">Changesets in which a given set of fields match the set of fields in the
- selected revision or set.</p>
- <p>To match more than one field pass the list of fields to match separated
- by spaces (e.g. <tt class="docutils literal">author description</tt>).</p>
- <p>Valid fields are most regular revision fields and some special fields.</p>
- <p>Regular revision fields are <tt class="docutils literal">description</tt>, <tt class="docutils literal">author</tt>, <tt class="docutils literal">branch</tt>,
- <tt class="docutils literal">date</tt>, <tt class="docutils literal">files</tt>, <tt class="docutils literal">phase</tt>, <tt class="docutils literal">parents</tt>, <tt class="docutils literal">substate</tt>, <tt class="docutils literal">user</tt>
- and <tt class="docutils literal">diff</tt>.
- Note that <tt class="docutils literal">author</tt> and <tt class="docutils literal">user</tt> are synonyms. <tt class="docutils literal">diff</tt> refers to the
- contents of the revision. Two revisions matching their <tt class="docutils literal">diff</tt> will
- also match their <tt class="docutils literal">files</tt>.</p>
- <p>Special fields are <tt class="docutils literal">summary</tt> and <tt class="docutils literal">metadata</tt>:
- <tt class="docutils literal">summary</tt> matches the first line of the description.
- <tt class="docutils literal">metadata</tt> is equivalent to matching <tt class="docutils literal">description user date</tt>
- (i.e. it matches the main metadata fields).</p>
- <p class="last"><tt class="docutils literal">metadata</tt> is the default field which is used when no fields are
- specified. You can match more than one field at a time.</p>
- </dd>
- <dt><tt class="docutils literal">max(set)</tt></dt>
- <dd>Changeset with highest revision number in set.</dd>
- <dt><tt class="docutils literal">merge()</tt></dt>
- <dd>Changeset is a merge changeset.</dd>
- <dt><tt class="docutils literal">min(set)</tt></dt>
- <dd>Changeset with lowest revision number in set.</dd>
- <dt><tt class="docutils literal">modifies(pattern)</tt></dt>
- <dd><p class="first">Changesets modifying files matched by pattern.</p>
- <p class="last">The pattern without explicit kind like <tt class="docutils literal">glob:</tt> is expected to be
- relative to the current directory and match against a file or a
- directory.</p>
- </dd>
- <dt><tt class="docutils literal">named(namespace)</tt></dt>
- <dd><p class="first">The changesets in a given namespace.</p>
- <p class="last">If <cite>namespace</cite> starts with <cite>re:</cite>, the remainder of the string is treated as
- a regular expression. To match a namespace that actually starts with <cite>re:</cite>,
- use the prefix <cite>literal:</cite>.</p>
- </dd>
- <dt><tt class="docutils literal">obsolete()</tt></dt>
- <dd>Mutable changeset with a newer version.</dd>
- <dt><tt class="docutils literal">only(set, [set])</tt></dt>
- <dd>Changesets that are ancestors of the first set that are not ancestors
- of any other head in the repo. If a second set is specified, the result
- is ancestors of the first set that are not ancestors of the second set
- (i.e. ::<set1> - ::<set2>).</dd>
- <dt><tt class="docutils literal"><span class="pre">origin([set])</span></tt></dt>
- <dd>Changesets that were specified as a source for the grafts, transplants or
- rebases that created the given revisions. Omitting the optional set is the
- same as passing all(). If a changeset created by these operations is itself
- specified as a source for one of these operations, only the source changeset
- for the first operation is selected.</dd>
- <dt><tt class="docutils literal"><span class="pre">outgoing([path])</span></tt></dt>
- <dd>Changesets not found in the specified destination repository, or the
- default push location.</dd>
- <dt><tt class="docutils literal"><span class="pre">p1([set])</span></tt></dt>
- <dd>First parent of changesets in set, or the working directory.</dd>
- <dt><tt class="docutils literal"><span class="pre">p2([set])</span></tt></dt>
- <dd>Second parent of changesets in set, or the working directory.</dd>
- <dt><tt class="docutils literal"><span class="pre">parents([set])</span></tt></dt>
- <dd>The set of all parents for all changesets in set, or the working directory.</dd>
- <dt><tt class="docutils literal">present(set)</tt></dt>
- <dd><p class="first">An empty set, if any revision in set isn't found; otherwise,
- all revisions in set.</p>
- <p class="last">If any of specified revisions is not present in the local repository,
- the query is normally aborted. But this predicate allows the query
- to continue even in such cases.</p>
- </dd>
- <dt><tt class="docutils literal">public()</tt></dt>
- <dd>Changeset in public phase.</dd>
- <dt><tt class="docutils literal"><span class="pre">remote([id</span> <span class="pre">[,path]])</span></tt></dt>
- <dd>Local revision that corresponds to the given identifier in a
- remote repository, if present. Here, the '.' identifier is a
- synonym for the current local branch.</dd>
- <dt><tt class="docutils literal">removes(pattern)</tt></dt>
- <dd><p class="first">Changesets which remove files matching pattern.</p>
- <p class="last">The pattern without explicit kind like <tt class="docutils literal">glob:</tt> is expected to be
- relative to the current directory and match against a file or a
- directory.</p>
- </dd>
- <dt><tt class="docutils literal">rev(number)</tt></dt>
- <dd>Revision with the given numeric identifier.</dd>
- <dt><tt class="docutils literal">reverse(set)</tt></dt>
- <dd>Reverse order of set.</dd>
- <dt><tt class="docutils literal">roots(set)</tt></dt>
- <dd>Changesets in set with no parent changeset in set.</dd>
- <dt><tt class="docutils literal">secret()</tt></dt>
- <dd>Changeset in secret phase.</dd>
- <dt><tt class="docutils literal">sort(set[, <span class="pre">[-]key...])</span></tt></dt>
- <dd><p class="first">Sort set by keys. The default sort order is ascending, specify a key
- as <tt class="docutils literal"><span class="pre">-key</span></tt> to sort in descending order.</p>
- <p>The keys can be:</p>
- <ul class="last simple">
- <li><tt class="docutils literal">rev</tt> for the revision number,</li>
- <li><tt class="docutils literal">branch</tt> for the branch name,</li>
- <li><tt class="docutils literal">desc</tt> for the commit message (description),</li>
- <li><tt class="docutils literal">user</tt> for user name (<tt class="docutils literal">author</tt> can be used as an alias),</li>
- <li><tt class="docutils literal">date</tt> for the commit date</li>
- </ul>
- </dd>
- <dt><tt class="docutils literal"><span class="pre">subrepo([pattern])</span></tt></dt>
- <dd>Changesets that add, modify or remove the given subrepo. If no subrepo
- pattern is named, any subrepo changes are returned.</dd>
- <dt><tt class="docutils literal"><span class="pre">tag([name])</span></tt></dt>
- <dd><p class="first">The specified tag by name, or all tagged revisions if no name is given.</p>
- <p class="last">If <cite>name</cite> starts with <cite>re:</cite>, the remainder of the name is treated as
- a regular expression. To match a tag that actually starts with <cite>re:</cite>,
- use the prefix <cite>literal:</cite>.</p>
- </dd>
- <dt><tt class="docutils literal">unstable()</tt></dt>
- <dd>Non-obsolete changesets with obsolete ancestors.</dd>
- <dt><tt class="docutils literal">user(string)</tt></dt>
- <dd><p class="first">User name contains string. The match is case-insensitive.</p>
- <p class="last">If <cite>string</cite> starts with <cite>re:</cite>, the remainder of the string is treated as
- a regular expression. To match a user that actually contains <cite>re:</cite>, use
- the prefix <cite>literal:</cite>.</p>
- </dd>
- </dl>
- <p>New predicates (known as "aliases") can be defined, using any combination of
- existing predicates or other aliases. An alias definition looks like:</p>
- <pre class="literal-block">
- <alias> = <definition>
- </pre>
- <p>in the <tt class="docutils literal">revsetalias</tt> section of a Mercurial configuration file. Arguments
- of the form <cite>$1</cite>, <cite>$2</cite>, etc. are substituted from the alias into the
- definition.</p>
- <p>For example,</p>
- <pre class="literal-block">
- [revsetalias]
- h = heads()
- d($1) = sort($1, date)
- rs($1, $2) = reverse(sort($1, $2))
- </pre>
- <p>defines three aliases, <tt class="docutils literal">h</tt>, <tt class="docutils literal">d</tt>, and <tt class="docutils literal">rs</tt>. <tt class="docutils literal">rs(0:tip, author)</tt> is
- exactly equivalent to <tt class="docutils literal">reverse(sort(0:tip, author))</tt>.</p>
- <p>An infix operator <tt class="docutils literal">##</tt> can concatenate strings and identifiers into
- one string. For example:</p>
- <pre class="literal-block">
- [revsetalias]
- issue($1) = grep(r'\bissue[ :]?' ## $1 ## r'\b|\bbug\(' ## $1 ## r'\)')
- </pre>
- <p><tt class="docutils literal">issue(1234)</tt> is equivalent to <tt class="docutils literal"><span class="pre">grep(r'\bissue[</span> <span class="pre">:]?1234\b|\bbug\(1234\)')</span></tt>
- in this case. This matches against all of "issue 1234", "issue:1234",
- "issue1234" and "bug(1234)".</p>
- <p>All other prefix, infix and postfix operators have lower priority than
- <tt class="docutils literal">##</tt>. For example, <tt class="docutils literal">$1 ## $2~2</tt> is equivalent to <tt class="docutils literal">($1 ## <span class="pre">$2)~2</span></tt>.</p>
- <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 committed in 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(tag())"
- </pre>
- </li>
- </ul>
- </div>
- <div class="section" id="using-mercurial-from-scripts-and-automation">
- <span id="scripting"></span><h1><a class="toc-backref" href="#contents">Using Mercurial from scripts and automation</a></h1>
- <p>It is common for machines (as opposed to humans) to consume Mercurial.
- This help topic describes some of the considerations for interfacing
- machines with Mercurial.</p>
- <div class="section" id="choosing-an-interface">
- <h2>Choosing an Interface</h2>
- <p>Machines have a choice of several methods to interface with Mercurial.
- These include:</p>
- <ul class="simple">
- <li>Executing the <tt class="docutils literal">hg</tt> process</li>
- <li>Querying a HTTP server</li>
- <li>Calling out to a command server</li>
- </ul>
- <p>Executing <tt class="docutils literal">hg</tt> processes is very similar to how humans interact with
- Mercurial in the shell. It should already be familiar to you.</p>
- <p><a class="reference external" href="hg.1.html#serve"><tt class="docutils literal">hg serve</tt></a> can be used to start a server. By default, this will start
- a "hgweb" HTTP server. This HTTP server has support for machine-readable
- output, such as JSON. For more, see <a class="reference external" href="hg.1.html#hgweb"><tt class="docutils literal">hg help hgweb</tt></a>.</p>
- <p><a class="reference external" href="hg.1.html#serve"><tt class="docutils literal">hg serve</tt></a> can also start a "command server." Clients can connect
- to this server and issue Mercurial commands over a special protocol.
- For more details on the command server, including links to client
- libraries, see <a class="reference external" href="https://mercurial.selenic.com/wiki/CommandServer">https://mercurial.selenic.com/wiki/CommandServer</a>.</p>
- <p><a class="reference external" href="hg.1.html#serve"><tt class="docutils literal">hg serve</tt></a> based interfaces (the hgweb and command servers) have the
- advantage over simple <tt class="docutils literal">hg</tt> process invocations in that they are
- likely more efficient. This is because there is significant overhead
- to spawn new Python processes.</p>
- <div class="tip">
- <p class="first admonition-title">Tip</p>
- <p class="last">If you need to invoke several <tt class="docutils literal">hg</tt> processes in short order and/or
- performance is important to you, use of a server-based interface
- is highly recommended.</p>
- </div>
- </div>
- <div class="section" id="id11">
- <h2>Environment Variables</h2>
- <p>As documented in <a class="reference external" href="hg.1.html#environment"><tt class="docutils literal">hg help environment</tt></a>, various environment variables
- influence the operation of Mercurial. The following are particularly
- relevant for machines consuming Mercurial:</p>
- <dl class="docutils">
- <dt>HGPLAIN</dt>
- <dd><p class="first">If not set, Mercurial's output could be influenced by configuration
- settings that impact its encoding, verbose mode, localization, etc.</p>
- <p class="last">It is highly recommended for machines to set this variable when
- invoking <tt class="docutils literal">hg</tt> processes.</p>
- </dd>
- <dt>HGENCODING</dt>
- <dd><p class="first">If not set, the locale used by Mercurial will be detected from the
- environment. If the determined locale does not support display of
- certain characters, Mercurial may render these character sequences
- incorrectly (often by using "?" as a placeholder for invalid
- characters in the current locale).</p>
- <p class="last">Explicitly setting this environment variable is a good practice to
- guarantee consistent results. "utf-8" is a good choice on UNIX-like
- environments.</p>
- </dd>
- <dt>HGRCPATH</dt>
- <dd><p class="first">If not set, Mercurial will inherit config options from config files
- using the process described in <a class="reference external" href="hg.1.html#config"><tt class="docutils literal">hg help config</tt></a>. This includes
- inheriting user or system-wide config files.</p>
- <p class="last">When utmost control over the Mercurial configuration is desired, the
- value of <tt class="docutils literal">HGRCPATH</tt> can be set to an explicit file with known good
- configs. In rare cases, the value can be set to an empty file or the
- null device (often <tt class="docutils literal">/dev/null</tt>) to bypass loading of any user or
- system config files. Note that these approaches can have unintended
- consequences, as the user and system config files often define things
- like the username and extensions that may be required to interface
- with a repository.</p>
- </dd>
- </dl>
- </div>
- <div class="section" id="consuming-command-output">
- <h2>Consuming Command Output</h2>
- <p>It is common for machines to need to parse the output of Mercurial
- commands for relevant data. This section describes the various
- techniques for doing so.</p>
- <div class="section" id="parsing-raw-command-output">
- <h3>Parsing Raw Command Output</h3>
- <p>Likely the simplest and most effective solution for consuming command
- output is to simply invoke <tt class="docutils literal">hg</tt> commands as you would as a user and
- parse their output.</p>
- <p>The output of many commands can easily be parsed with tools like
- <tt class="docutils literal">grep</tt>, <tt class="docutils literal">sed</tt>, and <tt class="docutils literal">awk</tt>.</p>
- <p>A potential downside with parsing command output is that the output
- of commands can change when Mercurial is upgraded. While Mercurial
- does generally strive for strong backwards compatibility, command
- output does occasionally change. Having tests for your automated
- interactions with <tt class="docutils literal">hg</tt> commands is generally recommended, but is
- even more important when raw command output parsing is involved.</p>
- </div>
- <div class="section" id="using-templates-to-control-output">
- <h3>Using Templates to Control Output</h3>
- <p>Many <tt class="docutils literal">hg</tt> commands support templatized output via the
- <tt class="docutils literal"><span class="pre">-T/--template</span></tt> argument. For more, see <a class="reference external" href="hg.1.html#templates"><tt class="docutils literal">hg help templates</tt></a>.</p>
- <p>Templates are useful for explicitly controlling output so that
- you get exactly the data you want formatted how you want it. For
- example, <tt class="docutils literal">log <span class="pre">-T</span> <span class="pre">{node}\n</span></tt> can be used to print a newline
- delimited list of changeset nodes instead of a human-tailored
- output containing authors, dates, descriptions, etc.</p>
- <div class="tip">
- <p class="first admonition-title">Tip</p>
- <p class="last">If parsing raw command output is too complicated, consider
- using templates to make your life easier.</p>
- </div>
- <p>The <tt class="docutils literal"><span class="pre">-T/--template</span></tt> argument allows specifying pre-defined styles.
- Mercurial ships with the machine-readable styles <tt class="docutils literal">json</tt> and <tt class="docutils literal">xml</tt>,
- which provide JSON and XML output, respectively. These are useful for
- producing output that is machine readable as-is.</p>
- <div class="important">
- <p class="first admonition-title">Important</p>
- <p>The <tt class="docutils literal">json</tt> and <tt class="docutils literal">xml</tt> styles are considered experimental. While
- they may be attractive to use for easily obtaining machine-readable
- output, their behavior may change in subsequent versions.</p>
- <p class="last">These styles may also exhibit unexpected results when dealing with
- certain encodings. Mercurial treats things like filenames as a
- series of bytes and normalizing certain byte sequences to JSON
- or XML with certain encoding settings can lead to surprises.</p>
- </div>
- </div>
- <div class="section" id="command-server-output">
- <h3>Command Server Output</h3>
- <p>If using the command server to interact with Mercurial, you are likely
- using an existing library/API that abstracts implementation details of
- the command server. If so, this interface layer may perform parsing for
- you, saving you the work of implementing it yourself.</p>
- </div>
- <div class="section" id="output-verbosity">
- <h3>Output Verbosity</h3>
- <p>Commands often have varying output verbosity, even when machine
- readable styles are being used (e.g. <tt class="docutils literal"><span class="pre">-T</span> json</tt>). Adding
- <tt class="docutils literal"><span class="pre">-v/--verbose</span></tt> and <tt class="docutils literal"><span class="pre">--debug</span></tt> to the command's arguments can
- increase the amount of data exposed by Mercurial.</p>
- <p>An alternate way to get the data you need is by explicitly specifying
- a template.</p>
- </div>
- </div>
- <div class="section" id="other-topics">
- <h2>Other Topics</h2>
- <dl class="docutils">
- <dt>revsets</dt>
- <dd><p class="first">Revisions sets is a functional query language for selecting a set
- of revisions. Think of it as SQL for Mercurial repositories. Revsets
- are useful for querying repositories for specific data.</p>
- <p class="last">See <a class="reference external" href="hg.1.html#revsets"><tt class="docutils literal">hg help revsets</tt></a> for more.</p>
- </dd>
- <dt>share extension</dt>
- <dd><p class="first">The <tt class="docutils literal">share</tt> extension provides functionality for sharing
- repository data across several working copies. It can even
- automatically "pool" storage for logically related repositories when
- cloning.</p>
- <p>Configuring the <tt class="docutils literal">share</tt> extension can lead to significant resource
- utilization reduction, particularly around disk space and the
- network. This is especially true for continuous integration (CI)
- environments.</p>
- <p class="last">See <a class="reference external" href="hg.1.html#-e"><tt class="docutils literal">hg help <span class="pre">-e</span> share</tt></a> for more.</p>
- </dd>
- </dl>
- </div>
- </div>
- <div class="section" id="subrepositories">
- <span id="subrepo"></span><span id="subrepos"></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.</p>
- <p>Mercurial currently supports Mercurial, Git, and Subversion
- subrepositories.</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.</p>
- </li>
- <li><p class="first">Nested repository references. They are defined in <tt class="docutils literal">.hgsub</tt>, which
- should be placed in the root of working directory, and
- tell where the subrepository checkouts come from. Mercurial
- subrepositories are referenced like:</p>
- <pre class="literal-block">
- path/to/nested = https://example.com/nested/repo/path
- </pre>
- <p>Git and Subversion subrepos are also supported:</p>
- <pre class="literal-block">
- path/to/nested = [git]git://example.com/nested/repo/path
- path/to/nested = [svn]https://example.com/nested/trunk/path
- </pre>
- <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.</p>
- <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>, which
- is placed in the root of working directory, 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 class="section" id="adding-a-subrepository">
- <h2>Adding a Subrepository</h2>
- <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">
- <h2>Synchronizing a Subrepository</h2>
- <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">
- <h2>Deleting a Subrepository</h2>
- <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">
- <h2>Interaction with Mercurial Commands</h2>
- <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. However, if you specify the full path of a file in a
- subrepo, it will be added even without -S/--subrepos specified.
- Subversion subrepositories are currently silently
- ignored.</td>
- </tr>
- <tr class="field"><th class="field-name">addremove:</th><td class="field-body">addremove does not recurse into subrepos unless
- -S/--subrepos is specified. However, if you specify the full
- path of a directory in a subrepo, addremove will be performed on
- it even without -S/--subrepos being specified. Git and
- Subversion subrepositories will print a warning and continue.</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">cat:</th><td class="field-body">cat currently only handles exact file matches in subrepos.
- Subversion subrepositories are currently ignored.</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. If any subrepositories
- have been modified, Mercurial will abort. Mercurial can be made
- to instead commit all modified subrepositories by specifying
- -S/--subrepos, or setting "ui.commitsubrepos=True" in a
- configuration file (see <a class="reference external" href="hg.1.html#config"><tt class="docutils literal">hg help config</tt></a>). After there are no
- longer any modified subrepositories, it records their state and
- finally commits it in the parent repository. The --addremove
- option also honors the -S/--subrepos option. However, Git and
- Subversion subrepositories will print a warning and abort.</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">files:</th><td class="field-body">files does not recurse into subrepos unless -S/--subrepos is
- specified. However, if you specify the full path of a file or
- directory in a subrepo, it will be displayed even without
- -S/--subrepos being specified. Git and Subversion subrepositories
- are currently silently ignored.</td>
- </tr>
- <tr class="field"><th class="field-name">forget:</th><td class="field-body">forget currently only handles exact file matches in subrepos.
- Git and 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. Git and 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. Git and 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. Push is a no-op for Subversion subrepositories.</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">remove:</th><td class="field-body">remove does not recurse into subrepositories unless
- -S/--subrepos is specified. However, if you specify a file or
- directory path in a subrepo, it will be removed even without
- -S/--subrepos. Git and 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">
- <h2>Remapping Subrepositories Sources</h2>
- <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>
- <div class="section" id="template-usage">
- <span id="style"></span><span id="template"></span><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 or select an existing
- template-style from the command line, via the --template option.</p>
- <p>You can customize output for any "log-like" command: log,
- outgoing, incoming, tip, parents, and heads.</p>
- <p>Some built-in styles are packaged with Mercurial. These can be listed
- with <a class="reference external" href="hg.1.html#log"><tt class="docutils literal">hg log <span class="pre">--template</span> list</tt></a>. Example usage:</p>
- <pre class="literal-block">
- $ hg log -r1.0::1.1 --template 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">activebookmark:</th><td class="field-body">String. The active bookmark, if it is
- associated with the changeset</td>
- </tr>
- <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">bisect:</th><td class="field-body">String. The changeset bisection status.</td>
- </tr>
- <tr class="field"><th class="field-name">bookmarks:</th><td class="field-body">List of strings. Any bookmarks associated with the
- changeset. Also sets 'active', the name of the active bookmark.</td>
- </tr>
- <tr class="field"><th class="field-name">branch:</th><td class="field-body">String. The name of the branch on which the changeset was
- committed.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">changessincelatesttag:</th></tr>
- <tr class="field"><td> </td><td class="field-body">Integer. All ancestors not in the latest tag.</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" colspan="2">currentbookmark:</th></tr>
- <tr class="field"><td> </td><td class="field-body">String. The active bookmark, if it is
- associated with the changeset (DEPRECATED)</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">extras:</th><td class="field-body">List of dicts with key, value entries of the 'extras'
- field of 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 class="field"><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_dels:</th><td class="field-body">List of strings. Files removed by this changeset.</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">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">latesttag:</th><td class="field-body">List of strings. The global tags on the most recent globally
- tagged ancestor of this changeset.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">latesttagdistance:</th></tr>
- <tr class="field"><td> </td><td class="field-body">Integer. Longest path to the latest tag.</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">p1node:</th><td class="field-body">String. The identification hash of the changeset's first parent,
- as a 40 digit hexadecimal string. If the changeset has no parents, all
- digits are 0.</td>
- </tr>
- <tr class="field"><th class="field-name">p1rev:</th><td class="field-body">Integer. The repository-local revision number of the changeset's
- first parent, or -1 if the changeset has no parents.</td>
- </tr>
- <tr class="field"><th class="field-name">p2node:</th><td class="field-body">String. The identification hash of the changeset's second
- parent, as a 40 digit hexadecimal string. If the changeset has no second
- parent, all digits are 0.</td>
- </tr>
- <tr class="field"><th class="field-name">p2rev:</th><td class="field-body">Integer. The repository-local revision number of the changeset's
- second parent, or -1 if the changeset has no second parent.</td>
- </tr>
- <tr class="field"><th class="field-name">parents:</th><td class="field-body">List of strings. The parents of the changeset in "rev:node"
- format. If the changeset has only one "natural" parent (the predecessor
- revision) nothing is shown.</td>
- </tr>
- <tr class="field"><th class="field-name">phase:</th><td class="field-body">String. The changeset phase name.</td>
- </tr>
- <tr class="field"><th class="field-name">phaseidx:</th><td class="field-body">Integer. The changeset phase index.</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">subrepos:</th><td class="field-body">List of strings. Updated subrepositories in the changeset.</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>
- </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">count:</th><td class="field-body">List or text. Returns the length as an integer.</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">emailuser:</th><td class="field-body">Any text. Returns the user portion of an email address.</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, and filters out NUL characters.</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">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">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">lower:</th><td class="field-body">Any text. Converts the text to lowercase.</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">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 name before an email address,
- interpreting it as per RFC 5322.</td>
- </tr>
- <tr class="field"><th class="field-name">revescape:</th><td class="field-body">Any text. Escapes all "special" characters, except @.
- Forward slashes are escaped twice to prevent web servers from prematurely
- unescaping them. For example, "@foo bar/baz" becomes "@foo%20bar%252Fbaz".</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">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">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">shortbisect:</th><td class="field-body">Any text. Treats <cite>text</cite> as a bisection status, and
- returns a single-character representing the status (G: good, B: bad,
- S: skipped, U: untested, I: ignored). Returns single space if <cite>text</cite>
- is not a valid bisection status.</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">splitlines:</th><td class="field-body">Any text. Split text into a list of lines.</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">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">tabindent:</th><td class="field-body">Any text. Returns the text, with every non-empty line
- except the first starting with a tab character.</td>
- </tr>
- <tr class="field"><th class="field-name">upper:</th><td class="field-body">Any text. Converts the text to uppercase.</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 a short representation of a user name or email
- address.</td>
- </tr>
- </tbody>
- </table>
- <p>Note that a filter is nothing more than a function call, i.e.
- <tt class="docutils literal">expr|filter</tt> is equivalent to <tt class="docutils literal">filter(expr)</tt>.</p>
- <p>In addition to filters, there are some basic built-in functions:</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" colspan="2">date(date[, fmt]):</th></tr>
- <tr class="field"><td> </td><td class="field-body">Format a date. See <a class="reference external" href="hg.1.html#dates"><tt class="docutils literal">hg help dates</tt></a> for formatting
- strings.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">diff([includepattern [, excludepattern]]):</th></tr>
- <tr class="field"><td> </td><td class="field-body">Show a diff, optionally
- specifying files to include or exclude.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">fill(text[, width[, initialident[, hangindent]]]):</th></tr>
- <tr class="field"><td> </td><td class="field-body">Fill many
- paragraphs with optional indentation. See the "fill" filter.</td>
- </tr>
- <tr class="field"><th class="field-name">get(dict, key):</th><td class="field-body">Get an attribute/key from an object. Some keywords
- are complex types. This function allows you to obtain the value of an
- attribute on these type.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">if(expr, then[, else]):</th></tr>
- <tr class="field"><td> </td><td class="field-body">Conditionally execute based on the result of
- an expression.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">ifcontains(search, thing, then[, else]):</th></tr>
- <tr class="field"><td> </td><td class="field-body">Conditionally execute based
- on whether the item "search" is in "thing".</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">ifeq(expr1, expr2, then[, else]):</th></tr>
- <tr class="field"><td> </td><td class="field-body">Conditionally execute based on
- whether 2 items are equivalent.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">indent(text, indentchars[, firstline]):</th></tr>
- <tr class="field"><td> </td><td class="field-body">Indents all non-empty lines
- with the characters given in the indentchars string. An optional
- third parameter will override the indent for the first line only
- if present.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">join(list, sep):</th></tr>
- <tr class="field"><td> </td><td class="field-body">Join items in a list with a delimiter.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">label(label, expr):</th></tr>
- <tr class="field"><td> </td><td class="field-body">Apply a label to generated content. Content with
- a label applied can result in additional post-processing, such as
- automatic colorization.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">pad(text, width[, fillchar=' '[, right=False]]):</th></tr>
- <tr class="field"><td> </td><td class="field-body">Pad text with a
- fill character.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">revset(query[, formatargs...]):</th></tr>
- <tr class="field"><td> </td><td class="field-body">Execute a revision set query. See
- <a class="reference external" href="hg.1.html#revset"><tt class="docutils literal">hg help revset</tt></a>.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">rstdoc(text, style):</th></tr>
- <tr class="field"><td> </td><td class="field-body">Format ReStructuredText.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">shortest(node, minlength=4):</th></tr>
- <tr class="field"><td> </td><td class="field-body">Obtain the shortest representation of
- a node.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">startswith(pattern, text):</th></tr>
- <tr class="field"><td> </td><td class="field-body">Returns the value from the "text" argument
- if it begins with the content from the "pattern" argument.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">strip(text[, chars]):</th></tr>
- <tr class="field"><td> </td><td class="field-body">Strip characters from a string.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">sub(pattern, replacement, expression):</th></tr>
- <tr class="field"><td> </td><td class="field-body">Perform text substitution
- using regular expressions.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">word(number, text[, separator]):</th></tr>
- <tr class="field"><td> </td><td class="field-body">Return the nth word from a string.</td>
- </tr>
- </tbody>
- </table>
- <p>Also, for any expression that returns a list, there is a list operator:</p>
- <ul class="simple">
- <li>expr % "{template}"</li>
- </ul>
- <p>As seen in the above example, "{template}" is interpreted as a template.
- To prevent it from being interpreted, you can use an escape character "{"
- or a raw string prefix, "r'...'".</p>
- <p>Some sample command line templates:</p>
- <ul>
- <li><p class="first">Format lists, e.g. files:</p>
- <pre class="literal-block">
- $ hg log -r 0 --template "files:\n{files % ' {file}\n'}"
- </pre>
- </li>
- <li><p class="first">Join the list of files with a ", ":</p>
- <pre class="literal-block">
- $ hg log -r 0 --template "files: {join(files, ', ')}\n"
- </pre>
- </li>
- <li><p class="first">Modify each line of a commit description:</p>
- <pre class="literal-block">
- $ hg log --template "{splitlines(desc) % '**** {line}\n'}"
- </pre>
- </li>
- <li><p class="first">Format date:</p>
- <pre class="literal-block">
- $ hg log -r 0 --template "{date(date, '%Y')}\n"
- </pre>
- </li>
- <li><p class="first">Output the description set to a fill-width of 30:</p>
- <pre class="literal-block">
- $ hg log -r 0 --template "{fill(desc, 30)}"
- </pre>
- </li>
- <li><p class="first">Use a conditional to test for the default branch:</p>
- <pre class="literal-block">
- $ hg log -r 0 --template "{ifeq(branch, 'default', 'on the main branch',
- 'on branch {branch}')}\n"
- </pre>
- </li>
- <li><p class="first">Append a newline if not empty:</p>
- <pre class="literal-block">
- $ hg tip --template "{if(author, '{author}\n')}"
- </pre>
- </li>
- <li><p class="first">Label the output for use with the color extension:</p>
- <pre class="literal-block">
- $ hg log -r 0 --template "{label('changeset.{phase}', node|short)}\n"
- </pre>
- </li>
- <li><p class="first">Invert the firstline filter, i.e. everything but the first line:</p>
- <pre class="literal-block">
- $ hg log -r 0 --template "{sub(r'^.*\n?\n?', '', desc)}\n"
- </pre>
- </li>
- <li><p class="first">Display the contents of the 'extra' field, one per line:</p>
- <pre class="literal-block">
- $ hg log -r 0 --template "{join(extras, '\n')}\n"
- </pre>
- </li>
- <li><p class="first">Mark the active bookmark with '*':</p>
- <pre class="literal-block">
- $ hg log --template "{bookmarks % '{bookmark}{ifeq(bookmark, active, '*')} '}\n"
- </pre>
- </li>
- <li><p class="first">Mark the working copy parent with '@':</p>
- <pre class="literal-block">
- $ hg log --template "{ifcontains(rev, revset('.'), '@')}\n"
- </pre>
- </li>
- <li><p class="first">Show only commit descriptions that start with "template":</p>
- <pre class="literal-block">
- $ hg log --template "{startswith('template', firstline(desc))}\n"
- </pre>
- </li>
- <li><p class="first">Print the first word of each line of a commit message:</p>
- <pre class="literal-block">
- $ hg log --template "{word(0, desc)}\n"
- </pre>
- </li>
- </ul>
- </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@]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
- <a class="reference external" href="hg.1.html#incoming"><tt class="docutils literal">hg incoming <span class="pre">--bundle</span></tt></a>). 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="id12">
- <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="id13">
- <ul class="simple">
- <li><a class="reference internal" href="#acl" id="id86">acl</a></li>
- <li><a class="reference internal" href="#blackbox" id="id87">blackbox</a></li>
- <li><a class="reference internal" href="#bugzilla" id="id88">bugzilla</a></li>
- <li><a class="reference internal" href="#censor" id="id89">censor</a></li>
- <li><a class="reference internal" href="#children" id="id90">children</a></li>
- <li><a class="reference internal" href="#churn" id="id91">churn</a></li>
- <li><a class="reference internal" href="#color" id="id92">color</a></li>
- <li><a class="reference internal" href="#convert" id="id93">convert</a></li>
- <li><a class="reference internal" href="#eol" id="id94">eol</a></li>
- <li><a class="reference internal" href="#extdiff" id="id95">extdiff</a></li>
- <li><a class="reference internal" href="#factotum" id="id96">factotum</a></li>
- <li><a class="reference internal" href="#fetch" id="id97">fetch</a></li>
- <li><a class="reference internal" href="#gpg" id="id98">gpg</a></li>
- <li><a class="reference internal" href="#graphlog" id="id99">graphlog</a></li>
- <li><a class="reference internal" href="#hgcia" id="id100">hgcia</a></li>
- <li><a class="reference internal" href="#hgk" id="id101">hgk</a></li>
- <li><a class="reference internal" href="#highlight" id="id102">highlight</a></li>
- <li><a class="reference internal" href="#histedit" id="id103">histedit</a></li>
- <li><a class="reference internal" href="#keyword" id="id104">keyword</a></li>
- <li><a class="reference internal" href="#largefiles" id="id105">largefiles</a></li>
- <li><a class="reference internal" href="#mq" id="id106">mq</a></li>
- <li><a class="reference internal" href="#notify" id="id107">notify</a></li>
- <li><a class="reference internal" href="#pager" id="id108">pager</a></li>
- <li><a class="reference internal" href="#patchbomb" id="id109">patchbomb</a></li>
- <li><a class="reference internal" href="#progress" id="id110">progress</a></li>
- <li><a class="reference internal" href="#purge" id="id111">purge</a></li>
- <li><a class="reference internal" href="#rebase" id="id112">rebase</a></li>
- <li><a class="reference internal" href="#record" id="id113">record</a></li>
- <li><a class="reference internal" href="#relink" id="id114">relink</a></li>
- <li><a class="reference internal" href="#schemes" id="id115">schemes</a></li>
- <li><a class="reference internal" href="#share" id="id116">share</a></li>
- <li><a class="reference internal" href="#shelve" id="id117">shelve</a></li>
- <li><a class="reference internal" href="#strip" id="id118">strip</a></li>
- <li><a class="reference internal" href="#transplant" id="id119">transplant</a></li>
- <li><a class="reference internal" href="#win32mbcs" id="id120">win32mbcs</a></li>
- <li><a class="reference internal" href="#win32text" id="id121">win32text</a></li>
- <li><a class="reference internal" href="#zeroconf" id="id122">zeroconf</a></li>
- </ul>
- </div>
- <div class="section" id="acl">
- <h2><a class="toc-backref" href="#id86">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>
- <p>You can add the "!" prefix to a user or group name to invert the sense
- of the match.</p>
- </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" and "@hg-denied" - 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 class="section" id="examples-using-the-prefix">
- <h4>Examples using the "!" prefix</h4>
- <p>Suppose there's a branch that only a given user (or group) should be able to
- push to, and you don't want to restrict access to any other branch that may
- be created.</p>
- <p>The "!" prefix allows you to prevent anyone except a given user or group to
- push changesets in a given branch or path.</p>
- <p>In the examples below, we will:
- 1) Deny access to branch "ring" to anyone but user "gollum"
- 2) Deny access to branch "lake" to anyone but members of the group "hobbit"
- 3) Deny access to a file to anyone but user "gollum"</p>
- <pre class="literal-block">
- [acl.allow.branches]
- # Empty
- [acl.deny.branches]
- # 1) only 'gollum' can commit to branch 'ring';
- # 'gollum' and anyone else can still commit to any other branch.
- ring = !gollum
- # 2) only members of the group 'hobbit' can commit to branch 'lake';
- # 'hobbit' members and anyone else can still commit to any other branch.
- lake = !@hobbit
- # You can also deny access based on file paths:
- [acl.allow]
- # Empty
- [acl.deny]
- # 3) only 'gollum' can change the file below;
- # 'gollum' and anyone else can still change any other file.
- /misty/mountains/cave/ring = !gollum
- </pre>
- </div>
- </div>
- </div>
- <div class="section" id="blackbox">
- <h2><a class="toc-backref" href="#id87">blackbox</a></h2>
- <p>log repository events to a blackbox for debugging</p>
- <p>Logs event information to .hg/blackbox.log to help debug and diagnose problems.
- The events that get logged can be configured via the blackbox.track config key.
- Examples:</p>
- <pre class="literal-block">
- [blackbox]
- track = *
- [blackbox]
- track = command, commandfinish, commandexception, exthook, pythonhook
- [blackbox]
- track = incoming
- [blackbox]
- # limit the size of a log file
- maxsize = 1.5 MB
- # rotate up to N log files when the current one gets too big
- maxfiles = 3
- </pre>
- <div class="section" id="id14">
- <h3>Commands</h3>
- <div class="section" id="id15">
- <h4>blackbox</h4>
- <p>view the recent repository events:</p>
- <pre class="literal-block">
- hg blackbox [OPTION]...
- </pre>
- <p>view the recent repository events</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">-l</span>, <span class="option">--limit <var><VALUE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>the number of events to show (default: 10)</td></tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <div class="section" id="bugzilla">
- <h2><a class="toc-backref" href="#id88">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 comment is formatted using
- the Mercurial template mechanism.</p>
- <p>The bug references can optionally include an update for Bugzilla of the
- hours spent working on the bug. Bugs can also be marked fixed.</p>
- <p>Three basic modes of access to Bugzilla are provided:</p>
- <ol class="arabic simple">
- <li>Access via the Bugzilla XMLRPC interface. Requires Bugzilla 3.4 or later.</li>
- <li>Check data via the Bugzilla XMLRPC interface and submit bug change
- via email to Bugzilla email interface. Requires Bugzilla 3.4 or later.</li>
- <li>Writing directly to the Bugzilla database. Only Bugzilla installations
- using MySQL are supported. Requires Python MySQLdb.</li>
- </ol>
- <p>Writing directly to the database is susceptible to schema changes, and
- relies on a Bugzilla contrib script to send out bug change
- notification emails. This script runs as the user running Mercurial,
- must be run on the host with the Bugzilla install, and requires
- permission to read Bugzilla configuration details and the necessary
- MySQL user and password to have full access rights to the Bugzilla
- database. For these reasons this access mode is now considered
- deprecated, and will not be updated for new Bugzilla versions going
- forward. Only adding comments is supported in this access mode.</p>
- <p>Access via XMLRPC needs a Bugzilla username and password to be specified
- in the configuration. Comments are added under that username. Since the
- configuration must be readable by all Mercurial users, it is recommended
- that the rights of that user are restricted in Bugzilla to the minimum
- necessary to add comments. Marking bugs fixed requires Bugzilla 4.0 and later.</p>
- <p>Access via XMLRPC/email uses XMLRPC to query Bugzilla, but sends
- email to the Bugzilla email interface to submit comments to bugs.
- The From: address in the email is set to the email address of the Mercurial
- user, so the comment appears to come from the Mercurial user. In the event
- that the Mercurial user email is not recognized by Bugzilla as a Bugzilla
- user, the email associated with the Bugzilla username used to log into
- Bugzilla is used instead as the source of the comment. Marking bugs fixed
- works on all supported Bugzilla versions.</p>
- <p>Configuration items common to all access modes:</p>
- <dl class="docutils">
- <dt>bugzilla.version</dt>
- <dd><p class="first">The access type to use. Values recognized are:</p>
- <table class="last 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">xmlrpc</tt>:</th><td class="field-body">Bugzilla XMLRPC interface.</td>
- </tr>
- <tr class="field"><th class="field-name"><tt class="docutils literal">xmlrpc+email</tt>:</th><td class="field-body">Bugzilla XMLRPC and email interfaces.</td>
- </tr>
- <tr class="field"><th class="field-name"><tt class="docutils literal">3.0</tt>:</th><td class="field-body">MySQL access, Bugzilla 3.0 and later.</td>
- </tr>
- <tr class="field"><th class="field-name"><tt class="docutils literal">2.18</tt>:</th><td class="field-body">MySQL access, Bugzilla 2.18 and up to but not
- including 3.0.</td>
- </tr>
- <tr class="field"><th class="field-name"><tt class="docutils literal">2.16</tt>:</th><td class="field-body">MySQL access, Bugzilla 2.16 and up to but not
- including 2.18.</td>
- </tr>
- </tbody>
- </table>
- </dd>
- <dt>bugzilla.regexp</dt>
- <dd>Regular expression to match bug IDs for update in changeset commit message.
- It must contain one "()" named group <tt class="docutils literal"><ids></tt> containing the bug
- IDs separated by non-digit characters. It may also contain
- a named group <tt class="docutils literal"><hours></tt> with a floating-point number giving the
- hours worked on the bug. If no named groups are present, the first
- "()" group is assumed to contain the bug IDs, and work time is not
- updated. The default expression matches <tt class="docutils literal">Bug 1234</tt>, <tt class="docutils literal">Bug no. 1234</tt>,
- <tt class="docutils literal">Bug number 1234</tt>, <tt class="docutils literal">Bugs 1234,5678</tt>, <tt class="docutils literal">Bug 1234 and 5678</tt> and
- variations thereof, followed by an hours number prefixed by <tt class="docutils literal">h</tt> or
- <tt class="docutils literal">hours</tt>, e.g. <tt class="docutils literal">hours 1.5</tt>. Matching is case insensitive.</dd>
- <dt>bugzilla.fixregexp</dt>
- <dd>Regular expression to match bug IDs for marking fixed in changeset
- commit message. This must contain a "()" named group <tt class="docutils literal"><ids>` containing
- the bug IDs separated by <span class="pre">non-digit</span> characters. It may also contain
- a named group <span class="pre">``<hours></span></tt> with a floating-point number giving the
- hours worked on the bug. If no named groups are present, the first
- "()" group is assumed to contain the bug IDs, and work time is not
- updated. The default expression matches <tt class="docutils literal">Fixes 1234</tt>, <tt class="docutils literal">Fixes bug 1234</tt>,
- <tt class="docutils literal">Fixes bugs 1234,5678</tt>, <tt class="docutils literal">Fixes 1234 and 5678</tt> and
- variations thereof, followed by an hours number prefixed by <tt class="docutils literal">h</tt> or
- <tt class="docutils literal">hours</tt>, e.g. <tt class="docutils literal">hours 1.5</tt>. Matching is case insensitive.</dd>
- <dt>bugzilla.fixstatus</dt>
- <dd>The status to set a bug to when marking fixed. Default <tt class="docutils literal">RESOLVED</tt>.</dd>
- <dt>bugzilla.fixresolution</dt>
- <dd>The resolution to set a bug to when marking fixed. Default <tt class="docutils literal">FIXED</tt>.</dd>
- <dt>bugzilla.style</dt>
- <dd>The style file to use when formatting comments.</dd>
- <dt>bugzilla.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>
- <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">{bug}</tt>:</th><td class="field-body">The Bugzilla bug ID.</td>
- </tr>
- <tr class="field"><th class="field-name"><tt class="docutils literal">{root}</tt>:</th><td class="field-body">The full pathname of the Mercurial repository.</td>
- </tr>
- <tr class="field"><th class="field-name"><tt class="docutils literal">{webroot}</tt>:</th><td class="field-body">Stripped pathname of the Mercurial repository.</td>
- </tr>
- <tr class="field"><th class="field-name"><tt class="docutils literal">{hgweb}</tt>:</th><td class="field-body">Base URL for browsing Mercurial repositories.</td>
- </tr>
- </tbody>
- </table>
- <p class="last">Default <tt class="docutils literal">changeset {node|short} in repo {root} refers to bug
- <span class="pre">{bug}.\ndetails:\n\t{desc|tabindent}</span></tt></p>
- </dd>
- <dt>bugzilla.strip</dt>
- <dd>The number of path separator characters to strip from the front of
- the Mercurial repository path (<tt class="docutils literal">{root}</tt> in templates) to produce
- <tt class="docutils literal">{webroot}</tt>. For example, a repository with <tt class="docutils literal">{root}</tt>
- <tt class="docutils literal"><span class="pre">/var/local/my-project</span></tt> with a strip of 2 gives a value for
- <tt class="docutils literal">{webroot}</tt> of <tt class="docutils literal"><span class="pre">my-project</span></tt>. Default 0.</dd>
- <dt>web.baseurl</dt>
- <dd>Base URL for browsing Mercurial repositories. Referenced from
- templates as <tt class="docutils literal">{hgweb}</tt>.</dd>
- </dl>
- <p>Configuration items common to XMLRPC+email and MySQL access modes:</p>
- <dl class="docutils">
- <dt>bugzilla.usermap</dt>
- <dd><p class="first">Path of file containing Mercurial committer email to Bugzilla user email
- mappings. If specified, the file should contain one mapping per
- line:</p>
- <pre class="literal-block">
- committer = Bugzilla user
- </pre>
- <p class="last">See also the <tt class="docutils literal">[usermap]</tt> section.</p>
- </dd>
- </dl>
- <p>The <tt class="docutils literal">[usermap]</tt> section is used to specify mappings of Mercurial
- committer email to Bugzilla user email. See also <tt class="docutils literal">bugzilla.usermap</tt>.
- Contains entries of the form <tt class="docutils literal">committer = Bugzilla user</tt>.</p>
- <p>XMLRPC access mode configuration:</p>
- <dl class="docutils">
- <dt>bugzilla.bzurl</dt>
- <dd>The base URL for the Bugzilla installation.
- Default <tt class="docutils literal"><span class="pre">http://localhost/bugzilla</span></tt>.</dd>
- <dt>bugzilla.user</dt>
- <dd>The username to use to log into Bugzilla via XMLRPC. Default
- <tt class="docutils literal">bugs</tt>.</dd>
- <dt>bugzilla.password</dt>
- <dd>The password for Bugzilla login.</dd>
- </dl>
- <p>XMLRPC+email access mode uses the XMLRPC access mode configuration items,
- and also:</p>
- <dl class="docutils">
- <dt>bugzilla.bzemail</dt>
- <dd>The Bugzilla email address.</dd>
- </dl>
- <p>In addition, the Mercurial email settings must be configured. See the
- documentation in hgrc(5), sections <tt class="docutils literal">[email]</tt> and <tt class="docutils literal">[smtp]</tt>.</p>
- <p>MySQL access mode configuration:</p>
- <dl class="docutils">
- <dt>bugzilla.host</dt>
- <dd>Hostname of the MySQL server holding the Bugzilla database.
- Default <tt class="docutils literal">localhost</tt>.</dd>
- <dt>bugzilla.db</dt>
- <dd>Name of the Bugzilla database in MySQL. Default <tt class="docutils literal">bugs</tt>.</dd>
- <dt>bugzilla.user</dt>
- <dd>Username to use to access MySQL server. Default <tt class="docutils literal">bugs</tt>.</dd>
- <dt>bugzilla.password</dt>
- <dd>Password to use to access MySQL server.</dd>
- <dt>bugzilla.timeout</dt>
- <dd>Database connection timeout (seconds). Default 5.</dd>
- <dt>bugzilla.bzuser</dt>
- <dd>Fallback Bugzilla user name to record comments with, if changeset
- committer cannot be found as a Bugzilla user.</dd>
- <dt>bugzilla.bzdir</dt>
- <dd>Bugzilla install directory. Used by default notify. Default
- <tt class="docutils literal">/var/www/html/bugzilla</tt>.</dd>
- <dt>bugzilla.notify</dt>
- <dd>The command to run to get Bugzilla to send bug change notification
- emails. Substitutes from a map with 3 keys, <tt class="docutils literal">bzdir</tt>, <tt class="docutils literal">id</tt> (bug
- id) and <tt class="docutils literal">user</tt> (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>
- </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 configurations:</p>
- <p>XMLRPC example configuration. This uses the Bugzilla at
- <tt class="docutils literal"><span class="pre">http://my-project.org/bugzilla</span></tt>, logging in as user
- <tt class="docutils literal"><span class="pre">bugmail@my-project.org</span></tt> with password <tt class="docutils literal">plugh</tt>. It is used with a
- collection of Mercurial repositories in <tt class="docutils literal">/var/local/hg/repos/</tt>,
- with a web interface at <tt class="docutils literal"><span class="pre">http://my-project.org/hg</span></tt>.</p>
- <pre class="literal-block">
- [bugzilla]
- bzurl=http://my-project.org/bugzilla
- user=bugmail@my-project.org
- password=plugh
- version=xmlrpc
- template=Changeset {node|short} in {root|basename}.
- {hgweb}/{webroot}/rev/{node|short}\n
- {desc}\n
- strip=5
- [web]
- baseurl=http://my-project.org/hg
- </pre>
- <p>XMLRPC+email example configuration. This uses the Bugzilla at
- <tt class="docutils literal"><span class="pre">http://my-project.org/bugzilla</span></tt>, logging in as user
- <tt class="docutils literal"><span class="pre">bugmail@my-project.org</span></tt> with password <tt class="docutils literal">plugh</tt>. It is used with a
- collection of Mercurial repositories in <tt class="docutils literal">/var/local/hg/repos/</tt>,
- with a web interface at <tt class="docutils literal"><span class="pre">http://my-project.org/hg</span></tt>. Bug comments
- are sent to the Bugzilla email address
- <tt class="docutils literal"><span class="pre">bugzilla@my-project.org</span></tt>.</p>
- <pre class="literal-block">
- [bugzilla]
- bzurl=http://my-project.org/bugzilla
- user=bugmail@my-project.org
- password=plugh
- version=xmlrpc+email
- bzemail=bugzilla@my-project.org
- template=Changeset {node|short} in {root|basename}.
- {hgweb}/{webroot}/rev/{node|short}\n
- {desc}\n
- strip=5
- [web]
- baseurl=http://my-project.org/hg
- [usermap]
- user@emaildomain.com=user.name@bugzilladomain.com
- </pre>
- <p>MySQL example configuration. This has a local Bugzilla 3.2 installation
- in <tt class="docutils literal"><span class="pre">/opt/bugzilla-3.2</span></tt>. The MySQL database is on <tt class="docutils literal">localhost</tt>,
- the Bugzilla database name is <tt class="docutils literal">bugs</tt> and MySQL is
- accessed with MySQL username <tt class="docutils literal">bugs</tt> password <tt class="docutils literal">XYZZY</tt>. It is used
- with a collection of Mercurial repositories in <tt class="docutils literal">/var/local/hg/repos/</tt>,
- with a web interface at <tt class="docutils literal"><span class="pre">http://my-project.org/hg</span></tt>.</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://my-project.org/hg
- [usermap]
- user@emaildomain.com=user.name@bugzilladomain.com
- </pre>
- <p>All the above add a comment to the Bugzilla bug record of the form:</p>
- <pre class="literal-block">
- Changeset 3b16791d6642 in repository-name.
- http://my-project.org/hg/repository-name/rev/3b16791d6642
- Changeset commit comment. Bug 1234.
- </pre>
- </div>
- <div class="section" id="censor">
- <h2><a class="toc-backref" href="#id89">censor</a></h2>
- <p>erase file content at a given revision</p>
- <p>The censor command instructs Mercurial to erase all content of a file at a given
- revision <em>without updating the changeset hash.</em> This allows existing history to
- remain valid while preventing future clones/pulls from receiving the erased
- data.</p>
- <p>Typical uses for censor are due to security or legal requirements, including:</p>
- <pre class="literal-block">
- * Passwords, private keys, crytographic material
- * Licensed data/code/libraries for which the license has expired
- * Personally Identifiable Information or other private data
- </pre>
- <p>Censored nodes can interrupt mercurial's typical operation whenever the excised
- data needs to be materialized. Some commands, like <tt class="docutils literal">hg cat</tt>/<tt class="docutils literal">hg revert</tt>,
- simply fail when asked to produce censored data. Others, like <tt class="docutils literal">hg verify</tt> and
- <tt class="docutils literal">hg update</tt>, must be capable of tolerating censored data to continue to
- function in a meaningful way. Such commands only tolerate censored file
- revisions if they are allowed by the "censor.policy=ignore" config option.</p>
- <div class="section" id="id16">
- <h3>Commands</h3>
- <div class="section" id="id17">
- <h4>censor</h4>
- <pre class="literal-block">
- hg censor -r REV [-t TEXT] [FILE]
- </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" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>censor file from specified revision</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-t</span>, <span class="option">--tombstone <var><TEXT></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>replacement tombstone data</td></tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <div class="section" id="children">
- <h2><a class="toc-backref" href="#id90">children</a></h2>
- <p>command to display child changesets (DEPRECATED)</p>
- <p>This extension is deprecated. You should use <a class="reference external" href="hg.1.html#log"><tt class="docutils literal">hg log <span class="pre">-r</span>
- "children(REV)"</tt></a> instead.</p>
- <div class="section" id="id18">
- <h3>Commands</h3>
- <div class="section" id="id19">
- <h4>children</h4>
- <p>show the children of the given or working directory revision:</p>
- <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" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>show children of the specified revision</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--style <var><STYLE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>display using template map file (DEPRECATED)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-T</span>, <span class="option">--template <var><TEMPLATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>display with template</td></tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <div class="section" id="churn">
- <h2><a class="toc-backref" href="#id91">churn</a></h2>
- <p>command to display statistics about repository history</p>
- <div class="section" id="id20">
- <h3>Commands</h3>
- <div class="section" id="id21">
- <h4>churn</h4>
- <p>histogram of changes to the repository:</p>
- <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.
- Aliases will be split from the rightmost "=".</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">-r</span>, <span class="option">--rev <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>count rate for the specified revision or revset</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-d</span>, <span class="option">--date <var><DATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>count rate for revisions matching date spec</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-t</span>, <span class="option">--oldtemplate <var><TEMPLATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>template to group changesets (DEPRECATED)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-T</span>, <span class="option">--template <var><TEMPLATE></var></span></kbd></td>
- </tr>
- <tr><td> </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 <var><FORMAT></var></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" colspan="2">
- <kbd><span class="option">--aliases <var><FILE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>file with email aliases</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>exclude names matching the given patterns</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- </div>
- </div>
- <div class="section" id="color">
- <h2><a class="toc-backref" href="#id92">color</a></h2>
- <p>colorize output from some commands</p>
- <p>The color extension colorizes output from several Mercurial commands.
- For example, the diff command shows additions in green and deletions
- in red, while the status command shows modified files in magenta. Many
- other commands have analogous colors. It is possible to customize
- these colors.</p>
- <div class="section" id="effects">
- <h3>Effects</h3>
- <p>Other effects in addition to color, like bold and underlined text, are
- also available. By default, the terminfo database is used to find the
- terminal codes used to change color and effect. If terminfo is not
- available, then effects are rendered with the ECMA-48 SGR control
- function (aka ANSI escape codes).</p>
- <p>The available effects in terminfo mode are 'blink', 'bold', 'dim',
- 'inverse', 'invisible', 'italic', 'standout', and 'underline'; in
- ECMA-48 mode, the options are 'bold', 'inverse', 'italic', and
- 'underline'. How each is rendered depends on the terminal emulator.
- Some may not be available for a given terminal type, and will be
- silently ignored.</p>
- </div>
- <div class="section" id="labels">
- <h3>Labels</h3>
- <p>Text receives color effects depending on the labels that it has. Many
- default Mercurial commands emit labelled text. You can also define
- your own labels in templates using the label function, see <a class="reference external" href="hg.1.html#templates"><tt class="docutils literal">hg help
- templates</tt></a>. A single portion of text may have more than one label. In
- that case, effects given to the last label will override any other
- effects. This includes the special "none" effect, which nullifies
- other effects.</p>
- <p>Labels are normally invisible. In order to see these labels and their
- position in the text, use the global --color=debug option. The same
- anchor text may be associated to multiple labels, e.g.</p>
- <blockquote>
- [log.changeset changeset.secret|changeset: 22611:6f0a53c8f587]</blockquote>
- <p>The following are the default effects for some default labels. 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.tab =
- diff.trailingwhitespace = bold red_background
- # Blank so it inherits the style of the surrounding label
- changeset.public =
- changeset.draft =
- changeset.secret =
- resolve.unresolved = red bold
- resolve.resolved = green bold
- bookmarks.active = green
- branches.active = none
- branches.closed = black bold
- branches.current = green
- branches.inactive = none
- tags.normal = green
- tags.local = black bold
- rebase.rebased = blue
- rebase.remaining = red bold
- shelve.age = cyan
- shelve.newest = green bold
- shelve.name = blue bold
- histedit.remaining = red bold
- </pre>
- </div>
- <div class="section" id="custom-colors">
- <h3>Custom colors</h3>
- <p>Because there are only eight standard colors, this module allows you
- to define color names for other color slots which might be available
- for your terminal type, assuming terminfo mode. For instance:</p>
- <pre class="literal-block">
- color.brightblue = 12
- color.pink = 207
- color.orange = 202
- </pre>
- <p>to set 'brightblue' to color slot 12 (useful for 16 color terminals
- that have brighter colors defined in the upper eight) and, 'pink' and
- 'orange' to colors in 256-color xterm's default color cube. These
- defined colors may then be used as any of the pre-defined eight,
- including appending '_background' to set the background to that color.</p>
- </div>
- <div class="section" id="modes">
- <h3>Modes</h3>
- <p>By default, the color extension will use ANSI mode (or win32 mode on
- Windows) if it detects a terminal. To override auto mode (to enable
- terminfo mode, for example), set the following configuration option:</p>
- <pre class="literal-block">
- [color]
- mode = terminfo
- </pre>
- <p>Any value other than 'ansi', 'win32', 'terminfo', or 'auto' will
- disable color.</p>
- <p>Note that on some systems, terminfo mode may cause problems when using
- color with the pager extension and less -R. less with the -R option
- will only display ECMA-48 color codes, and terminfo mode may sometimes
- emit codes that less doesn't understand. You can work around this by
- either using ansi mode (or auto mode), or by using less -r (which will
- pass through all terminal control codes, not just color control
- codes).</p>
- <p>On some systems (such as MSYS in Windows), the terminal may support
- a different color mode than the pager (activated via the "pager"
- extension). It is possible to define separate modes depending on whether
- the pager is active:</p>
- <pre class="literal-block">
- [color]
- mode = auto
- pagermode = ansi
- </pre>
- <p>If <tt class="docutils literal">pagermode</tt> is not defined, the <tt class="docutils literal">mode</tt> will be used.</p>
- </div>
- <div class="section" id="id22">
- <h3>Commands</h3>
- </div>
- </div>
- <div class="section" id="convert">
- <h2><a class="toc-backref" href="#id93">convert</a></h2>
- <p>import revisions from foreign VCS repositories into Mercurial</p>
- <div class="section" id="id23">
- <h3>Commands</h3>
- <div class="section" id="id24">
- <h4>convert</h4>
- <p>convert a foreign SCM repository to a Mercurial one.:</p>
- <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>
- <tr><td class="option-group">
- <kbd><span class="option">--closesort</span></kbd></td>
- <td>try to move closed revisions as close as possible
- to parent branches, only supported by Mercurial
- sources.</td></tr>
- </tbody>
- </table>
- <p>If <tt class="docutils literal">REVMAP</tt> isn't given, it will be put in a default location
- (<tt class="docutils literal"><span class="pre"><dest>/.hg/shamap</span></tt> by default). The <tt class="docutils literal">REVMAP</tt> 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 (e.g.: 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. The default
- if there are no <tt class="docutils literal">include</tt> statements is to include everything.
- If there are any <tt class="docutils literal">include</tt> statements, nothing else is 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><tt class="docutils literal"><span class="pre">--full</span></tt> will make sure the converted changesets contain exactly
- the right files with the right content. It will make a full
- conversion of all files, not just the ones that have
- changed. Files that already are correct will not be changed. This
- can be used to apply filemap changes when converting
- incrementally. This is currently only supported for Mercurial and
- Subversion.</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>
- <p>The Mercurial source recognizes the following configuration
- options, which you can set on the command line with <tt class="docutils literal"><span class="pre">--config</span></tt>:</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" colspan="2">convert.hg.ignoreerrors:</th></tr>
- <tr class="field"><td> </td><td class="field-body">ignore integrity errors when reading.
- Use it to fix Mercurial repositories with missing revlogs, by
- converting from and to Mercurial. Default is False.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">convert.hg.saverev:</th></tr>
- <tr class="field"><td> </td><td class="field-body">store original revision ID in changeset
- (forces target IDs to change). It takes a boolean argument and
- defaults to False.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">convert.hg.startrev:</th></tr>
- <tr class="field"><td> </td><td class="field-body">specify the initial Mercurial revision.
- The default is 0.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">convert.hg.revs:</th></tr>
- <tr class="field"><td> </td><td class="field-body">revset specifying the source revisions to convert.</td>
- </tr>
- </tbody>
- </table>
- </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 <tt class="docutils literal">:local:</tt>. 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 following options can be used with <tt class="docutils literal"><span class="pre">--config</span></tt>:</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" colspan="2">convert.cvsps.cache:</th></tr>
- <tr class="field"><td> </td><td class="field-body">Set to False to disable remote log caching,
- for testing and debugging purposes. Default is True.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">convert.cvsps.fuzz:</th></tr>
- <tr class="field"><td> </td><td class="field-body">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.
- The default is 60.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">convert.cvsps.mergeto:</th></tr>
- <tr class="field"><td> </td><td class="field-body">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. Default is <tt class="docutils literal">{{mergetobranch
- <span class="pre">([-\w]+)}}</span></tt></td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">convert.cvsps.mergefrom:</th></tr>
- <tr class="field"><td> </td><td class="field-body">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. Default is <tt class="docutils literal">{{mergefrombranch <span class="pre">([-\w]+)}}</span></tt></td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">convert.localtimezone:</th></tr>
- <tr class="field"><td> </td><td class="field-body">use local time (as determined by the TZ
- environment variable) for changeset date/times. The default
- is False (use UTC).</td>
- </tr>
- <tr class="field"><th class="field-name">hooks.cvslog:</th><td class="field-body">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.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">hooks.cvschangesets:</th></tr>
- <tr class="field"><td> </td><td class="field-body">Specify a Python function to be called after
- the changesets are calculated from 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.</td>
- </tr>
- </tbody>
- </table>
- <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 <tt class="docutils literal"><span class="pre">svn://repo/path/</span></tt> source URL is
- converted as a single branch. If <tt class="docutils literal"><span class="pre">svn://repo/path/trunk</span></tt> exists
- it replaces the default branch. If <tt class="docutils literal"><span class="pre">svn://repo/path/branches</span></tt>
- exists, its subdirectories are listed as possible branches. If
- <tt class="docutils literal"><span class="pre">svn://repo/path/tags</span></tt> exists, it is looked for tags referencing
- converted branches. Default <tt class="docutils literal">trunk</tt>, <tt class="docutils literal">branches</tt> and <tt class="docutils literal">tags</tt>
- 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>
- <p>The following options can be set with <tt class="docutils literal"><span class="pre">--config</span></tt>:</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" colspan="2">convert.svn.branches:</th></tr>
- <tr class="field"><td> </td><td class="field-body">specify the directory containing branches.
- The default is <tt class="docutils literal">branches</tt>.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">convert.svn.tags:</th></tr>
- <tr class="field"><td> </td><td class="field-body">specify the directory containing tags. The
- default is <tt class="docutils literal">tags</tt>.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">convert.svn.trunk:</th></tr>
- <tr class="field"><td> </td><td class="field-body">specify the name of the trunk branch. The
- default is <tt class="docutils literal">trunk</tt>.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">convert.localtimezone:</th></tr>
- <tr class="field"><td> </td><td class="field-body">use local time (as determined by the TZ
- environment variable) for changeset date/times. The default
- is False (use UTC).</td>
- </tr>
- </tbody>
- </table>
- <p>Source history can be retrieved starting at a specific revision,
- instead of being integrally converted. Only single branch
- conversions are supported.</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" colspan="2">convert.svn.startrev:</th></tr>
- <tr class="field"><td> </td><td class="field-body">specify start Subversion revision number.
- The default is 0.</td>
- </tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="git-source">
- <h5>Git Source</h5>
- <p>The Git importer converts commits from all reachable branches (refs
- in refs/heads) and remotes (refs in refs/remotes) to Mercurial.
- Branches are converted to bookmarks with the same name, with the
- leading 'refs/heads' stripped. Git submodules are converted to Git
- subrepos in Mercurial.</p>
- <p>The following options can be set with <tt class="docutils literal"><span class="pre">--config</span></tt>:</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" colspan="2">convert.git.similarity:</th></tr>
- <tr class="field"><td> </td><td class="field-body">specify how similar files modified in a
- commit must be to be imported as renames or copies, as a
- percentage between <tt class="docutils literal">0</tt> (disabled) and <tt class="docutils literal">100</tt> (files must be
- identical). For example, <tt class="docutils literal">90</tt> means that a delete/add pair will
- be imported as a rename if more than 90% of the file hasn't
- changed. The default is <tt class="docutils literal">50</tt>.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">convert.git.findcopiesharder:</th></tr>
- <tr class="field"><td> </td><td class="field-body">while detecting copies, look at all
- files in the working copy instead of just changed ones. This
- is very expensive for large projects, and is only effective when
- <tt class="docutils literal">convert.git.similarity</tt> is greater than 0. The default is False.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">convert.git.remoteprefix:</th></tr>
- <tr class="field"><td> </td><td class="field-body">remote refs are converted as bookmarks with
- <tt class="docutils literal">convert.git.remoteprefix</tt> as a prefix followed by a /. The default
- is 'remote'.</td>
- </tr>
- </tbody>
- </table>
- </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 <tt class="docutils literal"><span class="pre">...-hg</span></tt>.</p>
- <p>The following options can be set with <tt class="docutils literal"><span class="pre">--config</span></tt>:</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" colspan="2">convert.p4.encoding:</th></tr>
- <tr class="field"><td> </td><td class="field-body">specify the encoding to use when decoding standard
- output of the Perforce command line tool. The default is default system
- encoding.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">convert.p4.startrev:</th></tr>
- <tr class="field"><td> </td><td class="field-body">specify initial Perforce revision (a
- Perforce changelist number).</td>
- </tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="mercurial-destination">
- <h5>Mercurial Destination</h5>
- <p>The Mercurial destination will recognize Mercurial subrepositories in the
- destination directory, and update the .hgsubstate file automatically if the
- destination subrepositories contain the <dest>/<sub>/.hg/shamap file.
- Converting a repository with subrepositories requires converting a single
- repository at a time, from the bottom up.</p>
- <div class="verbose container">
- <p>An example showing how to convert a repository with subrepositories:</p>
- <pre class="literal-block">
- # so convert knows the type when it sees a non empty destination
- $ hg init converted
- $ hg convert orig/sub1 converted/sub1
- $ hg convert orig/sub2 converted/sub2
- $ hg convert orig converted
- </pre>
- </div>
- <p>The following options are supported:</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" colspan="2">convert.hg.clonebranches:</th></tr>
- <tr class="field"><td> </td><td class="field-body">dispatch source branches in separate
- clones. The default is False.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">convert.hg.tagsbranch:</th></tr>
- <tr class="field"><td> </td><td class="field-body">branch name for tag revisions, defaults to
- <tt class="docutils literal">default</tt>.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">convert.hg.usebranchnames:</th></tr>
- <tr class="field"><td> </td><td class="field-body">preserve branch names. The default is
- True.</td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">convert.hg.sourcename:</th></tr>
- <tr class="field"><td> </td><td class="field-body">records the given string as a 'convert_source' extra
- value on each commit made in the target repository. The default is None.</td>
- </tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="all-destinations">
- <h5>All Destinations</h5>
- <p>All destination types accept the following options:</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" colspan="2">convert.skiptags:</th></tr>
- <tr class="field"><td> </td><td class="field-body">does not convert tags from the source repo to the target
- repo. The default is False.</td>
- </tr>
- </tbody>
- </table>
- <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">--authors <var><FILE></var></span></kbd></td>
- </tr>
- <tr><td> </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 <var><TYPE></var></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 <var><TYPE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>destination repository type</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>import up to source revision REV</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-A</span>, <span class="option">--authormap <var><FILE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>remap usernames using this file</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--filemap <var><FILE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>remap file names using contents of file</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--full</span></kbd></td>
- <td>apply filemap changes by converting all files again</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--splicemap <var><FILE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>splice synthesized history into place</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--branchmap <var><FILE></var></span></kbd></td>
- </tr>
- <tr><td> </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>
- <tr><td class="option-group">
- <kbd><span class="option">--closesort</span></kbd></td>
- <td>try to reorder closed revisions</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- </div>
- </div>
- </div>
- <div class="section" id="eol">
- <h2><a class="toc-backref" href="#id94">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 found in the root of the working directory. 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 directory 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
- directory, 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 read from both the
- normal Mercurial configuration files and the <tt class="docutils literal">.hgeol</tt> file, with the
- latter overriding the former. You can use that section to control the
- overall behavior. There are three 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>
- <li><tt class="docutils literal"><span class="pre">eol.fix-trailing-newline</span></tt> (default False) can be set to True to
- ensure that converted files end with a EOL character (either <tt class="docutils literal">\n</tt>
- or <tt class="docutils literal">\r\n</tt> as per the configured patterns).</li>
- </ul>
- <p>The extension provides <tt class="docutils literal">cleverencode:</tt> and <tt class="docutils literal">cleverdecode:</tt> filters
- like the deprecated win32text extension does. This means that you can
- disable win32text and enable eol and your filters will still work. You
- only need to these filters until you have prepared a <tt class="docutils literal">.hgeol</tt> file.</p>
- <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.checkheadshook</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. <tt class="docutils literal">eol.checkheadshook</tt> only checks heads, intermediate
- invalid revisions will be pushed. To forbid them completely, use the
- <tt class="docutils literal">eol.checkallhook</tt> hook. These hooks are best used as
- <tt class="docutils literal">pretxnchangegroup</tt> hooks.</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="#id95">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 you 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 meld, runs meld (no need to name twice). If
- # the meld executable is not available, the meld tool in [merge-tools]
- # will be used, if available
- 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' fnameescape(argv(0)) fnameescape(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
- $root - repository root
- $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="id25">
- <h3>Commands</h3>
- <div class="section" id="id26">
- <h4>extdiff</h4>
- <p>use external program to diff repository (or selected files):</p>
- <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" colspan="2">
- <kbd><span class="option">-p</span>, <span class="option">--program <var><CMD></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>comparison program to run</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-o</span>, <span class="option">--option <var><OPT[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>pass option to comparison program</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>revision</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-c</span>, <span class="option">--change <var><REV></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>change made by revision</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </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>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- </div>
- </div>
- <div class="section" id="factotum">
- <h2><a class="toc-backref" href="#id96">factotum</a></h2>
- <p>http authentication with factotum</p>
- <p>This extension allows the factotum(4) facility on Plan 9 from Bell Labs
- platforms to provide authentication information for HTTP access. Configuration
- entries specified in the auth section as well as authentication information
- provided in the repository URL are fully supported. If no prefix is specified,
- a value of "*" will be assumed.</p>
- <p>By default, keys are specified as:</p>
- <pre class="literal-block">
- proto=pass service=hg prefix=<prefix> user=<username> !password=<password>
- </pre>
- <p>If the factotum extension is unable to read the required key, one will be
- requested interactively.</p>
- <p>A configuration section is available to customize runtime behavior. By
- default, these entries are:</p>
- <pre class="literal-block">
- [factotum]
- executable = /bin/auth/factotum
- mountpoint = /mnt/factotum
- service = hg
- </pre>
- <p>The executable entry defines the full path to the factotum binary. The
- mountpoint entry defines the path to the factotum file service. Lastly, the
- service entry controls the service name used when reading keys.</p>
- </div>
- <div class="section" id="fetch">
- <h2><a class="toc-backref" href="#id97">fetch</a></h2>
- <p>pull, update and merge in one command (DEPRECATED)</p>
- <div class="section" id="id27">
- <h3>Commands</h3>
- <div class="section" id="id28">
- <h4>fetch</h4>
- <p>pull changes from a remote repository, merge new changes if needed.:</p>
- <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 is needed, the working directory is first updated to
- the newly pulled changes. Local changes are then merged into the
- pulled changes. 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" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </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>invoke editor on commit messages</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" colspan="2">
- <kbd><span class="option">-m</span>, <span class="option">--message <var><TEXT></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>use text as commit message</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-l</span>, <span class="option">--logfile <var><FILE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>read commit message from file</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-d</span>, <span class="option">--date <var><DATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>record the specified date as commit date</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-u</span>, <span class="option">--user <var><USER></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>record the specified user as committer</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-e</span>, <span class="option">--ssh <var><CMD></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify ssh command to use</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--remotecmd <var><CMD></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify hg command to run on the remote side</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--insecure</span></kbd></td>
- <td>do not verify server certificate (ignoring web.cacerts config)</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- </div>
- </div>
- <div class="section" id="gpg">
- <h2><a class="toc-backref" href="#id98">gpg</a></h2>
- <p>commands to sign and verify changesets</p>
- <div class="section" id="id29">
- <h3>Commands</h3>
- <div class="section" id="sigcheck">
- <h4>sigcheck</h4>
- <p>verify all the signatures there may be for a particular revision:</p>
- <pre class="literal-block">
- hg sigcheck REV
- </pre>
- <p>verify all the signatures there may be for a particular revision</p>
- </div>
- <div class="section" id="sign">
- <h4>sign</h4>
- <p>add a signature for the current or given revision:</p>
- <pre class="literal-block">
- hg sign [OPTION]... [REV]...
- </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>The <tt class="docutils literal">gpg.cmd</tt> config setting can be used to specify the command
- to run. A default key can be specified with <tt class="docutils literal">gpg.key</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>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 <var><ID></var></span></kbd></td>
- <td>the key id to sign with</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-m</span>, <span class="option">--message <var><TEXT></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>use text as commit message</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td>
- <td>invoke editor on commit messages</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-d</span>, <span class="option">--date <var><DATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>record the specified date as commit date</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-u</span>, <span class="option">--user <var><USER></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>record the specified user as committer</td></tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="sigs">
- <h4>sigs</h4>
- <p>list signed changesets:</p>
- <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="#id99">graphlog</a></h2>
- <p>command to view revision graphs from a shell (DEPRECATED)</p>
- <p>The functionality of this extension has been include in core Mercurial
- since version 2.3.</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="id30">
- <h3>Commands</h3>
- <div class="section" id="glog">
- <h4>glog</h4>
- <p>show revision history alongside an ASCII revision graph:</p>
- <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">-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 (DEPRECATED)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-d</span>, <span class="option">--date <var><DATE></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">-k</span>, <span class="option">--keyword <var><TEXT[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>do case-insensitive search for a given text</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>show the specified revision or revset</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 (DEPRECATED)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-u</span>, <span class="option">--user <var><USER[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>revisions committed by user</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--only-branch <var><BRANCH[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>show only changesets within the given named branch (DEPRECATED)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-b</span>, <span class="option">--branch <var><BRANCH[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>show changesets within the given named branch</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-P</span>, <span class="option">--prune <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">-l</span>, <span class="option">--limit <var><NUM></var></span></kbd></td>
- </tr>
- <tr><td> </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">-G</span>, <span class="option">--graph</span></kbd></td>
- <td>show the revision DAG</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--style <var><STYLE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>display using template map file (DEPRECATED)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-T</span>, <span class="option">--template <var><TEMPLATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>display with template</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>exclude names matching the given patterns</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- </div>
- </div>
- <div class="section" id="hgcia">
- <h2><a class="toc-backref" href="#id100">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}{webroot}/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, e.g.
- # 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
- # number of slashes to strip for url paths
- #strip = 0
- [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="#id101">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="id31">
- <h3>Commands</h3>
- <div class="section" id="view">
- <h4>view</h4>
- <p>start interactive history viewer:</p>
- <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" colspan="2">
- <kbd><span class="option">-l</span>, <span class="option">--limit <var><NUM></var></span></kbd></td>
- </tr>
- <tr><td> </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="#id102">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="histedit">
- <h2><a class="toc-backref" href="#id103">histedit</a></h2>
- <p>interactive history editing</p>
- <p>With this extension installed, Mercurial gains one new command: histedit. Usage
- is as follows, assuming the following history:</p>
- <pre class="literal-block">
- @ 3[tip] 7c2fd3b9020c 2009-04-27 18:04 -0500 durin42
- | Add delta
- |
- o 2 030b686bedc4 2009-04-27 18:04 -0500 durin42
- | Add gamma
- |
- o 1 c561b4e977df 2009-04-27 18:04 -0500 durin42
- | Add beta
- |
- o 0 d8d2fcd0e319 2009-04-27 18:04 -0500 durin42
- Add alpha
- </pre>
- <p>If you were to run <tt class="docutils literal">hg histedit c561b4e977df</tt>, you would see the following
- file open in your editor:</p>
- <pre class="literal-block">
- pick c561b4e977df Add beta
- pick 030b686bedc4 Add gamma
- pick 7c2fd3b9020c Add delta
- # Edit history between c561b4e977df and 7c2fd3b9020c
- #
- # Commits are listed from least to most recent
- #
- # Commands:
- # p, pick = use commit
- # e, edit = use commit, but stop for amending
- # f, fold = use commit, but combine it with the one above
- # r, roll = like fold, but discard this commit's description
- # d, drop = remove commit from history
- # m, mess = edit message without changing commit content
- #
- </pre>
- <p>In this file, lines beginning with <tt class="docutils literal">#</tt> are ignored. You must specify a rule
- for each revision in your history. For example, if you had meant to add gamma
- before beta, and then wanted to add delta in the same revision as beta, you
- would reorganize the file to look like this:</p>
- <pre class="literal-block">
- pick 030b686bedc4 Add gamma
- pick c561b4e977df Add beta
- fold 7c2fd3b9020c Add delta
- # Edit history between c561b4e977df and 7c2fd3b9020c
- #
- # Commits are listed from least to most recent
- #
- # Commands:
- # p, pick = use commit
- # e, edit = use commit, but stop for amending
- # f, fold = use commit, but combine it with the one above
- # r, roll = like fold, but discard this commit's description
- # d, drop = remove commit from history
- # m, mess = edit message without changing commit content
- #
- </pre>
- <p>At which point you close the editor and <tt class="docutils literal">histedit</tt> starts working. When you
- specify a <tt class="docutils literal">fold</tt> operation, <tt class="docutils literal">histedit</tt> will open an editor when it folds
- those revisions together, offering you a chance to clean up the commit message:</p>
- <pre class="literal-block">
- Add beta
- ***
- Add delta
- </pre>
- <p>Edit the commit message to your liking, then close the editor. For
- this example, let's assume that the commit message was changed to
- <tt class="docutils literal">Add beta and delta.</tt> After histedit has run and had a chance to
- remove any old or temporary revisions it needed, the history looks
- like this:</p>
- <pre class="literal-block">
- @ 2[tip] 989b4d060121 2009-04-27 18:04 -0500 durin42
- | Add beta and delta.
- |
- o 1 081603921c3f 2009-04-27 18:04 -0500 durin42
- | Add gamma
- |
- o 0 d8d2fcd0e319 2009-04-27 18:04 -0500 durin42
- Add alpha
- </pre>
- <p>Note that <tt class="docutils literal">histedit</tt> does <em>not</em> remove any revisions (even its own temporary
- ones) until after it has completed all the editing operations, so it will
- probably perform several strip operations when it's done. For the above example,
- it had to run strip twice. Strip can be slow depending on a variety of factors,
- so you might need to be a little patient. You can choose to keep the original
- revisions by passing the <tt class="docutils literal"><span class="pre">--keep</span></tt> flag.</p>
- <p>The <tt class="docutils literal">edit</tt> operation will drop you back to a command prompt,
- allowing you to edit files freely, or even use <tt class="docutils literal">hg record</tt> to commit
- some changes as a separate commit. When you're done, any remaining
- uncommitted changes will be committed as well. When done, run <tt class="docutils literal">hg
- histedit <span class="pre">--continue</span></tt> to finish this step. You'll be prompted for a
- new commit message, but the default commit message will be the
- original message for the <tt class="docutils literal">edit</tt> ed revision.</p>
- <p>The <tt class="docutils literal">message</tt> operation will give you a chance to revise a commit
- message without changing the contents. It's a shortcut for doing
- <tt class="docutils literal">edit</tt> immediately followed by <cite>hg histedit --continue`</cite>.</p>
- <p>If <tt class="docutils literal">histedit</tt> encounters a conflict when moving a revision (while
- handling <tt class="docutils literal">pick</tt> or <tt class="docutils literal">fold</tt>), it'll stop in a similar manner to
- <tt class="docutils literal">edit</tt> with the difference that it won't prompt you for a commit
- message when done. If you decide at this point that you don't like how
- much work it will be to rearrange history, or that you made a mistake,
- you can use <tt class="docutils literal">hg histedit <span class="pre">--abort</span></tt> to abandon the new changes you
- have made and return to the state before you attempted to edit your
- history.</p>
- <p>If we clone the histedit-ed example repository above and add four more
- changes, such that we have the following history:</p>
- <pre class="literal-block">
- @ 6[tip] 038383181893 2009-04-27 18:04 -0500 stefan
- | Add theta
- |
- o 5 140988835471 2009-04-27 18:04 -0500 stefan
- | Add eta
- |
- o 4 122930637314 2009-04-27 18:04 -0500 stefan
- | Add zeta
- |
- o 3 836302820282 2009-04-27 18:04 -0500 stefan
- | Add epsilon
- |
- o 2 989b4d060121 2009-04-27 18:04 -0500 durin42
- | Add beta and delta.
- |
- o 1 081603921c3f 2009-04-27 18:04 -0500 durin42
- | Add gamma
- |
- o 0 d8d2fcd0e319 2009-04-27 18:04 -0500 durin42
- Add alpha
- </pre>
- <p>If you run <tt class="docutils literal">hg histedit <span class="pre">--outgoing</span></tt> on the clone then it is the same
- as running <tt class="docutils literal">hg histedit 836302820282</tt>. If you need plan to push to a
- repository that Mercurial does not detect to be related to the source
- repo, you can add a <tt class="docutils literal"><span class="pre">--force</span></tt> option.</p>
- <p>Histedit rule lines are truncated to 80 characters by default. You
- can customise this behaviour by setting a different length in your
- configuration file:</p>
- <pre class="literal-block">
- [histedit]
- linelen = 120 # truncate rule lines at 120 characters
- </pre>
- <div class="section" id="id32">
- <h3>Commands</h3>
- <div class="section" id="id33">
- <h4>histedit</h4>
- <p>interactively edit changeset history:</p>
- <pre class="literal-block">
- hg histedit ANCESTOR | --outgoing [URL]
- </pre>
- <p>This command edits changesets between ANCESTOR and the parent of
- the working directory.</p>
- <p>With --outgoing, this edits changesets not found in the
- destination repository. If URL of the destination is omitted, the
- 'default-push' (or 'default') path will be used.</p>
- <p>For safety, this command is aborted, also if there are ambiguous
- outgoing revisions which may confuse users: for example, there are
- multiple branches containing outgoing revisions.</p>
- <p>Use "min(outgoing() and ::.)" or similar revset specification
- instead of --outgoing to specify edit target revision exactly in
- such ambiguous situation. See <a class="reference external" href="hg.1.html#revsets"><tt class="docutils literal">hg help revsets</tt></a> for detail about
- selecting revisions.</p>
- <p>Returns 0 on success, 1 if user intervention is required (not only
- for intentional "edit" command, but also for resolving unexpected
- conflicts).</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">--commands <var><FILE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>read history edits from the specified file</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-c</span>, <span class="option">--continue</span></kbd></td>
- <td>continue an edit already in progress</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--edit-plan</span></kbd></td>
- <td>edit remaining actions list</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-k</span>, <span class="option">--keep</span></kbd></td>
- <td>don't strip old nodes after edit is complete</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--abort</span></kbd></td>
- <td>abort an edit in progress</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-o</span>, <span class="option">--outgoing</span></kbd></td>
- <td>changesets not found in destination</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
- <td>force outgoing even for unrelated repositories</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>first revision to be edited</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- </div>
- </div>
- <div class="section" id="keyword">
- <h2><a class="toc-backref" href="#id104">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>
- <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">utcdate</tt>:</th><td class="field-body">"2006/09/18 15:13:13"</td>
- </tr>
- <tr class="field"><th class="field-name"><tt class="docutils literal">svnutcdate</tt>:</th><td class="field-body">"2006-09-18 15:13:13Z"</td>
- </tr>
- <tr class="field"><th class="field-name"><tt class="docutils literal">svnisodate</tt>:</th><td class="field-body">"2006-09-18 08:13:13 -700 (Mon, 18 Sep 2006)"</td>
- </tr>
- </tbody>
- </table>
- <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, you must run <a class="reference external" href="hg.1.html#kwshrink"><tt class="docutils literal">hg kwshrink</tt></a>
- to avoid 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="id34">
- <h3>Commands</h3>
- <div class="section" id="kwdemo">
- <h4>kwdemo</h4>
- <p>print [keywordmaps] configuration and an expansion example:</p>
- <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" colspan="2">
- <kbd><span class="option">-f</span>, <span class="option">--rcfile <var><FILE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>read maps from rcfile</td></tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="kwexpand">
- <h4>kwexpand</h4>
- <p>expand keywords in the working directory:</p>
- <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" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>exclude names matching the given patterns</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- <div class="section" id="kwfiles">
- <h4>kwfiles</h4>
- <p>show files configured for keyword expansion:</p>
- <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" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>exclude names matching the given patterns</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- <div class="section" id="kwshrink">
- <h4>kwshrink</h4>
- <p>revert expanded keywords in the working directory:</p>
- <pre class="literal-block">
- hg kwshrink [OPTION]... [FILE]...
- </pre>
- <p>Must be run before changing/disabling active keywords.</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" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>exclude names matching the given patterns</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- </div>
- </div>
- <div class="section" id="largefiles">
- <h2><a class="toc-backref" href="#id105">largefiles</a></h2>
- <p>track large binary files</p>
- <p>Large binary files tend to be not very compressible, not very
- diffable, and not at all mergeable. Such files are not handled
- efficiently by Mercurial's storage format (revlog), which is based on
- compressed binary deltas; storing large binary files as regular
- Mercurial files wastes bandwidth and disk space and increases
- Mercurial's memory usage. The largefiles extension addresses these
- problems by adding a centralized client-server layer on top of
- Mercurial: largefiles live in a <em>central store</em> out on the network
- somewhere, and you only fetch the revisions that you need when you
- need them.</p>
- <p>largefiles works by maintaining a "standin file" in .hglf/ for each
- largefile. The standins are small (41 bytes: an SHA-1 hash plus
- newline) and are tracked by Mercurial. Largefile revisions are
- identified by the SHA-1 hash of their contents, which is written to
- the standin. largefiles uses that revision ID to get/put largefile
- revisions from/to the central store. This saves both disk space and
- bandwidth, since you don't need to retrieve all historical revisions
- of large files when you clone or pull.</p>
- <p>To start a new repository or add new large binary files, just add
- --large to your <a class="reference external" href="hg.1.html#add"><tt class="docutils literal">hg add</tt></a> command. For example:</p>
- <pre class="literal-block">
- $ dd if=/dev/urandom of=randomdata count=2000
- $ hg add --large randomdata
- $ hg commit -m 'add randomdata as a largefile'
- </pre>
- <p>When you push a changeset that adds/modifies largefiles to a remote
- repository, its largefile revisions will be uploaded along with it.
- Note that the remote Mercurial must also have the largefiles extension
- enabled for this to work.</p>
- <p>When you pull a changeset that affects largefiles from a remote
- repository, the largefiles for the changeset will by default not be
- pulled down. However, when you update to such a revision, any
- largefiles needed by that revision are downloaded and cached (if
- they have never been downloaded before). One way to pull largefiles
- when pulling is thus to use --update, which will update your working
- copy to the latest pulled revision (and thereby downloading any new
- largefiles).</p>
- <p>If you want to pull largefiles you don't need for update yet, then
- you can use pull with the <cite>--lfrev</cite> option or the <a class="reference external" href="hg.1.html#lfpull"><tt class="docutils literal">hg lfpull</tt></a> command.</p>
- <p>If you know you are pulling from a non-default location and want to
- download all the largefiles that correspond to the new changesets at
- the same time, then you can pull with <cite>--lfrev "pulled()"</cite>.</p>
- <p>If you just want to ensure that you will have the largefiles needed to
- merge or rebase with new heads that you are pulling, then you can pull
- with <cite>--lfrev "head(pulled())"</cite> flag to pre-emptively download any largefiles
- that are new in the heads you are pulling.</p>
- <p>Keep in mind that network access may now be required to update to
- changesets that you have not previously updated to. The nature of the
- largefiles extension means that updating is no longer guaranteed to
- be a local-only operation.</p>
- <p>If you already have large files tracked by Mercurial without the
- largefiles extension, you will need to convert your repository in
- order to benefit from largefiles. This is done with the
- <a class="reference external" href="hg.1.html#lfconvert"><tt class="docutils literal">hg lfconvert</tt></a> command:</p>
- <pre class="literal-block">
- $ hg lfconvert --size 10 oldrepo newrepo
- </pre>
- <p>In repositories that already have largefiles in them, any new file
- over 10MB will automatically be added as a largefile. To change this
- threshold, set <tt class="docutils literal">largefiles.minsize</tt> in your Mercurial config file
- to the minimum size in megabytes to track as a largefile, or use the
- --lfsize option to the add command (also in megabytes):</p>
- <pre class="literal-block">
- [largefiles]
- minsize = 2
- $ hg add --lfsize 2
- </pre>
- <p>The <tt class="docutils literal">largefiles.patterns</tt> config option allows you to specify a list
- of filename patterns (see <a class="reference external" href="hg.1.html#patterns"><tt class="docutils literal">hg help patterns</tt></a>) that should always be
- tracked as largefiles:</p>
- <pre class="literal-block">
- [largefiles]
- patterns =
- *.jpg
- re:.*\.(png|bmp)$
- library.zip
- content/audio/*
- </pre>
- <p>Files that match one of these patterns will be added as largefiles
- regardless of their size.</p>
- <p>The <tt class="docutils literal">largefiles.minsize</tt> and <tt class="docutils literal">largefiles.patterns</tt> config options
- will be ignored for any repositories not already containing a
- largefile. To add the first largefile to a repository, you must
- explicitly do so with the --large flag passed to the <a class="reference external" href="hg.1.html#add"><tt class="docutils literal">hg add</tt></a>
- command.</p>
- <div class="section" id="id35">
- <h3>Commands</h3>
- <div class="section" id="lfconvert">
- <h4>lfconvert</h4>
- <p>convert a normal repository to a largefiles repository:</p>
- <pre class="literal-block">
- hg lfconvert SOURCE DEST [FILE ...]
- </pre>
- <p>Convert repository SOURCE to a new repository DEST, identical to
- SOURCE except that certain files will be converted as largefiles:
- specifically, any file that matches any PATTERN <em>or</em> whose size is
- above the minimum size threshold is converted as a largefile. The
- size used to determine whether or not to track a file as a
- largefile is the size of the first version of the file. The
- minimum size can be specified either with --size or in
- configuration as <tt class="docutils literal">largefiles.size</tt>.</p>
- <p>After running this command you will need to make sure that
- largefiles is enabled anywhere you intend to push the new
- repository.</p>
- <p>Use --to-normal to convert largefiles back to normal files; after
- this, the DEST repository can be used without largefiles at all.</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">--size <var><SIZE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>minimum size (MB) for files to be converted as largefiles</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--to-normal</span></kbd></td>
- <td>convert from a largefiles repo to a normal repo</td></tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="lfpull">
- <h4>lfpull</h4>
- <p>pull largefiles for the specified revisions from the specified source:</p>
- <pre class="literal-block">
- hg lfpull -r REV... [-e CMD] [--remotecmd CMD] [SOURCE]
- </pre>
- <p>Pull largefiles that are referenced from local changesets but missing
- locally, pulling from a remote repository to the local cache.</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>
- <div class="verbose container">
- <p>Some examples:</p>
- <ul>
- <li><p class="first">pull largefiles for all branch heads:</p>
- <pre class="literal-block">
- hg lfpull -r "head() and not closed()"
- </pre>
- </li>
- <li><p class="first">pull largefiles on the default branch:</p>
- <pre class="literal-block">
- hg lfpull -r "branch(default)"
- </pre>
- </li>
- </ul>
- </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" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><VALUE[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>pull largefiles for these revisions</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-e</span>, <span class="option">--ssh <var><CMD></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify ssh command to use</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--remotecmd <var><CMD></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify hg command to run on the remote side</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--insecure</span></kbd></td>
- <td>do not verify server certificate (ignoring web.cacerts config)</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- </div>
- </div>
- <div class="section" id="mq">
- <h2><a class="toc-backref" href="#id106">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>It may be desirable for mq changesets to be kept in the secret phase (see
- <a class="reference external" href="hg.1.html#phases"><tt class="docutils literal">hg help phases</tt></a>), which can be enabled with the following setting:</p>
- <pre class="literal-block">
- [mq]
- secret = True
- </pre>
- <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>
- <p>If the working directory contains uncommitted files, qpush, qpop and
- qgoto abort immediately. If -f/--force is used, the changes are
- discarded. Setting:</p>
- <pre class="literal-block">
- [mq]
- keepchanges = True
- </pre>
- <p>make them behave as if --keep-changes were passed, and non-conflicting
- local changes will be tolerated and preserved. If incompatible options
- such as -f/--force or --exact are passed, this setting is ignored.</p>
- <p>This extension used to provide a strip command. This command now lives
- in the strip extension.</p>
- <div class="section" id="id36">
- <h3>Commands</h3>
- <div class="section" id="qapplied">
- <h4>qapplied</h4>
- <p>print the patches already applied:</p>
- <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 preceding applied 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>
- <p>clone main and patch repository at same time:</p>
- <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" colspan="2">
- <kbd><span class="option">-p</span>, <span class="option">--patches <var><REPO></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>location of source patch repository</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-e</span>, <span class="option">--ssh <var><CMD></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify ssh command to use</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--remotecmd <var><CMD></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify hg command to run on the remote side</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--insecure</span></kbd></td>
- <td>do not verify server certificate (ignoring web.cacerts config)</td></tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="qcommit">
- <h4>qcommit</h4>
- <p>commit changes in the queue repository (DEPRECATED):</p>
- <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 head as closed</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--amend</span></kbd></td>
- <td>amend the parent of the working directory</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-s</span>, <span class="option">--secret</span></kbd></td>
- <td>use the secret phase for committing</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td>
- <td>invoke editor on commit messages</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-i</span>, <span class="option">--interactive</span></kbd></td>
- </tr>
- <tr><td> </td><td>use interactive mode</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>exclude names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-m</span>, <span class="option">--message <var><TEXT></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>use text as commit message</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-l</span>, <span class="option">--logfile <var><FILE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>read commit message from file</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-d</span>, <span class="option">--date <var><DATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>record the specified date as commit date</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-u</span>, <span class="option">--user <var><USER></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>record the specified user as committer</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>
- <p>[+] marked option can be specified multiple times</p>
- <blockquote>
- aliases: qci</blockquote>
- </div>
- <div class="section" id="qdelete">
- <h4>qdelete</h4>
- <p>remove patches from queue:</p>
- <pre class="literal-block">
- hg qdelete [-k] [PATCH]...
- </pre>
- <p>The patches must not be applied, and at least one patch is required. Exact
- patch identifiers must be given. 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" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>stop managing a revision (DEPRECATED)</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- <blockquote>
- aliases: qremove qrm</blockquote>
- </div>
- <div class="section" id="qdiff">
- <h4>qdiff</h4>
- <p>diff of the current patch and subsequent modifications:</p>
- <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">
- <kbd><span class="option">--noprefix</span></kbd></td>
- <td>omit a/ and b/ prefixes from filenames</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" colspan="2">
- <kbd><span class="option">-U</span>, <span class="option">--unified <var><NUM></var></span></kbd></td>
- </tr>
- <tr><td> </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">--root <var><DIR></var></span></kbd></td>
- <td>produce diffs relative to subdirectory</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>exclude names matching the given patterns</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- <div class="section" id="qfinish">
- <h4>qfinish</h4>
- <p>move applied patches into repository history:</p>
- <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>
- <p>fold the named patches into the current patch:</p>
- <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>invoke editor on commit messages</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" colspan="2">
- <kbd><span class="option">-m</span>, <span class="option">--message <var><TEXT></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>use text as commit message</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-l</span>, <span class="option">--logfile <var><FILE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>read commit message from file</td></tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="qgoto">
- <h4>qgoto</h4>
- <p>push or pop patches until named patch is at top of stack:</p>
- <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">--keep-changes</span></kbd></td>
- <td>tolerate non-conflicting local changes</td></tr>
- <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>
- <tr><td class="option-group">
- <kbd><span class="option">--no-backup</span></kbd></td>
- <td>do not save backup copies of files</td></tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="qguard">
- <h4>qguard</h4>
- <p>set or print guards for a patch:</p>
- <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>
- <p>print the header of the topmost or specified patch:</p>
- <pre class="literal-block">
- hg qheader [PATCH]
- </pre>
- <p>Returns 0 on success.</p>
- </div>
- <div class="section" id="qimport">
- <h4>qimport</h4>
- <p>import a patch or existing changeset:</p>
- <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 . -n patch will place the current revision
- 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. Use <a class="reference external" href="hg.1.html#qfinish"><tt class="docutils literal">hg qfinish</tt></a> to remove changesets
- from mq control.</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" colspan="2">
- <kbd><span class="option">-n</span>, <span class="option">--name <var><NAME></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </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>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- <div class="section" id="qinit">
- <h4>qinit</h4>
- <p>init a new queue repository (DEPRECATED):</p>
- <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>
- <p>create a new patch:</p>
- <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>invoke editor on commit messages</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" colspan="2">
- <kbd><span class="option">-u</span>, <span class="option">--user <var><USER></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">-d</span>, <span class="option">--date <var><DATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>add "Date: <DATE>" to patch</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>exclude names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-m</span>, <span class="option">--message <var><TEXT></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>use text as commit message</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-l</span>, <span class="option">--logfile <var><FILE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>read commit message from file</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- <div class="section" id="qnext">
- <h4>qnext</h4>
- <p>print the name of the next pushable patch:</p>
- <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>
- <p>pop the current patch off the stack:</p>
- <pre class="literal-block">
- hg qpop [-a] [-f] [PATCH | INDEX]
- </pre>
- <p>Without argument, 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>By default, abort if the working directory contains uncommitted
- changes. With --keep-changes, abort only if the uncommitted files
- overlap with patched files. With -f/--force, backup and discard
- changes made to such files.</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" colspan="2">
- <kbd><span class="option">-n</span>, <span class="option">--name <var><NAME></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>queue name to pop (DEPRECATED)</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--keep-changes</span></kbd></td>
- <td>tolerate non-conflicting local changes</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>
- <tr><td class="option-group">
- <kbd><span class="option">--no-backup</span></kbd></td>
- <td>do not save backup copies of files</td></tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="qprev">
- <h4>qprev</h4>
- <p>print the name of the preceding applied patch:</p>
- <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>
- <p>push the next patch onto the stack:</p>
- <pre class="literal-block">
- hg qpush [-f] [-l] [-a] [--move] [PATCH | INDEX]
- </pre>
- <p>By default, abort if the working directory contains uncommitted
- changes. With --keep-changes, abort only if the uncommitted files
- overlap with patched files. With -f/--force, backup and patch over
- uncommitted changes.</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">--keep-changes</span></kbd></td>
- <td>tolerate non-conflicting local changes</td></tr>
- <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">-e</span>, <span class="option">--exact</span></kbd></td>
- <td>apply the target patch to its recorded parent</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" colspan="2">
- <kbd><span class="option">-n</span>, <span class="option">--name <var><NAME></var></span></kbd></td>
- </tr>
- <tr><td> </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>
- <tr><td class="option-group">
- <kbd><span class="option">--no-backup</span></kbd></td>
- <td>do not save backup copies of files</td></tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="qqueue">
- <h4>qqueue</h4>
- <p>manage multiple patch queues:</p>
- <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)". Specifying --active will print
- only the name of the active queue.</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">--active</span></kbd></td>
- <td>print name of active queue</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>
- <p>update the current patch:</p>
- <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>invoke editor on commit messages</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" colspan="2">
- <kbd><span class="option">-u</span>, <span class="option">--user <var><USER></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">-d</span>, <span class="option">--date <var><DATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>add/update date field in patch with given date</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>exclude names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-m</span>, <span class="option">--message <var><TEXT></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>use text as commit message</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-l</span>, <span class="option">--logfile <var><FILE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>read commit message from file</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- <div class="section" id="qrename">
- <h4>qrename</h4>
- <p>rename a patch:</p>
- <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>
- <p>restore the queue state saved by a revision (DEPRECATED):</p>
- <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>
- <p>save current queue state (DEPRECATED):</p>
- <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" colspan="2">
- <kbd><span class="option">-n</span>, <span class="option">--name <var><NAME></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">-m</span>, <span class="option">--message <var><TEXT></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>use text as commit message</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-l</span>, <span class="option">--logfile <var><FILE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>read commit message from file</td></tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="qselect">
- <h4>qselect</h4>
- <p>set or print guarded patches to push:</p>
- <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>
- <p>print the entire series file:</p>
- <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>
- <p>print the name of the current patch:</p>
- <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>
- <p>print the patches not yet applied:</p>
- <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>
- </div>
- <div class="section" id="notify">
- <h2><a class="toc-backref" href="#id107">notify</a></h2>
- <p>hooks for sending email push notifications</p>
- <p>This extension implements hooks to send email notifications when
- changesets are sent from or received by the local repository.</p>
- <p>First, enable the extension as explained in <a class="reference external" href="hg.1.html#extensions"><tt class="docutils literal">hg help extensions</tt></a>, and
- register the hook you want to run. <tt class="docutils literal">incoming</tt> and <tt class="docutils literal">changegroup</tt> hooks
- are run when changesets are received, while <tt class="docutils literal">outgoing</tt> hooks are for
- changesets sent to another repository:</p>
- <pre class="literal-block">
- [hooks]
- # one email for each incoming changeset
- incoming.notify = python:hgext.notify.hook
- # one email for all incoming changesets
- changegroup.notify = python:hgext.notify.hook
- # one email for all outgoing changesets
- outgoing.notify = python:hgext.notify.hook
- </pre>
- <p>This registers the hooks. To enable notification, subscribers must
- be assigned to repositories. The <tt class="docutils literal">[usersubs]</tt> section maps multiple
- repositories to a given recipient. The <tt class="docutils literal">[reposubs]</tt> section maps
- multiple recipients to a single repository:</p>
- <pre class="literal-block">
- [usersubs]
- # key is subscriber email, value is a comma-separated list of repo patterns
- user@host = pattern
- [reposubs]
- # key is repo pattern, value is a comma-separated list of subscriber emails
- pattern = user@host
- </pre>
- <p>A <tt class="docutils literal">pattern</tt> is a <tt class="docutils literal">glob</tt> matching the absolute path to a repository,
- optionally combined with a revset expression. A revset expression, if
- present, is separated from the glob by a hash. Example:</p>
- <pre class="literal-block">
- [reposubs]
- */widgets#branch(release) = qa-team@example.com
- </pre>
- <p>This sends to <tt class="docutils literal"><span class="pre">qa-team@example.com</span></tt> whenever a changeset on the <tt class="docutils literal">release</tt>
- branch triggers a notification in any repository ending in <tt class="docutils literal">widgets</tt>.</p>
- <p>In order to place them under direct user management, <tt class="docutils literal">[usersubs]</tt> and
- <tt class="docutils literal">[reposubs]</tt> sections may be placed in a separate <tt class="docutils literal">hgrc</tt> file and
- incorporated by reference:</p>
- <pre class="literal-block">
- [notify]
- config = /path/to/subscriptionsfile
- </pre>
- <p>Notifications will not be sent until the <tt class="docutils literal">notify.test</tt> value is set
- to <tt class="docutils literal">False</tt>; see below.</p>
- <p>Notifications content can be tweaked with the following configuration entries:</p>
- <dl class="docutils">
- <dt>notify.test</dt>
- <dd>If <tt class="docutils literal">True</tt>, print messages to stdout instead of sending them. Default: True.</dd>
- <dt>notify.sources</dt>
- <dd><p class="first">Space-separated list of change sources. Notifications are activated only
- when a changeset's source is in this list. Sources may be:</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">serve</tt>:</th><td class="field-body">changesets received via http or ssh</td>
- </tr>
- <tr class="field"><th class="field-name"><tt class="docutils literal">pull</tt>:</th><td class="field-body">changesets received via <tt class="docutils literal">hg pull</tt></td>
- </tr>
- <tr class="field"><th class="field-name"><tt class="docutils literal">unbundle</tt>:</th><td class="field-body">changesets received via <tt class="docutils literal">hg unbundle</tt></td>
- </tr>
- <tr class="field"><th class="field-name"><tt class="docutils literal">push</tt>:</th><td class="field-body">changesets sent or received via <tt class="docutils literal">hg push</tt></td>
- </tr>
- <tr class="field"><th class="field-name"><tt class="docutils literal">bundle</tt>:</th><td class="field-body">changesets sent via <tt class="docutils literal">hg unbundle</tt></td>
- </tr>
- </tbody>
- </table>
- <p class="last">Default: serve.</p>
- </dd>
- <dt>notify.strip</dt>
- <dd>Number of leading slashes to strip from url paths. By default, notifications
- reference repositories with their absolute path. <tt class="docutils literal">notify.strip</tt> lets you
- turn them into relative paths. For example, <tt class="docutils literal">notify.strip=3</tt> will change
- <tt class="docutils literal">/long/path/repository</tt> into <tt class="docutils literal">repository</tt>. Default: 0.</dd>
- <dt>notify.domain</dt>
- <dd>Default email domain for sender or recipients with no explicit domain.</dd>
- <dt>notify.style</dt>
- <dd>Style file to use when formatting emails.</dd>
- <dt>notify.template</dt>
- <dd>Template to use when formatting emails.</dd>
- <dt>notify.incoming</dt>
- <dd>Template to use when run as an incoming hook, overriding <tt class="docutils literal">notify.template</tt>.</dd>
- <dt>notify.outgoing</dt>
- <dd>Template to use when run as an outgoing hook, overriding <tt class="docutils literal">notify.template</tt>.</dd>
- <dt>notify.changegroup</dt>
- <dd>Template to use when running as a changegroup hook, overriding
- <tt class="docutils literal">notify.template</tt>.</dd>
- <dt>notify.maxdiff</dt>
- <dd>Maximum number of diff lines to include in notification email. Set to 0
- to disable the diff, or -1 to include all of it. Default: 300.</dd>
- <dt>notify.maxsubject</dt>
- <dd>Maximum number of characters in email's subject line. Default: 67.</dd>
- <dt>notify.diffstat</dt>
- <dd>Set to True to include a diffstat before diff content. Default: True.</dd>
- <dt>notify.merge</dt>
- <dd>If True, send notifications for merge changesets. Default: True.</dd>
- <dt>notify.mbox</dt>
- <dd>If set, append mails to this mbox file instead of sending. Default: None.</dd>
- <dt>notify.fromauthor</dt>
- <dd>If set, use the committer of the first changeset in a changegroup for
- the "From" field of the notification mail. If not set, take the user
- from the pushing repo. Default: False.</dd>
- </dl>
- <p>If set, the following entries will also be used to customize the
- notifications:</p>
- <dl class="docutils">
- <dt>email.from</dt>
- <dd>Email <tt class="docutils literal">From</tt> address to use if none can be found in the generated
- email content.</dd>
- <dt>web.baseurl</dt>
- <dd>Root repository URL to combine with repository paths when making
- references. See also <tt class="docutils literal">notify.strip</tt>.</dd>
- </dl>
- </div>
- <div class="section" id="pager">
- <h2><a class="toc-backref" href="#id108">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 -FRX
- </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>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>Lastly, you can enable and disable paging for individual commands with
- the attend-<command> option. This setting takes precedence over
- existing attend and ignore options and defaults:</p>
- <pre class="literal-block">
- [pager]
- attend-cat = false
- </pre>
- <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="patchbomb">
- <h2><a class="toc-backref" href="#id109">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
- configuration 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>
- <p>You can control the default inclusion of an introduction message with the
- <tt class="docutils literal">patchbomb.intro</tt> configuration option. The configuration is always
- overwritten by command line flags like --intro and --desc:</p>
- <pre class="literal-block">
- [patchbomb]
- intro=auto # include introduction message if more than 1 patch (default)
- intro=never # never include an introduction message
- intro=always # always include an introduction message
- </pre>
- <p>You can set patchbomb to always ask for confirmation by setting
- <tt class="docutils literal">patchbomb.confirm</tt> to true.</p>
- <div class="section" id="id37">
- <h3>Commands</h3>
- <div class="section" id="email">
- <h4>email</h4>
- <p>send changesets by email:</p>
- <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 --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. You can include a patch both as text in the email
- body and as a regular or an inline attachment by combining the
- -a/--attach or -i/--inline with the --body option.</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>In case email sending fails, you will find a backup of your series
- introductory message in <tt class="docutils literal"><span class="pre">.hg/last-email.txt</span></tt>.</p>
- <p>The default behavior of this command can be customized through
- configuration. (See <a class="reference external" href="hg.1.html#patchbomb"><tt class="docutils literal">hg help patchbomb</tt></a> for details)</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" colspan="2">
- <kbd><span class="option">--bundlename <var><NAME></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>name of the bundle attachment file (default: bundle)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">--base <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </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">--body</span></kbd></td>
- <td>send patches as inline message text (default)</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" colspan="2">
- <kbd><span class="option">--bcc <var><VALUE[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>email addresses of blind carbon copy recipients</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-c</span>, <span class="option">--cc <var><VALUE[+]></var></span></kbd></td>
- </tr>
- <tr><td> </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 <var><VALUE></var></span></kbd></td>
- <td>use the given date as the sending date</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--desc <var><VALUE></var></span></kbd></td>
- <td>use the given file as the series description</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-f</span>, <span class="option">--from <var><VALUE></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">-m</span>, <span class="option">--mbox <var><VALUE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>write messages to mbox file instead of sending them</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--reply-to <var><VALUE[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>email addresses replies should be sent to</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-s</span>, <span class="option">--subject <var><VALUE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>subject of first message (intro or single patch)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--in-reply-to <var><VALUE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>message identifier to reply to</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--flag <var><VALUE[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>flags to add in subject prefixes</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-t</span>, <span class="option">--to <var><VALUE[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>email addresses of recipients</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-e</span>, <span class="option">--ssh <var><CMD></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify ssh command to use</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">--remotecmd <var><CMD></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify hg command to run on the remote side</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--insecure</span></kbd></td>
- <td>do not verify server certificate (ignoring web.cacerts config)</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- </div>
- </div>
- <div class="section" id="progress">
- <h2><a class="toc-backref" href="#id110">progress</a></h2>
- <p>show progress bars for some actions (DEPRECATED)</p>
- <p>This extension has been merged into core, you can remove it from your config.
- See hg help config.progress for configuration options.</p>
- </div>
- <div class="section" id="purge">
- <h2><a class="toc-backref" href="#id111">purge</a></h2>
- <p>command to delete untracked files from the working directory</p>
- <div class="section" id="id38">
- <h3>Commands</h3>
- <div class="section" id="id39">
- <h4>purge</h4>
- <p>removes files not tracked by Mercurial:</p>
- <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 the following by default:</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>The --files and --dirs options can be used to direct purge to delete
- only files, only directories, or both. If neither option is given,
- both will be deleted.</p>
- <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">--dirs</span></kbd></td>
- <td>purge empty directories</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--files</span></kbd></td>
- <td>purge files</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" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>exclude names matching the given patterns</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- <blockquote>
- aliases: clean</blockquote>
- </div>
- </div>
- </div>
- <div class="section" id="rebase">
- <h2><a class="toc-backref" href="#id112">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="id40">
- <h3>Commands</h3>
- <div class="section" id="id41">
- <h4>rebase</h4>
- <p>move changeset (and descendants) to a different branch:</p>
- <pre class="literal-block">
- hg rebase [-s REV | -b REV] [-d REV] [OPTION]
- </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>In its default configuration, Mercurial will prevent you from
- rebasing published changes. See <a class="reference external" href="hg.1.html#phases"><tt class="docutils literal">hg help phases</tt></a> for details.</p>
- <p>If you don't specify a destination changeset (<tt class="docutils literal"><span class="pre">-d/--dest</span></tt>),
- rebase uses the current branch tip 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>For advanced usage, a third way is available through the <tt class="docutils literal"><span class="pre">--rev</span></tt>
- option. It allows you to specify an arbitrary set of changesets to
- rebase. Descendants of revs you specify with this option are not
- automatically included in the rebase.</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 branch tip 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>
- <div class="verbose container">
- <p>Examples:</p>
- <ul>
- <li><p class="first">move "local changes" (current commit back to branching point)
- to the current branch tip after a pull:</p>
- <pre class="literal-block">
- hg rebase
- </pre>
- </li>
- <li><p class="first">move a single changeset to the stable branch:</p>
- <pre class="literal-block">
- hg rebase -r 5f493448 -d stable
- </pre>
- </li>
- <li><p class="first">splice a commit and all its descendants onto another part of history:</p>
- <pre class="literal-block">
- hg rebase --source c0c3 --dest 4cf9
- </pre>
- </li>
- <li><p class="first">rebase everything on a branch marked by a bookmark onto the
- default branch:</p>
- <pre class="literal-block">
- hg rebase --base myfeature --dest default
- </pre>
- </li>
- <li><p class="first">collapse a sequence of changes into a single commit:</p>
- <pre class="literal-block">
- hg rebase --collapse -r 1520:1525 -d .
- </pre>
- </li>
- <li><p class="first">move a named branch while preserving its name:</p>
- <pre class="literal-block">
- hg rebase -r "branch(featureX)" -d 1.3 --keepbranches
- </pre>
- </li>
- </ul>
- </div>
- <p>Returns 0 on success, 1 if nothing to rebase or there are
- unresolved conflicts.</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">--source <var><REV></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>rebase the specified changeset and descendants</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-b</span>, <span class="option">--base <var><REV></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>rebase everything from branching point of specified changeset</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>rebase these revisions</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-d</span>, <span class="option">--dest <var><REV></var></span></kbd></td>
- </tr>
- <tr><td> </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" colspan="2">
- <kbd><span class="option">-m</span>, <span class="option">--message <var><TEXT></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>use text as collapse commit message</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td>
- <td>invoke editor on commit messages</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-l</span>, <span class="option">--logfile <var><FILE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>read collapse commit message from file</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-k</span>, <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">-D</span>, <span class="option">--detach</span></kbd></td>
- <td>(DEPRECATED)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-i</span>, <span class="option">--interactive</span></kbd></td>
- </tr>
- <tr><td> </td><td>(DEPRECATED)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-t</span>, <span class="option">--tool <var><VALUE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>specify merge tool</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" colspan="2">
- <kbd><span class="option">--style <var><STYLE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>display using template map file (DEPRECATED)</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-T</span>, <span class="option">--template <var><TEMPLATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>display with template</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- </div>
- </div>
- <div class="section" id="record">
- <h2><a class="toc-backref" href="#id113">record</a></h2>
- <p>commands to interactively select changes for commit/qrefresh</p>
- <div class="section" id="id42">
- <h3>Commands</h3>
- <div class="section" id="qrecord">
- <h4>qrecord</h4>
- <p>interactively record a new patch:</p>
- <pre class="literal-block">
- hg qrecord [OPTION]... PATCH [FILE]...
- </pre>
- <p>See <a class="reference external" href="hg.1.html#qnew"><tt class="docutils literal">hg help qnew</tt></a> & <a class="reference external" href="hg.1.html#record"><tt class="docutils literal">hg help record</tt></a> for more information and
- usage.</p>
- </div>
- <div class="section" id="id43">
- <h4>record</h4>
- <p>interactively select changes to commit:</p>
- <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
- e - edit this change manually
- 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 head as closed</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--amend</span></kbd></td>
- <td>amend the parent of the working directory</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-s</span>, <span class="option">--secret</span></kbd></td>
- <td>use the secret phase for committing</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td>
- <td>invoke editor on commit messages</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>exclude names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-m</span>, <span class="option">--message <var><TEXT></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>use text as commit message</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-l</span>, <span class="option">--logfile <var><FILE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>read commit message from file</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-d</span>, <span class="option">--date <var><DATE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>record the specified date as commit date</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-u</span>, <span class="option">--user <var><USER></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>record the specified user as committer</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" 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>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- </div>
- </div>
- <div class="section" id="relink">
- <h2><a class="toc-backref" href="#id114">relink</a></h2>
- <p>recreates hardlinks between repository clones</p>
- <div class="section" id="id44">
- <h3>Commands</h3>
- <div class="section" id="id45">
- <h4>relink</h4>
- <p>recreate hardlinks between two repositories:</p>
- <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="#id115">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="#id116">share</a></h2>
- <p>share a common history between several working directories</p>
- <div class="section" id="automatic-pooled-storage-for-clones">
- <h3>Automatic Pooled Storage for Clones</h3>
- <p>When this extension is active, <a class="reference external" href="hg.1.html#clone"><tt class="docutils literal">hg clone</tt></a> can be configured to
- automatically share/pool storage across multiple clones. This
- mode effectively converts <a class="reference external" href="hg.1.html#clone"><tt class="docutils literal">hg clone</tt></a> to <a class="reference external" href="hg.1.html#clone"><tt class="docutils literal">hg clone</tt></a> + <a class="reference external" href="hg.1.html#share"><tt class="docutils literal">hg share</tt></a>.
- The benefit of using this mode is the automatic management of
- store paths and intelligent pooling of related repositories.</p>
- <p>The following <tt class="docutils literal">share.</tt> config options influence this feature:</p>
- <dl class="docutils">
- <dt><tt class="docutils literal">share.pool</tt></dt>
- <dd>Filesystem path where shared repository data will be stored. When
- defined, <a class="reference external" href="hg.1.html#clone"><tt class="docutils literal">hg clone</tt></a> will automatically use shared repository
- storage instead of creating a store inside each clone.</dd>
- <dt><tt class="docutils literal">share.poolnaming</tt></dt>
- <dd><p class="first">How directory names in <tt class="docutils literal">share.pool</tt> are constructed.</p>
- <p>"identity" means the name is derived from the first changeset in the
- repository. In this mode, different remotes share storage if their
- root/initial changeset is identical. In this mode, the local shared
- repository is an aggregate of all encountered remote repositories.</p>
- <p>"remote" means the name is derived from the source repository's
- path or URL. In this mode, storage is only shared if the path or URL
- requested in the <a class="reference external" href="hg.1.html#clone"><tt class="docutils literal">hg clone</tt></a> command matches exactly to a repository
- that was cloned before.</p>
- <p class="last">The default naming mode is "identity."</p>
- </dd>
- </dl>
- </div>
- <div class="section" id="id46">
- <h3>Commands</h3>
- <div class="section" id="id47">
- <h4>share</h4>
- <p>create a new shared repository:</p>
- <pre class="literal-block">
- hg share [-U] [-B] SOURCE [DEST]
- </pre>
- <p>Initialize a new repository and working directory that shares its
- history (and optionally bookmarks) 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.</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 directory</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-B</span>, <span class="option">--bookmarks</span></kbd></td>
- </tr>
- <tr><td> </td><td>also share bookmarks</td></tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="unshare">
- <h4>unshare</h4>
- <p>convert a shared repository to a normal one:</p>
- <pre class="literal-block">
- hg unshare
- </pre>
- <p>Copy the store data to the repo and remove the sharedpath data.</p>
- </div>
- </div>
- </div>
- <div class="section" id="shelve">
- <h2><a class="toc-backref" href="#id117">shelve</a></h2>
- <p>save and restore changes to the working directory</p>
- <p>The "hg shelve" command saves changes made to the working directory
- and reverts those changes, resetting the working directory to a clean
- state.</p>
- <p>Later on, the "hg unshelve" command restores the changes saved by "hg
- shelve". Changes can be restored even after updating to a different
- parent, in which case Mercurial's merge machinery will resolve any
- conflicts if necessary.</p>
- <p>You can have more than one shelved change outstanding at a time; each
- shelved change has a distinct name. For details, see the help for "hg
- shelve".</p>
- <div class="section" id="id48">
- <h3>Commands</h3>
- <div class="section" id="id49">
- <h4>shelve</h4>
- <p>save and set aside changes from the working directory:</p>
- <pre class="literal-block">
- hg shelve [OPTION]... [FILE]...
- </pre>
- <p>Shelving takes files that "hg status" reports as not clean, saves
- the modifications to a bundle (a shelved change), and reverts the
- files so that their state in the working directory becomes clean.</p>
- <p>To restore these changes to the working directory, using "hg
- unshelve"; this will work even if you switch to a different
- commit.</p>
- <p>When no files are specified, "hg shelve" saves all not-clean
- files. If specific files or directories are named, only changes to
- those files are shelved.</p>
- <p>Each shelved change has a name that makes it easier to find later.
- The name of a shelved change defaults to being based on the active
- bookmark, or if there is no active bookmark, the current named
- branch. To specify a different name, use <tt class="docutils literal"><span class="pre">--name</span></tt>.</p>
- <p>To see a list of existing shelved changes, use the <tt class="docutils literal"><span class="pre">--list</span></tt>
- option. For each shelved change, this will print its name, age,
- and description; use <tt class="docutils literal"><span class="pre">--patch</span></tt> or <tt class="docutils literal"><span class="pre">--stat</span></tt> for more details.</p>
- <p>To delete specific shelved changes, use <tt class="docutils literal"><span class="pre">--delete</span></tt>. To delete
- all shelved changes, use <tt class="docutils literal"><span class="pre">--cleanup</span></tt>.</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 shelving</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--cleanup</span></kbd></td>
- <td>delete all shelved changes</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--date <var><DATE></var></span></kbd></td>
- <td>shelve with the specified commit date</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-d</span>, <span class="option">--delete</span></kbd></td>
- <td>delete the named shelved change(s)</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td>
- <td>invoke editor on commit messages</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-l</span>, <span class="option">--list</span></kbd></td>
- <td>list current shelves</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-m</span>, <span class="option">--message <var><TEXT></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>use text as shelve message</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-n</span>, <span class="option">--name <var><NAME></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>use the given name for the shelved commit</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" colspan="2">
- <kbd><span class="option">-i</span>, <span class="option">--interactive</span></kbd></td>
- </tr>
- <tr><td> </td><td>interactive mode, only works while creating a shelve</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" colspan="2">
- <kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>include names matching the given patterns</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>exclude names matching the given patterns</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- <div class="section" id="unshelve">
- <h4>unshelve</h4>
- <p>restore a shelved change to the working directory:</p>
- <pre class="literal-block">
- hg unshelve [SHELVED]
- </pre>
- <p>This command accepts an optional name of a shelved change to
- restore. If none is given, the most recent shelved change is used.</p>
- <p>If a shelved change is applied successfully, the bundle that
- contains the shelved changes is moved to a backup location
- (.hg/shelve-backup).</p>
- <p>Since you can restore a shelved change on top of an arbitrary
- commit, it is possible that unshelving will result in a conflict
- between your changes and the commits you are unshelving onto. If
- this occurs, you must resolve the conflict, then use
- <tt class="docutils literal"><span class="pre">--continue</span></tt> to complete the unshelve operation. (The bundle
- will not be moved until you successfully complete the unshelve.)</p>
- <p>(Alternatively, you can use <tt class="docutils literal"><span class="pre">--abort</span></tt> to abandon an unshelve
- that causes a conflict. This reverts the unshelved changes, and
- leaves the bundle in place.)</p>
- <p>After a successful unshelve, the shelved changes are stored in a
- backup directory. Only the N most recent backups are kept. N
- defaults to 10 but can be overridden using the <tt class="docutils literal">shelve.maxbackups</tt>
- configuration option.</p>
- <div class="verbose container">
- Timestamp in seconds is used to decide order of backups. More
- than <tt class="docutils literal">maxbackups</tt> backups are kept, if same timestamp
- prevents from deciding exact order of them, for safety.</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">-a</span>, <span class="option">--abort</span></kbd></td>
- <td>abort an incomplete unshelve operation</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-c</span>, <span class="option">--continue</span></kbd></td>
- <td>continue an incomplete unshelve operation</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--keep</span></kbd></td>
- <td>keep shelve after unshelving</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--date <var><DATE></var></span></kbd></td>
- <td>set date for temporary commits (DEPRECATED)</td></tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <div class="section" id="strip">
- <h2><a class="toc-backref" href="#id118">strip</a></h2>
- <p>strip changesets and their descendants from history</p>
- <p>This extension allows you to strip changesets and all their descendants from the
- repository. See the command help for details.</p>
- <div class="section" id="id50">
- <h3>Commands</h3>
- <div class="section" id="id51">
- <h4>strip</h4>
- <p>strip changesets and all their descendants from the repository:</p>
- <pre class="literal-block">
- hg strip [-k] [-f] [-n] [-B bookmark] [-r] 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, in which
- case changes will be discarded.</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>Strip is not a history-rewriting operation and can be used on
- changesets in the public phase. But if the stripped changesets have
- been pushed to a remote repository you will likely pull them again.</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" colspan="2">
- <kbd><span class="option">-r</span>, <span class="option">--rev <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>strip specified revision (optional, can specify revisions without this option)</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
- <td>force removal of changesets, discard uncommitted changes (no backup)</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--no-backup</span></kbd></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">-n</span></kbd></td>
- <td>ignored (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 directory during strip</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-B</span>, <span class="option">--bookmark <var><VALUE></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>remove revs only reachable from given bookmark</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- </div>
- </div>
- <div class="section" id="transplant">
- <h2><a class="toc-backref" href="#id119">transplant</a></h2>
- <p>command to transplant changesets from another branch</p>
- <p>This extension allows you to transplant changes to another parent revision,
- possibly in another repository. The transplant is done using 'diff' patches.</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="id52">
- <h3>Commands</h3>
- <div class="section" id="id53">
- <h4>transplant</h4>
- <p>transplant changesets from another branch:</p>
- <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. The changesets
- are copied and will thus appear twice in the history with different
- identities.</p>
- <p>Consider using the graft command if everything is inside the same
- repository - it will use merges and will usually give a better result.
- Use the rebase extension if the changesets are unpublished and you want
- to move them instead of copying them.</p>
- <p>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>--source/-s specifies another repository to use for selecting changesets,
- just as if it temporarily had been pulled.
- If --branch/-b is specified, these revisions will be used as
- heads when deciding which changesets to transplant, just as if only
- these revisions had been pulled.
- If --all/-a is specified, all the revisions up to the heads specified
- with --branch will be transplanted.</p>
- <p>Example:</p>
- <ul>
- <li><p class="first">transplant all changes up to REV on top of your current revision:</p>
- <pre class="literal-block">
- hg transplant --branch REV --all
- </pre>
- </li>
- </ul>
- <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>Merge changesets may be transplanted directly by specifying the
- proper parent changeset by calling <a class="reference external" href="hg.1.html#transplant"><tt class="docutils literal">hg transplant <span class="pre">--parent</span></tt></a>.</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" colspan="2">
- <kbd><span class="option">-s</span>, <span class="option">--source <var><REPO></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>transplant changesets from REPO</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-b</span>, <span class="option">--branch <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>use this source changeset as head</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 the --branch revisions</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-p</span>, <span class="option">--prune <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>skip over REV</td></tr>
- <tr><td class="option-group" colspan="2">
- <kbd><span class="option">-m</span>, <span class="option">--merge <var><REV[+]></var></span></kbd></td>
- </tr>
- <tr><td> </td><td>merge at REV</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--parent <var><REV></var></span></kbd></td>
- <td>parent to choose when transplanting merge</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td>
- <td>invoke editor on commit messages</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 fixing conflicts</td></tr>
- <tr><td class="option-group">
- <kbd><span class="option">--filter <var><CMD></var></span></kbd></td>
- <td>filter changesets through command</td></tr>
- </tbody>
- </table>
- <p>[+] marked option can be specified multiple times</p>
- </div>
- </div>
- </div>
- <div class="section" id="win32mbcs">
- <h2><a class="toc-backref" href="#id120">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 extension.</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="#id121">win32text</a></h2>
- <p>perform automatic newline conversion (DEPRECATED)</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="#id122">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="id54">
- <h1><a class="toc-backref" href="#contents">Files</a></h1>
- <dl class="docutils">
- <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>
- <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">.hgsub</tt></dt>
- <dd>This file defines the locations of all subrepositories, and
- tells where the subrepository checkouts came from. For details, see
- <a class="reference external" href="hg.1.html#subrepos"><tt class="docutils literal">hg help subrepos</tt></a>.</dd>
- <dt><tt class="docutils literal">.hgsubstate</tt></dt>
- <dd>This file is where Mercurial stores all nested repository states. <em>NB: This
- file should not be edited manually.</em></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. The file content is encoded using UTF-8.</dd>
- <dt><tt class="docutils literal"><span class="pre">.hg/last-message.txt</span></tt></dt>
- <dd>This file is used by <a class="reference external" href="hg.1.html#commit"><tt class="docutils literal">hg commit</tt></a> to store a backup of the commit message
- in case the commit fails.</dd>
- <dt><tt class="docutils literal">.hg/localtags</tt></dt>
- <dd>This file can be used to define local tags which are not shared among
- repositories. The file format is the same as for <tt class="docutils literal">.hgtags</tt>, but it is
- encoded using the local system encoding.</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-2015 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>
- <span class="target" id="common"></span><!-- Common link and substitution definitions. -->
- </div>
- </div>
- </body>
- </html>
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 15913 | Doug_Napoleone | Initial checkin of the latest stabel mercurial to then integrate the changes from //guest/...sven_erik_knop/mercurial on top of (preserving the new HG code). The purpose is to get it working with the latest version of HG. « |
10 years ago |