diff options
author | Lorry <lorry@roadtrain.codethink.co.uk> | 2012-08-22 14:49:51 +0100 |
---|---|---|
committer | Lorry <lorry@roadtrain.codethink.co.uk> | 2012-08-22 14:49:51 +0100 |
commit | a498da43c7fdb9f24b73680c02a4a3588cc62d9a (patch) | |
tree | daf8119dae1749b5165b68033a1b23a7375ce9ce /doc | |
download | mercurial-tarball-a498da43c7fdb9f24b73680c02a4a3588cc62d9a.tar.gz |
Tarball conversion
Diffstat (limited to 'doc')
-rw-r--r-- | doc/Makefile | 55 | ||||
-rw-r--r-- | doc/README | 11 | ||||
-rw-r--r-- | doc/common.txt | 8 | ||||
-rw-r--r-- | doc/gendoc.py | 168 | ||||
-rw-r--r-- | doc/hg.1 | 11408 | ||||
-rw-r--r-- | doc/hg.1.html | 8975 | ||||
-rw-r--r-- | doc/hg.1.txt | 119 | ||||
-rw-r--r-- | doc/hgignore.5 | 151 | ||||
-rw-r--r-- | doc/hgignore.5.html | 129 | ||||
-rw-r--r-- | doc/hgignore.5.txt | 34 | ||||
-rw-r--r-- | doc/hgmanpage.py | 1110 | ||||
-rw-r--r-- | doc/hgrc.5 | 1793 | ||||
-rw-r--r-- | doc/hgrc.5.html | 1366 | ||||
-rw-r--r-- | doc/hgrc.5.txt | 41 | ||||
-rwxr-xr-x | doc/runrst | 49 | ||||
-rw-r--r-- | doc/style.css | 309 |
16 files changed, 25726 insertions, 0 deletions
diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000..fbf7a1f --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,55 @@ +SOURCES=$(wildcard *.[0-9].txt) +MAN=$(SOURCES:%.txt=%) +HTML=$(SOURCES:%.txt=%.html) +GENDOC=gendoc.py ../mercurial/commands.py ../mercurial/help.py \ + ../mercurial/help/*.txt ../hgext/*.py ../hgext/*/__init__.py +PREFIX=/usr/local +MANDIR=$(PREFIX)/share/man +INSTALL=install -c -m 644 +PYTHON=python +RSTARGS= + +export LANGUAGE=C +export LC_ALL=C + +all: man html + +man: $(MAN) + +html: $(HTML) + +hg.1.txt: hg.1.gendoc.txt + touch hg.1.txt + +hg.1.gendoc.txt: $(GENDOC) + ${PYTHON} gendoc.py > $@.tmp + mv $@.tmp $@ + +hgrc.5: ../mercurial/help/config.txt + +hgrc.5.html: ../mercurial/help/config.txt + +%: %.txt common.txt + $(PYTHON) runrst hgmanpage $(RSTARGS) --halt warning \ + --strip-elements-with-class htmlonly $*.txt $* + +%.html: %.txt common.txt + $(PYTHON) runrst html $(RSTARGS) --halt warning \ + --link-stylesheet --stylesheet-path style.css $*.txt $*.html + +MANIFEST: man html +# tracked files are already in the main MANIFEST + $(RM) $@ + for i in $(MAN) $(HTML); do \ + echo "doc/$$i" >> $@ ; \ + done + +install: man + for i in $(MAN) ; do \ + subdir=`echo $$i | sed -n 's/^.*\.\([0-9]\)$$/man\1/p'` ; \ + mkdir -p $(DESTDIR)$(MANDIR)/$$subdir ; \ + $(INSTALL) $$i $(DESTDIR)$(MANDIR)/$$subdir ; \ + done + +clean: + $(RM) $(MAN) $(HTML) hg.1.gendoc.txt MANIFEST diff --git a/doc/README b/doc/README new file mode 100644 index 0000000..d7ff31b --- /dev/null +++ b/doc/README @@ -0,0 +1,11 @@ +Mercurial's documentation is kept in reStructuredText format, which is +a simple plain text format that's easy to read and edit: + + http://docutils.sourceforge.net/rst.html + +It's also convertible to a variety of other formats including standard +UNIX man page format and HTML. You'll need to install Docutils: + + http://docutils.sourceforge.net/ + +Use the Makefile in this directory to generate the man and HTML pages. diff --git a/doc/common.txt b/doc/common.txt new file mode 100644 index 0000000..936fc20 --- /dev/null +++ b/doc/common.txt @@ -0,0 +1,8 @@ +.. Common link and substitution definitions. + +.. |hg(1)| replace:: **hg**\ (1) +.. _hg(1): hg.1.html +.. |hgrc(5)| replace:: **hgrc**\ (5) +.. _hgrc(5): hgrc.5.html +.. |hgignore(5)| replace:: **hgignore**\ (5) +.. _hgignore(5): hgignore.5.html diff --git a/doc/gendoc.py b/doc/gendoc.py new file mode 100644 index 0000000..ab8e9b6 --- /dev/null +++ b/doc/gendoc.py @@ -0,0 +1,168 @@ +import os, sys, textwrap +# import from the live mercurial repo +sys.path.insert(0, "..") +# fall back to pure modules if required C extensions are not available +sys.path.append(os.path.join('..', 'mercurial', 'pure')) +from mercurial import demandimport; demandimport.enable() +from mercurial import encoding +from mercurial.commands import table, globalopts +from mercurial.i18n import _ +from mercurial.help import helptable +from mercurial import extensions +from mercurial import util + +def get_desc(docstr): + if not docstr: + return "", "" + # sanitize + docstr = docstr.strip("\n") + docstr = docstr.rstrip() + shortdesc = docstr.splitlines()[0].strip() + + i = docstr.find("\n") + if i != -1: + desc = docstr[i + 2:] + else: + desc = shortdesc + + desc = textwrap.dedent(desc) + + return (shortdesc, desc) + +def get_opts(opts): + for opt in opts: + if len(opt) == 5: + shortopt, longopt, default, desc, optlabel = opt + else: + shortopt, longopt, default, desc = opt + allopts = [] + if shortopt: + allopts.append("-%s" % shortopt) + if longopt: + allopts.append("--%s" % longopt) + desc += default and _(" (default: %s)") % default or "" + yield (", ".join(allopts), desc) + +def get_cmd(cmd, cmdtable): + d = {} + attr = cmdtable[cmd] + cmds = cmd.lstrip("^").split("|") + + d['cmd'] = cmds[0] + d['aliases'] = cmd.split("|")[1:] + d['desc'] = get_desc(attr[0].__doc__) + d['opts'] = list(get_opts(attr[1])) + + s = 'hg ' + cmds[0] + if len(attr) > 2: + if not attr[2].startswith('hg'): + s += ' ' + attr[2] + else: + s = attr[2] + d['synopsis'] = s.strip() + + return d + +def section(ui, s): + ui.write("%s\n%s\n\n" % (s, "\"" * encoding.colwidth(s))) + +def subsection(ui, s): + ui.write("%s\n%s\n\n" % (s, '=' * encoding.colwidth(s))) + +def subsubsection(ui, s): + ui.write("%s\n%s\n\n" % (s, "-" * encoding.colwidth(s))) + +def subsubsubsection(ui, s): + ui.write("%s\n%s\n\n" % (s, "." * encoding.colwidth(s))) + + +def show_doc(ui): + # print options + section(ui, _("Options")) + for optstr, desc in get_opts(globalopts): + ui.write("%s\n %s\n\n" % (optstr, desc)) + + # print cmds + section(ui, _("Commands")) + commandprinter(ui, table, subsection) + + # print topics + for names, sec, doc in helptable: + if names[0] == "config": + # The config help topic is included in the hgrc.5 man + # page. + continue + for name in names: + ui.write(".. _%s:\n" % name) + ui.write("\n") + section(ui, sec) + if util.safehasattr(doc, '__call__'): + doc = doc() + ui.write(doc) + ui.write("\n") + + section(ui, _("Extensions")) + ui.write(_("This section contains help for extensions that are " + "distributed together with Mercurial. Help for other " + "extensions is available in the help system.")) + ui.write("\n\n" + ".. contents::\n" + " :class: htmlonly\n" + " :local:\n" + " :depth: 1\n\n") + + for extensionname in sorted(allextensionnames()): + mod = extensions.load(None, extensionname, None) + subsection(ui, extensionname) + ui.write("%s\n\n" % mod.__doc__) + cmdtable = getattr(mod, 'cmdtable', None) + if cmdtable: + subsubsection(ui, _('Commands')) + commandprinter(ui, cmdtable, subsubsubsection) + +def commandprinter(ui, cmdtable, sectionfunc): + h = {} + for c, attr in cmdtable.items(): + f = c.split("|")[0] + f = f.lstrip("^") + h[f] = c + cmds = h.keys() + cmds.sort() + + for f in cmds: + if f.startswith("debug"): + continue + d = get_cmd(h[f], cmdtable) + sectionfunc(ui, d['cmd']) + # synopsis + ui.write("::\n\n") + synopsislines = d['synopsis'].splitlines() + for line in synopsislines: + # some commands (such as rebase) have a multi-line + # synopsis + ui.write(" %s\n" % line) + ui.write('\n') + # description + ui.write("%s\n\n" % d['desc'][1]) + # options + opt_output = list(d['opts']) + if opt_output: + opts_len = max([len(line[0]) for line in opt_output]) + ui.write(_("Options:\n\n")) + for optstr, desc in opt_output: + if desc: + s = "%-*s %s" % (opts_len, optstr, desc) + else: + s = optstr + ui.write("%s\n" % s) + ui.write("\n") + # aliases + if d['aliases']: + ui.write(_(" aliases: %s\n\n") % " ".join(d['aliases'])) + + +def allextensionnames(): + return extensions.enabled().keys() + extensions.disabled().keys() + +if __name__ == "__main__": + show_doc(sys.stdout) diff --git a/doc/hg.1 b/doc/hg.1 new file mode 100644 index 0000000..fe7865d --- /dev/null +++ b/doc/hg.1 @@ -0,0 +1,11408 @@ +.\" Man page generated from reStructeredText. +. +.TH HG 1 "" "" "Mercurial Manual" +.SH NAME +hg \- Mercurial source code management system +. +.nr rst2man-indent-level 0 +. +.de1 rstReportMargin +\\$1 \\n[an-margin] +level \\n[rst2man-indent-level] +level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] +- +\\n[rst2man-indent0] +\\n[rst2man-indent1] +\\n[rst2man-indent2] +.. +.de1 INDENT +.\" .rstReportMargin pre: +. RS \\$1 +. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] +. nr rst2man-indent-level +1 +.\" .rstReportMargin post: +.. +.de UNINDENT +. RE +.\" indent \\n[an-margin] +.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] +.nr rst2man-indent-level -1 +.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] +.in \\n[rst2man-indent\\n[rst2man-indent-level]]u +.. +.SH SYNOPSIS +.sp +\fBhg\fP \fIcommand\fP [\fIoption\fP]... [\fIargument\fP]... +.SH DESCRIPTION +.sp +The \fBhg\fP command provides a command line interface to the Mercurial +system. +.SH COMMAND ELEMENTS +.INDENT 0.0 +.TP +.B files... +. +indicates one or more filename or relative path filenames; see +\%File Name Patterns\: for information on pattern matching +.TP +.B path +. +indicates a path on the local machine +.TP +.B revision +. +indicates a changeset which can be specified as a changeset +revision number, a tag, or a unique substring of the changeset +hash value +.TP +.B repository path +. +either the pathname of a local repository or the URI of a remote +repository. +.UNINDENT +.SH OPTIONS +.INDENT 0.0 +.TP +.B \-R, \-\-repository +. +repository root directory or name of overlay bundle file +.TP +.B \-\-cwd +. +change working directory +.TP +.B \-y, \-\-noninteractive +. +do not prompt, automatically pick the first choice for all prompts +.TP +.B \-q, \-\-quiet +. +suppress output +.TP +.B \-v, \-\-verbose +. +enable additional output +.TP +.B \-\-config +. +set/override config option (use \(aqsection.name=value\(aq) +.TP +.B \-\-debug +. +enable debugging output +.TP +.B \-\-debugger +. +start debugger +.TP +.B \-\-encoding +. +set the charset encoding (default: ascii) +.TP +.B \-\-encodingmode +. +set the charset encoding mode (default: strict) +.TP +.B \-\-traceback +. +always print a traceback on exception +.TP +.B \-\-time +. +time how long the command takes +.TP +.B \-\-profile +. +print command execution profile +.TP +.B \-\-version +. +output version information and exit +.TP +.B \-h, \-\-help +. +display help and exit +.UNINDENT +.SH COMMANDS +.SS add +.sp +.nf +.ft C +hg add [OPTION]... [FILE]... +.ft P +.fi +.sp +Schedule files to be version controlled and added to the +repository. +.sp +The files will be added to the repository at the next commit. To +undo an add before that, see \%\fBhg forget\fP\:. +.sp +If no names are given, add all files to the repository. +.sp +An example showing how new (unknown) files are added +automatically by \%\fBhg add\fP\:: +.sp +.nf +.ft C +$ ls +foo.c +$ hg status +? foo.c +$ hg add +adding foo.c +$ hg status +A foo.c +.ft P +.fi +.sp +Returns 0 if all files are successfully added. +.sp +Options: +.INDENT 0.0 +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.TP +.B \-S, \-\-subrepos +. +recurse into subrepositories +.TP +.B \-n, \-\-dry\-run +. +do not perform actions, just print output +.UNINDENT +.SS addremove +.sp +.nf +.ft C +hg addremove [OPTION]... [FILE]... +.ft P +.fi +.sp +Add all new files and remove all missing files from the +repository. +.sp +New files are ignored if they match any of the patterns in +\fB.hgignore\fP. As with add, these changes take effect at the next +commit. +.sp +Use the \-s/\-\-similarity option to detect renamed files. This +option takes a percentage between 0 (disabled) and 100 (files must +be identical) as its parameter. With a parameter greater than 0, +this compares every removed file with every added file and records +those similar enough as renames. Detecting renamed files this way +can be expensive. After using this option, \%\fBhg status \-C\fP\: can be +used to check which files were identified as moved or renamed. If +not specified, \-s/\-\-similarity defaults to 100 and only renames of +identical files are detected. +.sp +Returns 0 if all files are successfully added. +.sp +Options: +.INDENT 0.0 +.TP +.B \-s, \-\-similarity +. +guess renamed files by similarity (0<=s<=100) +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.TP +.B \-n, \-\-dry\-run +. +do not perform actions, just print output +.UNINDENT +.SS annotate +.sp +.nf +.ft C +hg annotate [\-r REV] [\-f] [\-a] [\-u] [\-d] [\-n] [\-c] [\-l] FILE... +.ft P +.fi +.sp +List changes in files, showing the revision id responsible for +each line +.sp +This command is useful for discovering when a change was made and +by whom. +.sp +Without the \-a/\-\-text option, annotate will avoid processing files +it detects as binary. With \-a, annotate will annotate the file +anyway, although the results will probably be neither useful +nor desirable. +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-r, \-\-rev +. +annotate the specified revision +.TP +.B \-\-follow +. +follow copies/renames and list the filename (DEPRECATED) +.TP +.B \-\-no\-follow +. +don\(aqt follow copies and renames +.TP +.B \-a, \-\-text +. +treat all files as text +.TP +.B \-u, \-\-user +. +list the author (long with \-v) +.TP +.B \-f, \-\-file +. +list the filename +.TP +.B \-d, \-\-date +. +list the date (short with \-q) +.TP +.B \-n, \-\-number +. +list the revision number (default) +.TP +.B \-c, \-\-changeset +. +list the changeset +.TP +.B \-l, \-\-line\-number +. +show line number at the first appearance +.TP +.B \-w, \-\-ignore\-all\-space +. +ignore white space when comparing lines +.TP +.B \-b, \-\-ignore\-space\-change +. +ignore changes in the amount of white space +.TP +.B \-B, \-\-ignore\-blank\-lines +. +ignore changes whose lines are all blank +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.sp +aliases: blame +.UNINDENT +.SS archive +.sp +.nf +.ft C +hg archive [OPTION]... DEST +.ft P +.fi +.sp +By default, the revision used is the parent of the working +directory; use \-r/\-\-rev to specify a different revision. +.sp +The archive type is automatically detected based on file +extension (or override using \-t/\-\-type). +.sp +Examples: +.INDENT 0.0 +.IP \(bu 2 +. +create a zip file containing the 1.0 release: +.sp +.nf +.ft C +hg archive \-r 1.0 project\-1.0.zip +.ft P +.fi +.IP \(bu 2 +. +create a tarball excluding .hg files: +.sp +.nf +.ft C +hg archive project.tar.gz \-X ".hg*" +.ft P +.fi +.UNINDENT +.sp +Valid types are: +.INDENT 0.0 +.TP +.B \fBfiles\fP +.sp +a directory full of files (default) +.TP +.B \fBtar\fP +.sp +tar archive, uncompressed +.TP +.B \fBtbz2\fP +.sp +tar archive, compressed using bzip2 +.TP +.B \fBtgz\fP +.sp +tar archive, compressed using gzip +.TP +.B \fBuzip\fP +.sp +zip archive, uncompressed +.TP +.B \fBzip\fP +.sp +zip archive, compressed using deflate +.UNINDENT +.sp +The exact name of the destination archive or directory is given +using a format string; see \%\fBhg help export\fP\: for details. +.sp +Each member added to an archive file has a directory prefix +prepended. Use \-p/\-\-prefix to specify a format string for the +prefix. The default is the basename of the archive, with suffixes +removed. +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-\-no\-decode +. +do not pass files through decoders +.TP +.B \-p, \-\-prefix +. +directory prefix for files in archive +.TP +.B \-r, \-\-rev +. +revision to distribute +.TP +.B \-t, \-\-type +. +type of distribution to create +.TP +.B \-S, \-\-subrepos +. +recurse into subrepositories +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.UNINDENT +.SS backout +.sp +.nf +.ft C +hg backout [OPTION]... [\-r] REV +.ft P +.fi +.sp +Prepare a new changeset with the effect of REV undone in the +current working directory. +.sp +If REV is the parent of the working directory, then this new changeset +is committed automatically. Otherwise, hg needs to merge the +changes and the merged result is left uncommitted. +.IP Note +. +backout cannot be used to fix either an unwanted or +incorrect merge. +.RE +.sp +By default, the pending changeset will have one parent, +maintaining a linear history. With \-\-merge, the pending +changeset will instead have two parents: the old parent of the +working directory and a new child of REV that simply undoes REV. +.sp +Before version 1.7, the behavior without \-\-merge was equivalent +to specifying \-\-merge followed by \%\fBhg update \-\-clean .\fP\: to +cancel the merge and leave the child of REV as a head to be +merged separately. +.sp +See \%\fBhg help dates\fP\: for a list of formats valid for \-d/\-\-date. +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-\-merge +. +merge with old dirstate parent after backout +.TP +.B \-\-parent +. +parent to choose when backing out merge (DEPRECATED) +.TP +.B \-r, \-\-rev +. +revision to backout +.TP +.B \-t, \-\-tool +. +specify merge tool +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.TP +.B \-m, \-\-message +. +use text as commit message +.TP +.B \-l, \-\-logfile +. +read commit message from file +.TP +.B \-d, \-\-date +. +record the specified date as commit date +.TP +.B \-u, \-\-user +. +record the specified user as committer +.UNINDENT +.SS bisect +.sp +.nf +.ft C +hg bisect [\-gbsr] [\-U] [\-c CMD] [REV] +.ft P +.fi +.sp +This command helps to find changesets which introduce problems. To +use, mark the earliest changeset you know exhibits the problem as +bad, then mark the latest changeset which is free from the problem +as good. Bisect will update your working directory to a revision +for testing (unless the \-U/\-\-noupdate option is specified). Once +you have performed tests, mark the working directory as good or +bad, and bisect will either update to another candidate changeset +or announce that it has found the bad revision. +.sp +As a shortcut, you can also use the revision argument to mark a +revision as good or bad without checking it out first. +.sp +If you supply a command, it will be used for automatic bisection. +The environment variable HG_NODE will contain the ID of the +changeset being tested. The exit status of the command will be +used to mark revisions as good or bad: status 0 means good, 125 +means to skip the revision, 127 (command not found) will abort the +bisection, and any other non\-zero exit status means the revision +is bad. +.sp +Some examples: +.INDENT 0.0 +.IP \(bu 2 +. +start a bisection with known bad revision 12, and good revision 34: +.sp +.nf +.ft C +hg bisect \-\-bad 34 +hg bisect \-\-good 12 +.ft P +.fi +.IP \(bu 2 +. +advance the current bisection by marking current revision as good or +bad: +.sp +.nf +.ft C +hg bisect \-\-good +hg bisect \-\-bad +.ft P +.fi +.IP \(bu 2 +. +mark the current revision, or a known revision, to be skipped (eg. if +that revision is not usable because of another issue): +.sp +.nf +.ft C +hg bisect \-\-skip +hg bisect \-\-skip 23 +.ft P +.fi +.IP \(bu 2 +. +forget the current bisection: +.sp +.nf +.ft C +hg bisect \-\-reset +.ft P +.fi +.IP \(bu 2 +. +use \(aqmake && make tests\(aq to automatically find the first broken +revision: +.sp +.nf +.ft C +hg bisect \-\-reset +hg bisect \-\-bad 34 +hg bisect \-\-good 12 +hg bisect \-\-command \(aqmake && make tests\(aq +.ft P +.fi +.IP \(bu 2 +. +see all changesets whose states are already known in the current +bisection: +.sp +.nf +.ft C +hg log \-r "bisect(pruned)" +.ft P +.fi +.IP \(bu 2 +. +see the changeset currently being bisected (especially useful +if running with \-U/\-\-noupdate): +.sp +.nf +.ft C +hg log \-r "bisect(current)" +.ft P +.fi +.IP \(bu 2 +. +see all changesets that took part in the current bisection: +.sp +.nf +.ft C +hg log \-r "bisect(range)" +.ft P +.fi +.IP \(bu 2 +. +with the graphlog extension, you can even get a nice graph: +.sp +.nf +.ft C +hg log \-\-graph \-r "bisect(range)" +.ft P +.fi +.UNINDENT +.sp +See \%\fBhg help revsets\fP\: for more about the \fIbisect()\fP keyword. +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-r, \-\-reset +. +reset bisect state +.TP +.B \-g, \-\-good +. +mark changeset good +.TP +.B \-b, \-\-bad +. +mark changeset bad +.TP +.B \-s, \-\-skip +. +skip testing changeset +.TP +.B \-e, \-\-extend +. +extend the bisect range +.TP +.B \-c, \-\-command +. +use command to check changeset state +.TP +.B \-U, \-\-noupdate +. +do not update to target +.UNINDENT +.SS bookmarks +.sp +.nf +.ft C +hg bookmarks [\-f] [\-d] [\-i] [\-m NAME] [\-r REV] [NAME] +.ft P +.fi +.sp +Bookmarks are pointers to certain commits that move when committing. +Bookmarks are local. They can be renamed, copied and deleted. It is +possible to use \%\fBhg merge NAME\fP\: to merge from a given bookmark, and +\%\fBhg update NAME\fP\: to update to a given bookmark. +.sp +You can use \%\fBhg bookmark NAME\fP\: to set a bookmark on the working +directory\(aqs parent revision with the given name. If you specify +a revision using \-r REV (where REV may be an existing bookmark), +the bookmark is assigned to that revision. +.sp +Bookmarks can be pushed and pulled between repositories (see \%\fBhg help +push\fP\: and \%\fBhg help pull\fP\:). This requires both the local and remote +repositories to support bookmarks. For versions prior to 1.8, this means +the bookmarks extension must be enabled. +.sp +With \-i/\-\-inactive, the new bookmark will not be made the active +bookmark. If \-r/\-\-rev is given, the new bookmark will not be made +active even if \-i/\-\-inactive is not given. If no NAME is given, the +current active bookmark will be marked inactive. +.sp +Options: +.INDENT 0.0 +.TP +.B \-f, \-\-force +. +force +.TP +.B \-r, \-\-rev +. +revision +.TP +.B \-d, \-\-delete +. +delete a given bookmark +.TP +.B \-m, \-\-rename +. +rename a given bookmark +.TP +.B \-i, \-\-inactive +. +mark a bookmark inactive +.UNINDENT +.SS branch +.sp +.nf +.ft C +hg branch [\-fC] [NAME] +.ft P +.fi +.IP Note +. +Branch names are permanent and global. Use \%\fBhg bookmark\fP\: to create a +light\-weight bookmark instead. See \%\fBhg help glossary\fP\: for more +information about named branches and bookmarks. +.RE +.sp +With no argument, show the current branch name. With one argument, +set the working directory branch name (the branch will not exist +in the repository until the next commit). Standard practice +recommends that primary development take place on the \(aqdefault\(aq +branch. +.sp +Unless \-f/\-\-force is specified, branch will not let you set a +branch name that already exists, even if it\(aqs inactive. +.sp +Use \-C/\-\-clean to reset the working directory branch to that of +the parent of the working directory, negating a previous branch +change. +.sp +Use the command \%\fBhg update\fP\: to switch to an existing branch. Use +\%\fBhg commit \-\-close\-branch\fP\: to mark this branch as closed. +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-f, \-\-force +. +set branch name even if it shadows an existing branch +.TP +.B \-C, \-\-clean +. +reset branch name to parent branch name +.UNINDENT +.SS branches +.sp +.nf +.ft C +hg branches [\-ac] +.ft P +.fi +.sp +List the repository\(aqs named branches, indicating which ones are +inactive. If \-c/\-\-closed is specified, also list branches which have +been marked closed (see \%\fBhg commit \-\-close\-branch\fP\:). +.sp +If \-a/\-\-active is specified, only show active branches. A branch +is considered active if it contains repository heads. +.sp +Use the command \%\fBhg update\fP\: to switch to an existing branch. +.sp +Returns 0. +.sp +Options: +.INDENT 0.0 +.TP +.B \-a, \-\-active +. +show only branches that have unmerged heads +.TP +.B \-c, \-\-closed +. +show normal and closed branches +.UNINDENT +.SS bundle +.sp +.nf +.ft C +hg bundle [\-f] [\-t TYPE] [\-a] [\-r REV]... [\-\-base REV]... FILE [DEST] +.ft P +.fi +.sp +Generate a compressed changegroup file collecting changesets not +known to be in another repository. +.sp +If you omit the destination repository, then hg assumes the +destination will have all the nodes you specify with \-\-base +parameters. To create a bundle containing all changesets, use +\-a/\-\-all (or \-\-base null). +.sp +You can change compression method with the \-t/\-\-type option. +The available compression methods are: none, bzip2, and +gzip (by default, bundles are compressed using bzip2). +.sp +The bundle file can then be transferred using conventional means +and applied to another repository with the unbundle or pull +command. This is useful when direct push and pull are not +available or when exporting an entire repository is undesirable. +.sp +Applying bundles preserves all changeset contents including +permissions, copy/rename information, and revision history. +.sp +Returns 0 on success, 1 if no changes found. +.sp +Options: +.INDENT 0.0 +.TP +.B \-f, \-\-force +. +run even when the destination is unrelated +.TP +.B \-r, \-\-rev +. +a changeset intended to be added to the destination +.TP +.B \-b, \-\-branch +. +a specific branch you would like to bundle +.TP +.B \-\-base +. +a base changeset assumed to be available at the destination +.TP +.B \-a, \-\-all +. +bundle all changesets in the repository +.TP +.B \-t, \-\-type +. +bundle compression type to use (default: bzip2) +.TP +.B \-e, \-\-ssh +. +specify ssh command to use +.TP +.B \-\-remotecmd +. +specify hg command to run on the remote side +.TP +.B \-\-insecure +. +do not verify server certificate (ignoring web.cacerts config) +.UNINDENT +.SS cat +.sp +.nf +.ft C +hg cat [OPTION]... FILE... +.ft P +.fi +.sp +Print the specified files as they were at the given revision. If +no revision is given, the parent of the working directory is used, +or tip if no revision is checked out. +.sp +Output may be to a file, in which case the name of the file is +given using a format string. The formatting rules are the same as +for the export command, with the following additions: +.INDENT 0.0 +.TP +.B \fB%s\fP +.sp +basename of file being printed +.TP +.B \fB%d\fP +.sp +dirname of file being printed, or \(aq.\(aq if in repository root +.TP +.B \fB%p\fP +.sp +root\-relative path name of file being printed +.UNINDENT +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-o, \-\-output +. +print output to file with formatted name +.TP +.B \-r, \-\-rev +. +print the given revision +.TP +.B \-\-decode +. +apply any matching decode filter +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.UNINDENT +.SS clone +.sp +.nf +.ft C +hg clone [OPTION]... SOURCE [DEST] +.ft P +.fi +.sp +Create a copy of an existing repository in a new directory. +.sp +If no destination directory name is specified, it defaults to the +basename of the source. +.sp +The location of the source is added to the new repository\(aqs +\fB.hg/hgrc\fP file, as the default to be used for future pulls. +.sp +Only local paths and \fBssh://\fP URLs are supported as +destinations. For \fBssh://\fP destinations, no working directory or +\fB.hg/hgrc\fP will be created on the remote side. +.sp +To pull only a subset of changesets, specify one or more revisions +identifiers with \-r/\-\-rev or branches with \-b/\-\-branch. The +resulting clone will contain only the specified changesets and +their ancestors. These options (or \(aqclone src#rev dest\(aq) imply +\-\-pull, even for local source repositories. Note that specifying a +tag will include the tagged changeset but not the changeset +containing the tag. +.sp +To check out a particular version, use \-u/\-\-update, or +\-U/\-\-noupdate to create a clone with no working directory. +.sp +For efficiency, hardlinks are used for cloning whenever the +source and destination are on the same filesystem (note this +applies only to the repository data, not to the working +directory). Some filesystems, such as AFS, implement hardlinking +incorrectly, but do not report errors. In these cases, use the +\-\-pull option to avoid hardlinking. +.sp +In some cases, you can clone repositories and the working +directory using full hardlinks with +.sp +.nf +.ft C +$ cp \-al REPO REPOCLONE +.ft P +.fi +.sp +This is the fastest way to clone, but it is not always safe. The +operation is not atomic (making sure REPO is not modified during +the operation is up to you) and you have to make sure your +editor breaks hardlinks (Emacs and most Linux Kernel tools do +so). Also, this is not compatible with certain extensions that +place their metadata under the .hg directory, such as mq. +.sp +Mercurial will update the working directory to the first applicable +revision from this list: +.INDENT 0.0 +.IP a. 3 +. +null if \-U or the source repository has no changesets +.IP b. 3 +. +if \-u . and the source repository is local, the first parent of +the source repository\(aqs working directory +.IP c. 3 +. +the changeset specified with \-u (if a branch name, this means the +latest head of that branch) +.IP d. 3 +. +the changeset specified with \-r +.IP e. 3 +. +the tipmost head specified with \-b +.IP f. 3 +. +the tipmost head specified with the url#branch source syntax +.IP g. 3 +. +the tipmost head of the default branch +.IP h. 3 +. +tip +.UNINDENT +.sp +Examples: +.INDENT 0.0 +.IP \(bu 2 +. +clone a remote repository to a new directory named hg/: +.sp +.nf +.ft C +hg clone http://selenic.com/hg +.ft P +.fi +.IP \(bu 2 +. +create a lightweight local clone: +.sp +.nf +.ft C +hg clone project/ project\-feature/ +.ft P +.fi +.IP \(bu 2 +. +clone from an absolute path on an ssh server (note double\-slash): +.sp +.nf +.ft C +hg clone ssh://user@server//home/projects/alpha/ +.ft P +.fi +.IP \(bu 2 +. +do a high\-speed clone over a LAN while checking out a +specified version: +.sp +.nf +.ft C +hg clone \-\-uncompressed http://server/repo \-u 1.5 +.ft P +.fi +.IP \(bu 2 +. +create a repository without changesets after a particular revision: +.sp +.nf +.ft C +hg clone \-r 04e544 experimental/ good/ +.ft P +.fi +.IP \(bu 2 +. +clone (and track) a particular named branch: +.sp +.nf +.ft C +hg clone http://selenic.com/hg#stable +.ft P +.fi +.UNINDENT +.sp +See \%\fBhg help urls\fP\: for details on specifying URLs. +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-U, \-\-noupdate +. +the clone will include an empty working copy (only a repository) +.TP +.B \-u, \-\-updaterev +. +revision, tag or branch to check out +.TP +.B \-r, \-\-rev +. +include the specified changeset +.TP +.B \-b, \-\-branch +. +clone only the specified branch +.TP +.B \-\-pull +. +use pull protocol to copy metadata +.TP +.B \-\-uncompressed +. +use uncompressed transfer (fast over LAN) +.TP +.B \-e, \-\-ssh +. +specify ssh command to use +.TP +.B \-\-remotecmd +. +specify hg command to run on the remote side +.TP +.B \-\-insecure +. +do not verify server certificate (ignoring web.cacerts config) +.UNINDENT +.SS commit +.sp +.nf +.ft C +hg commit [OPTION]... [FILE]... +.ft P +.fi +.sp +Commit changes to the given files into the repository. Unlike a +centralized SCM, this operation is a local operation. See +\%\fBhg push\fP\: for a way to actively distribute your changes. +.sp +If a list of files is omitted, all changes reported by \%\fBhg status\fP\: +will be committed. +.sp +If you are committing the result of a merge, do not provide any +filenames or \-I/\-X filters. +.sp +If no commit message is specified, Mercurial starts your +configured editor where you can enter a message. In case your +commit fails, you will find a backup of your message in +\fB.hg/last\-message.txt\fP. +.sp +The \-\-amend flag can be used to amend the parent of the +working directory with a new commit that contains the changes +in the parent in addition to those currently reported by \%\fBhg status\fP\:, +if there are any. The old commit is stored in a backup bundle in +\fB.hg/strip\-backup\fP (see \%\fBhg help bundle\fP\: and \%\fBhg help unbundle\fP\: +on how to restore it). +.sp +Message, user and date are taken from the amended commit unless +specified. When a message isn\(aqt specified on the command line, +the editor will open with the message of the amended commit. +.sp +It is not possible to amend public changesets (see \%\fBhg help phases\fP\:) +or changesets that have children. +.sp +See \%\fBhg help dates\fP\: for a list of formats valid for \-d/\-\-date. +.sp +Returns 0 on success, 1 if nothing changed. +.sp +Options: +.INDENT 0.0 +.TP +.B \-A, \-\-addremove +. +mark new/missing files as added/removed before committing +.TP +.B \-\-close\-branch +. +mark a branch as closed, hiding it from the branch list +.TP +.B \-\-amend +. +amend the parent of the working dir +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.TP +.B \-m, \-\-message +. +use text as commit message +.TP +.B \-l, \-\-logfile +. +read commit message from file +.TP +.B \-d, \-\-date +. +record the specified date as commit date +.TP +.B \-u, \-\-user +. +record the specified user as committer +.TP +.B \-S, \-\-subrepos +. +recurse into subrepositories +.sp +aliases: ci +.UNINDENT +.SS copy +.sp +.nf +.ft C +hg copy [OPTION]... [SOURCE]... DEST +.ft P +.fi +.sp +Mark dest as having copies of source files. If dest is a +directory, copies are put in that directory. If dest is a file, +the source must be a single file. +.sp +By default, this command copies the contents of files as they +exist in the working directory. If invoked with \-A/\-\-after, the +operation is recorded, but no copying is performed. +.sp +This command takes effect with the next commit. To undo a copy +before that, see \%\fBhg revert\fP\:. +.sp +Returns 0 on success, 1 if errors are encountered. +.sp +Options: +.INDENT 0.0 +.TP +.B \-A, \-\-after +. +record a copy that has already occurred +.TP +.B \-f, \-\-force +. +forcibly copy over an existing managed file +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.TP +.B \-n, \-\-dry\-run +. +do not perform actions, just print output +.sp +aliases: cp +.UNINDENT +.SS diff +.sp +.nf +.ft C +hg diff [OPTION]... ([\-c REV] | [\-r REV1 [\-r REV2]]) [FILE]... +.ft P +.fi +.sp +Show differences between revisions for the specified files. +.sp +Differences between files are shown using the unified diff format. +.IP Note +. +diff may generate unexpected results for merges, as it will +default to comparing against the working directory\(aqs first +parent changeset if no revisions are specified. +.RE +.sp +When two revision arguments are given, then changes are shown +between those revisions. If only one revision is specified then +that revision is compared to the working directory, and, when no +revisions are specified, the working directory files are compared +to its parent. +.sp +Alternatively you can specify \-c/\-\-change with a revision to see +the changes in that changeset relative to its first parent. +.sp +Without the \-a/\-\-text option, diff will avoid generating diffs of +files it detects as binary. With \-a, diff will generate a diff +anyway, probably with undesirable results. +.sp +Use the \-g/\-\-git option to generate diffs in the git extended diff +format. For more information, read \%\fBhg help diffs\fP\:. +.sp +Examples: +.INDENT 0.0 +.IP \(bu 2 +. +compare a file in the current working directory to its parent: +.sp +.nf +.ft C +hg diff foo.c +.ft P +.fi +.IP \(bu 2 +. +compare two historical versions of a directory, with rename info: +.sp +.nf +.ft C +hg diff \-\-git \-r 1.0:1.2 lib/ +.ft P +.fi +.IP \(bu 2 +. +get change stats relative to the last change on some date: +.sp +.nf +.ft C +hg diff \-\-stat \-r "date(\(aqmay 2\(aq)" +.ft P +.fi +.IP \(bu 2 +. +diff all newly\-added files that contain a keyword: +.sp +.nf +.ft C +hg diff "set:added() and grep(GNU)" +.ft P +.fi +.IP \(bu 2 +. +compare a revision and its parents: +.sp +.nf +.ft C +hg diff \-c 9353 # compare against first parent +hg diff \-r 9353^:9353 # same using revset syntax +hg diff \-r 9353^2:9353 # compare against the second parent +.ft P +.fi +.UNINDENT +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-r, \-\-rev +. +revision +.TP +.B \-c, \-\-change +. +change made by revision +.TP +.B \-a, \-\-text +. +treat all files as text +.TP +.B \-g, \-\-git +. +use git extended diff format +.TP +.B \-\-nodates +. +omit dates from diff headers +.TP +.B \-p, \-\-show\-function +. +show which function each change is in +.TP +.B \-\-reverse +. +produce a diff that undoes the changes +.TP +.B \-w, \-\-ignore\-all\-space +. +ignore white space when comparing lines +.TP +.B \-b, \-\-ignore\-space\-change +. +ignore changes in the amount of white space +.TP +.B \-B, \-\-ignore\-blank\-lines +. +ignore changes whose lines are all blank +.TP +.B \-U, \-\-unified +. +number of lines of context to show +.TP +.B \-\-stat +. +output diffstat\-style summary of changes +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.TP +.B \-S, \-\-subrepos +. +recurse into subrepositories +.UNINDENT +.SS export +.sp +.nf +.ft C +hg export [OPTION]... [\-o OUTFILESPEC] [\-r] REV... +.ft P +.fi +.sp +Print the changeset header and diffs for one or more revisions. +.sp +The information shown in the changeset header is: author, date, +branch name (if non\-default), changeset hash, parent(s) and commit +comment. +.IP Note +. +export may generate unexpected diff output for merge +changesets, as it will compare the merge changeset against its +first parent only. +.RE +.sp +Output may be to a file, in which case the name of the file is +given using a format string. The formatting rules are as follows: +.INDENT 0.0 +.TP +.B \fB%%\fP +.sp +literal "%" character +.TP +.B \fB%H\fP +.sp +changeset hash (40 hexadecimal digits) +.TP +.B \fB%N\fP +.sp +number of patches being generated +.TP +.B \fB%R\fP +.sp +changeset revision number +.TP +.B \fB%b\fP +.sp +basename of the exporting repository +.TP +.B \fB%h\fP +.sp +short\-form changeset hash (12 hexadecimal digits) +.TP +.B \fB%m\fP +.sp +first line of the commit message (only alphanumeric characters) +.TP +.B \fB%n\fP +.sp +zero\-padded sequence number, starting at 1 +.TP +.B \fB%r\fP +.sp +zero\-padded changeset revision number +.UNINDENT +.sp +Without the \-a/\-\-text option, export will avoid generating diffs +of files it detects as binary. With \-a, export will generate a +diff anyway, probably with undesirable results. +.sp +Use the \-g/\-\-git option to generate diffs in the git extended diff +format. See \%\fBhg help diffs\fP\: for more information. +.sp +With the \-\-switch\-parent option, the diff will be against the +second parent. It can be useful to review a merge. +.sp +Examples: +.INDENT 0.0 +.IP \(bu 2 +. +use export and import to transplant a bugfix to the current +branch: +.sp +.nf +.ft C +hg export \-r 9353 | hg import \- +.ft P +.fi +.IP \(bu 2 +. +export all the changesets between two revisions to a file with +rename information: +.sp +.nf +.ft C +hg export \-\-git \-r 123:150 > changes.txt +.ft P +.fi +.IP \(bu 2 +. +split outgoing changes into a series of patches with +descriptive names: +.sp +.nf +.ft C +hg export \-r "outgoing()" \-o "%n\-%m.patch" +.ft P +.fi +.UNINDENT +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-o, \-\-output +. +print output to file with formatted name +.TP +.B \-\-switch\-parent +. +diff against the second parent +.TP +.B \-r, \-\-rev +. +revisions to export +.TP +.B \-a, \-\-text +. +treat all files as text +.TP +.B \-g, \-\-git +. +use git extended diff format +.TP +.B \-\-nodates +. +omit dates from diff headers +.UNINDENT +.SS forget +.sp +.nf +.ft C +hg forget [OPTION]... FILE... +.ft P +.fi +.sp +Mark the specified files so they will no longer be tracked +after the next commit. +.sp +This only removes files from the current branch, not from the +entire project history, and it does not delete them from the +working directory. +.sp +To undo a forget before the next commit, see \%\fBhg add\fP\:. +.sp +Examples: +.INDENT 0.0 +.IP \(bu 2 +. +forget newly\-added binary files: +.sp +.nf +.ft C +hg forget "set:added() and binary()" +.ft P +.fi +.IP \(bu 2 +. +forget files that would be excluded by .hgignore: +.sp +.nf +.ft C +hg forget "set:hgignore()" +.ft P +.fi +.UNINDENT +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.UNINDENT +.SS graft +.sp +.nf +.ft C +hg graft [OPTION]... [\-r] REV... +.ft P +.fi +.sp +This command uses Mercurial\(aqs merge logic to copy individual +changes from other branches without merging branches in the +history graph. This is sometimes known as \(aqbackporting\(aq or +\(aqcherry\-picking\(aq. By default, graft will copy user, date, and +description from the source changesets. +.sp +Changesets that are ancestors of the current revision, that have +already been grafted, or that are merges will be skipped. +.sp +If \-\-log is specified, log messages will have a comment appended +of the form: +.sp +.nf +.ft C +(grafted from CHANGESETHASH) +.ft P +.fi +.sp +If a graft merge results in conflicts, the graft process is +interrupted so that the current merge can be manually resolved. +Once all conflicts are addressed, the graft process can be +continued with the \-c/\-\-continue option. +.IP Note +. +The \-c/\-\-continue option does not reapply earlier options. +.RE +.sp +Examples: +.INDENT 0.0 +.IP \(bu 2 +. +copy a single change to the stable branch and edit its description: +.sp +.nf +.ft C +hg update stable +hg graft \-\-edit 9393 +.ft P +.fi +.IP \(bu 2 +. +graft a range of changesets with one exception, updating dates: +.sp +.nf +.ft C +hg graft \-D "2085::2093 and not 2091" +.ft P +.fi +.IP \(bu 2 +. +continue a graft after resolving conflicts: +.sp +.nf +.ft C +hg graft \-c +.ft P +.fi +.IP \(bu 2 +. +show the source of a grafted changeset: +.sp +.nf +.ft C +hg log \-\-debug \-r tip +.ft P +.fi +.UNINDENT +.sp +Returns 0 on successful completion. +.sp +Options: +.INDENT 0.0 +.TP +.B \-r, \-\-rev +. +revisions to graft +.TP +.B \-c, \-\-continue +. +resume interrupted graft +.TP +.B \-e, \-\-edit +. +invoke editor on commit messages +.TP +.B \-\-log +. +append graft info to log message +.TP +.B \-D, \-\-currentdate +. +record the current date as commit date +.TP +.B \-U, \-\-currentuser +. +record the current user as committer +.TP +.B \-d, \-\-date +. +record the specified date as commit date +.TP +.B \-u, \-\-user +. +record the specified user as committer +.TP +.B \-t, \-\-tool +. +specify merge tool +.TP +.B \-n, \-\-dry\-run +. +do not perform actions, just print output +.UNINDENT +.SS grep +.sp +.nf +.ft C +hg grep [OPTION]... PATTERN [FILE]... +.ft P +.fi +.sp +Search revisions of files for a regular expression. +.sp +This command behaves differently than Unix grep. It only accepts +Python/Perl regexps. It searches repository history, not the +working directory. It always prints the revision number in which a +match appears. +.sp +By default, grep only prints output for the first revision of a +file in which it finds a match. To get it to print every revision +that contains a change in match status ("\-" for a match that +becomes a non\-match, or "+" for a non\-match that becomes a match), +use the \-\-all flag. +.sp +Returns 0 if a match is found, 1 otherwise. +.sp +Options: +.INDENT 0.0 +.TP +.B \-0, \-\-print0 +. +end fields with NUL +.TP +.B \-\-all +. +print all revisions that match +.TP +.B \-a, \-\-text +. +treat all files as text +.TP +.B \-f, \-\-follow +. +follow changeset history, or file history across copies and renames +.TP +.B \-i, \-\-ignore\-case +. +ignore case when matching +.TP +.B \-l, \-\-files\-with\-matches +. +print only filenames and revisions that match +.TP +.B \-n, \-\-line\-number +. +print matching line numbers +.TP +.B \-r, \-\-rev +. +only search files changed within revision range +.TP +.B \-u, \-\-user +. +list the author (long with \-v) +.TP +.B \-d, \-\-date +. +list the date (short with \-q) +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.UNINDENT +.SS heads +.sp +.nf +.ft C +hg heads [\-ct] [\-r STARTREV] [REV]... +.ft P +.fi +.sp +With no arguments, show all repository branch heads. +.sp +Repository "heads" are changesets with no child changesets. They are +where development generally takes place and are the usual targets +for update and merge operations. Branch heads are changesets that have +no child changeset on the same branch. +.sp +If one or more REVs are given, only branch heads on the branches +associated with the specified changesets are shown. This means +that you can use \%\fBhg heads foo\fP\: to see the heads on a branch +named \fBfoo\fP. +.sp +If \-c/\-\-closed is specified, also show branch heads marked closed +(see \%\fBhg commit \-\-close\-branch\fP\:). +.sp +If STARTREV is specified, only those heads that are descendants of +STARTREV will be displayed. +.sp +If \-t/\-\-topo is specified, named branch mechanics will be ignored and only +changesets without children will be shown. +.sp +Returns 0 if matching heads are found, 1 if not. +.sp +Options: +.INDENT 0.0 +.TP +.B \-r, \-\-rev +. +show only heads which are descendants of STARTREV +.TP +.B \-t, \-\-topo +. +show topological heads only +.TP +.B \-a, \-\-active +. +show active branchheads only (DEPRECATED) +.TP +.B \-c, \-\-closed +. +show normal and closed branch heads +.TP +.B \-\-style +. +display using template map file +.TP +.B \-\-template +. +display with template +.UNINDENT +.SS help +.sp +.nf +.ft C +hg help [\-ec] [TOPIC] +.ft P +.fi +.sp +With no arguments, print a list of commands with short help messages. +.sp +Given a topic, extension, or command name, print help for that +topic. +.sp +Returns 0 if successful. +.sp +Options: +.INDENT 0.0 +.TP +.B \-e, \-\-extension +. +show only help for extensions +.TP +.B \-c, \-\-command +. +show only help for commands +.TP +.B \-k, \-\-keyword +. +show topics matching keyword +.UNINDENT +.SS identify +.sp +.nf +.ft C +hg identify [\-nibtB] [\-r REV] [SOURCE] +.ft P +.fi +.sp +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. +.sp +When REV is not given, print a summary of the current state of the +repository. +.sp +Specifying a path to a repository root or Mercurial bundle will +cause lookup to operate on that repository/bundle. +.sp +Examples: +.INDENT 0.0 +.IP \(bu 2 +. +generate a build identifier for the working directory: +.sp +.nf +.ft C +hg id \-\-id > build\-id.dat +.ft P +.fi +.IP \(bu 2 +. +find the revision corresponding to a tag: +.sp +.nf +.ft C +hg id \-n \-r 1.3 +.ft P +.fi +.IP \(bu 2 +. +check the most recent revision of a remote repository: +.sp +.nf +.ft C +hg id \-r tip http://selenic.com/hg/ +.ft P +.fi +.UNINDENT +.sp +Returns 0 if successful. +.sp +Options: +.INDENT 0.0 +.TP +.B \-r, \-\-rev +. +identify the specified revision +.TP +.B \-n, \-\-num +. +show local revision number +.TP +.B \-i, \-\-id +. +show global revision id +.TP +.B \-b, \-\-branch +. +show branch +.TP +.B \-t, \-\-tags +. +show tags +.TP +.B \-B, \-\-bookmarks +. +show bookmarks +.TP +.B \-e, \-\-ssh +. +specify ssh command to use +.TP +.B \-\-remotecmd +. +specify hg command to run on the remote side +.TP +.B \-\-insecure +. +do not verify server certificate (ignoring web.cacerts config) +.sp +aliases: id +.UNINDENT +.SS import +.sp +.nf +.ft C +hg import [OPTION]... PATCH... +.ft P +.fi +.sp +Import a list of patches and commit them individually (unless +\-\-no\-commit is specified). +.sp +If there are outstanding changes in the working directory, import +will abort unless given the \-f/\-\-force flag. +.sp +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. +.sp +If the imported patch was generated by \%\fBhg export\fP\:, 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. +.sp +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. +.sp +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. +.sp +With \-s/\-\-similarity, hg will attempt to discover renames and +copies in the patch in the same way as \%\fBhg addremove\fP\:. +.sp +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 \%\fBhg help dates\fP\: for a list of formats valid for \-d/\-\-date. +.sp +Examples: +.INDENT 0.0 +.IP \(bu 2 +. +import a traditional patch from a website and detect renames: +.sp +.nf +.ft C +hg import \-s 80 http://example.com/bugfix.patch +.ft P +.fi +.IP \(bu 2 +. +import a changeset from an hgweb server: +.sp +.nf +.ft C +hg import http://www.selenic.com/hg/rev/5ca8c111e9aa +.ft P +.fi +.IP \(bu 2 +. +import all the patches in an Unix\-style mbox: +.sp +.nf +.ft C +hg import incoming\-patches.mbox +.ft P +.fi +.IP \(bu 2 +. +attempt to exactly restore an exported changeset (not always +possible): +.sp +.nf +.ft C +hg import \-\-exact proposed\-fix.patch +.ft P +.fi +.UNINDENT +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-p, \-\-strip +. +directory strip option for patch. This has the same meaning as the corresponding patch option (default: 1) +.TP +.B \-b, \-\-base +. +base path (DEPRECATED) +.TP +.B \-e, \-\-edit +. +invoke editor on commit messages +.TP +.B \-f, \-\-force +. +skip check for outstanding uncommitted changes +.TP +.B \-\-no\-commit +. +don\(aqt commit, just update the working directory +.TP +.B \-\-bypass +. +apply patch without touching the working directory +.TP +.B \-\-exact +. +apply patch to the nodes from which it was generated +.TP +.B \-\-import\-branch +. +use any branch information in patch (implied by \-\-exact) +.TP +.B \-m, \-\-message +. +use text as commit message +.TP +.B \-l, \-\-logfile +. +read commit message from file +.TP +.B \-d, \-\-date +. +record the specified date as commit date +.TP +.B \-u, \-\-user +. +record the specified user as committer +.TP +.B \-s, \-\-similarity +. +guess renamed files by similarity (0<=s<=100) +.sp +aliases: patch +.UNINDENT +.SS incoming +.sp +.nf +.ft C +hg incoming [\-p] [\-n] [\-M] [\-f] [\-r REV]... [\-\-bundle FILENAME] [SOURCE] +.ft P +.fi +.sp +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. +.sp +For remote repository, using \-\-bundle avoids downloading the +changesets twice if the incoming is followed by a pull. +.sp +See pull for valid source format details. +.sp +Returns 0 if there are incoming changes, 1 otherwise. +.sp +Options: +.INDENT 0.0 +.TP +.B \-f, \-\-force +. +run even if remote repository is unrelated +.TP +.B \-n, \-\-newest\-first +. +show newest record first +.TP +.B \-\-bundle +. +file to store the bundles into +.TP +.B \-r, \-\-rev +. +a remote changeset intended to be added +.TP +.B \-B, \-\-bookmarks +. +compare bookmarks +.TP +.B \-b, \-\-branch +. +a specific branch you would like to pull +.TP +.B \-p, \-\-patch +. +show patch +.TP +.B \-g, \-\-git +. +use git extended diff format +.TP +.B \-l, \-\-limit +. +limit number of changes displayed +.TP +.B \-M, \-\-no\-merges +. +do not show merges +.TP +.B \-\-stat +. +output diffstat\-style summary of changes +.TP +.B \-G, \-\-graph +. +show the revision DAG +.TP +.B \-\-style +. +display using template map file +.TP +.B \-\-template +. +display with template +.TP +.B \-e, \-\-ssh +. +specify ssh command to use +.TP +.B \-\-remotecmd +. +specify hg command to run on the remote side +.TP +.B \-\-insecure +. +do not verify server certificate (ignoring web.cacerts config) +.TP +.B \-S, \-\-subrepos +. +recurse into subrepositories +.sp +aliases: in +.UNINDENT +.SS init +.sp +.nf +.ft C +hg init [\-e CMD] [\-\-remotecmd CMD] [DEST] +.ft P +.fi +.sp +Initialize a new repository in the given directory. If the given +directory does not exist, it will be created. +.sp +If no directory is given, the current directory is used. +.sp +It is possible to specify an \fBssh://\fP URL as the destination. +See \%\fBhg help urls\fP\: for more information. +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-e, \-\-ssh +. +specify ssh command to use +.TP +.B \-\-remotecmd +. +specify hg command to run on the remote side +.TP +.B \-\-insecure +. +do not verify server certificate (ignoring web.cacerts config) +.UNINDENT +.SS locate +.sp +.nf +.ft C +hg locate [OPTION]... [PATTERN]... +.ft P +.fi +.sp +Print files under Mercurial control in the working directory whose +names match the given patterns. +.sp +By default, this command searches all directories in the working +directory. To search just the current directory and its +subdirectories, use "\-\-include .". +.sp +If no patterns are given to match, this command prints the names +of all files under Mercurial control in the working directory. +.sp +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. +.sp +Returns 0 if a match is found, 1 otherwise. +.sp +Options: +.INDENT 0.0 +.TP +.B \-r, \-\-rev +. +search the repository as it is in REV +.TP +.B \-0, \-\-print0 +. +end filenames with NUL, for use with xargs +.TP +.B \-f, \-\-fullpath +. +print complete paths from the filesystem root +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.UNINDENT +.SS log +.sp +.nf +.ft C +hg log [OPTION]... [FILE] +.ft P +.fi +.sp +Print the revision history of the specified files or the entire +project. +.sp +If no revision range is specified, the default is \fBtip:0\fP unless +\-\-follow is set, in which case the working directory parent is +used as the starting revision. +.sp +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. +.sp +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. +.IP Note +. +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:. +.RE +.IP Note +. +for performance reasons, log FILE may omit duplicate changes +made on branches and will not show deletions. To see all +changes including duplicates and deletions, use the \-\-removed +switch. +.RE +.sp +Some examples: +.INDENT 0.0 +.IP \(bu 2 +. +changesets with full descriptions and file lists: +.sp +.nf +.ft C +hg log \-v +.ft P +.fi +.IP \(bu 2 +. +changesets ancestral to the working directory: +.sp +.nf +.ft C +hg log \-f +.ft P +.fi +.IP \(bu 2 +. +last 10 commits on the current branch: +.sp +.nf +.ft C +hg log \-l 10 \-b . +.ft P +.fi +.IP \(bu 2 +. +changesets showing all modifications of a file, including removals: +.sp +.nf +.ft C +hg log \-\-removed file.c +.ft P +.fi +.IP \(bu 2 +. +all changesets that touch a directory, with diffs, excluding merges: +.sp +.nf +.ft C +hg log \-Mp lib/ +.ft P +.fi +.IP \(bu 2 +. +all revision numbers that match a keyword: +.sp +.nf +.ft C +hg log \-k bug \-\-template "{rev}\en" +.ft P +.fi +.IP \(bu 2 +. +check if a given changeset is included is a tagged release: +.sp +.nf +.ft C +hg log \-r "a21ccf and ancestor(1.9)" +.ft P +.fi +.IP \(bu 2 +. +find all changesets by some user in a date range: +.sp +.nf +.ft C +hg log \-k alice \-d "may 2008 to jul 2008" +.ft P +.fi +.IP \(bu 2 +. +summary of all changesets after the last tag: +.sp +.nf +.ft C +hg log \-r "last(tagged())::" \-\-template "{desc|firstline}\en" +.ft P +.fi +.UNINDENT +.sp +See \%\fBhg help dates\fP\: for a list of formats valid for \-d/\-\-date. +.sp +See \%\fBhg help revisions\fP\: and \%\fBhg help revsets\fP\: for more about +specifying revisions. +.sp +See \%\fBhg help templates\fP\: for more about pre\-packaged styles and +specifying custom templates. +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-f, \-\-follow +. +follow changeset history, or file history across copies and renames +.TP +.B \-\-follow\-first +. +only follow the first parent of merge changesets (DEPRECATED) +.TP +.B \-d, \-\-date +. +show revisions matching date spec +.TP +.B \-C, \-\-copies +. +show copied files +.TP +.B \-k, \-\-keyword +. +do case\-insensitive search for a given text +.TP +.B \-r, \-\-rev +. +show the specified revision or range +.TP +.B \-\-removed +. +include revisions where files were removed +.TP +.B \-m, \-\-only\-merges +. +show only merges (DEPRECATED) +.TP +.B \-u, \-\-user +. +revisions committed by user +.TP +.B \-\-only\-branch +. +show only changesets within the given named branch (DEPRECATED) +.TP +.B \-b, \-\-branch +. +show changesets within the given named branch +.TP +.B \-P, \-\-prune +. +do not display revision or any of its ancestors +.TP +.B \-\-hidden +. +show hidden changesets (DEPRECATED) +.TP +.B \-p, \-\-patch +. +show patch +.TP +.B \-g, \-\-git +. +use git extended diff format +.TP +.B \-l, \-\-limit +. +limit number of changes displayed +.TP +.B \-M, \-\-no\-merges +. +do not show merges +.TP +.B \-\-stat +. +output diffstat\-style summary of changes +.TP +.B \-G, \-\-graph +. +show the revision DAG +.TP +.B \-\-style +. +display using template map file +.TP +.B \-\-template +. +display with template +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.sp +aliases: history +.UNINDENT +.SS manifest +.sp +.nf +.ft C +hg manifest [\-r REV] +.ft P +.fi +.sp +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. +.sp +With \-v, print file permissions, symlink and executable bits. +With \-\-debug, print file revision hashes. +.sp +If option \-\-all is specified, the list of all files from all revisions +is printed. This includes deleted and renamed files. +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-r, \-\-rev +. +revision to display +.TP +.B \-\-all +. +list files from all revisions +.UNINDENT +.SS merge +.sp +.nf +.ft C +hg merge [\-P] [\-f] [[\-r] REV] +.ft P +.fi +.sp +The current working directory is updated with all changes made in +the requested revision since the last common predecessor revision. +.sp +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. +.sp +\fB\-\-tool\fP can be used to specify the merge tool used for file +merges. It overrides the HGMERGE environment variable and your +configuration files. See \%\fBhg help merge\-tools\fP\: for options. +.sp +If no revision is specified, the working directory\(aqs 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. +.sp +\%\fBhg resolve\fP\: must be used to resolve unresolved files. +.sp +To undo an uncommitted merge, use \%\fBhg update \-\-clean .\fP\: which +will check out a clean copy of the original merge parent, losing +all changes. +.sp +Returns 0 on success, 1 if there are unresolved files. +.sp +Options: +.INDENT 0.0 +.TP +.B \-f, \-\-force +. +force a merge with outstanding changes +.TP +.B \-r, \-\-rev +. +revision to merge +.TP +.B \-P, \-\-preview +. +review revisions to merge (no merge is performed) +.TP +.B \-t, \-\-tool +. +specify merge tool +.UNINDENT +.SS outgoing +.sp +.nf +.ft C +hg outgoing [\-M] [\-p] [\-n] [\-f] [\-r REV]... [DEST] +.ft P +.fi +.sp +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. +.sp +See pull for details of valid destination formats. +.sp +Returns 0 if there are outgoing changes, 1 otherwise. +.sp +Options: +.INDENT 0.0 +.TP +.B \-f, \-\-force +. +run even when the destination is unrelated +.TP +.B \-r, \-\-rev +. +a changeset intended to be included in the destination +.TP +.B \-n, \-\-newest\-first +. +show newest record first +.TP +.B \-B, \-\-bookmarks +. +compare bookmarks +.TP +.B \-b, \-\-branch +. +a specific branch you would like to push +.TP +.B \-p, \-\-patch +. +show patch +.TP +.B \-g, \-\-git +. +use git extended diff format +.TP +.B \-l, \-\-limit +. +limit number of changes displayed +.TP +.B \-M, \-\-no\-merges +. +do not show merges +.TP +.B \-\-stat +. +output diffstat\-style summary of changes +.TP +.B \-G, \-\-graph +. +show the revision DAG +.TP +.B \-\-style +. +display using template map file +.TP +.B \-\-template +. +display with template +.TP +.B \-e, \-\-ssh +. +specify ssh command to use +.TP +.B \-\-remotecmd +. +specify hg command to run on the remote side +.TP +.B \-\-insecure +. +do not verify server certificate (ignoring web.cacerts config) +.TP +.B \-S, \-\-subrepos +. +recurse into subrepositories +.sp +aliases: out +.UNINDENT +.SS parents +.sp +.nf +.ft C +hg parents [\-r REV] [FILE] +.ft P +.fi +.sp +Print the working directory\(aqs 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. +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-r, \-\-rev +. +show parents of the specified revision +.TP +.B \-\-style +. +display using template map file +.TP +.B \-\-template +. +display with template +.UNINDENT +.SS paths +.sp +.nf +.ft C +hg paths [NAME] +.ft P +.fi +.sp +Show definition of symbolic path name NAME. If no name is given, +show definition of all available names. +.sp +Option \-q/\-\-quiet suppresses all output when searching for NAME +and shows only the path names when listing all definitions. +.sp +Path names are defined in the [paths] section of your +configuration file and in \fB/etc/mercurial/hgrc\fP. If run inside a +repository, \fB.hg/hgrc\fP is used, too. +.sp +The path names \fBdefault\fP and \fBdefault\-push\fP 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 \fBdefault\-push\fP is set, it will be used for push and +\fBdefault\fP will be used for pull; otherwise \fBdefault\fP is used +as the fallback for both. When cloning a repository, the clone +source is written as \fBdefault\fP in \fB.hg/hgrc\fP. Note that +\fBdefault\fP and \fBdefault\-push\fP apply to all inbound (e.g. +\%\fBhg incoming\fP\:) and outbound (e.g. \%\fBhg outgoing\fP\:, \%\fBhg email\fP\: and +\%\fBhg bundle\fP\:) operations. +.sp +See \%\fBhg help urls\fP\: for more information. +.sp +Returns 0 on success. +.SS phase +.sp +.nf +.ft C +hg phase [\-p|\-d|\-s] [\-f] [\-r] REV... +.ft P +.fi +.sp +With no argument, show the phase name of specified revisions. +.sp +With one of \-p/\-\-public, \-d/\-\-draft or \-s/\-\-secret, change the +phase value of the specified revisions. +.sp +Unless \-f/\-\-force is specified, \%\fBhg phase\fP\: won\(aqt move changeset from a +lower phase to an higher phase. Phases are ordered as follows: +.sp +.nf +.ft C +public < draft < secret +.ft P +.fi +.sp +Return 0 on success, 1 if no phases were changed or some could not +be changed. +.sp +Options: +.INDENT 0.0 +.TP +.B \-p, \-\-public +. +set changeset phase to public +.TP +.B \-d, \-\-draft +. +set changeset phase to draft +.TP +.B \-s, \-\-secret +. +set changeset phase to secret +.TP +.B \-f, \-\-force +. +allow to move boundary backward +.TP +.B \-r, \-\-rev +. +target revision +.UNINDENT +.SS pull +.sp +.nf +.ft C +hg pull [\-u] [\-f] [\-r REV]... [\-e CMD] [\-\-remotecmd CMD] [SOURCE] +.ft P +.fi +.sp +Pull changes from a remote repository to a local one. +.sp +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. +.sp +Use \%\fBhg incoming\fP\: 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 \%\fBhg pull +\-r X\fP\: where \fBX\fP is the last changeset listed by \%\fBhg incoming\fP\:. +.sp +If SOURCE is omitted, the \(aqdefault\(aq path will be used. +See \%\fBhg help urls\fP\: for more information. +.sp +Returns 0 on success, 1 if an update had unresolved files. +.sp +Options: +.INDENT 0.0 +.TP +.B \-u, \-\-update +. +update to new branch head if changesets were pulled +.TP +.B \-f, \-\-force +. +run even when remote repository is unrelated +.TP +.B \-r, \-\-rev +. +a remote changeset intended to be added +.TP +.B \-B, \-\-bookmark +. +bookmark to pull +.TP +.B \-b, \-\-branch +. +a specific branch you would like to pull +.TP +.B \-e, \-\-ssh +. +specify ssh command to use +.TP +.B \-\-remotecmd +. +specify hg command to run on the remote side +.TP +.B \-\-insecure +. +do not verify server certificate (ignoring web.cacerts config) +.UNINDENT +.SS push +.sp +.nf +.ft C +hg push [\-f] [\-r REV]... [\-e CMD] [\-\-remotecmd CMD] [DEST] +.ft P +.fi +.sp +Push changesets from the local repository to the specified +destination. +.sp +This operation is symmetrical to pull: it is identical to a pull +in the destination repository from the current one. +.sp +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. +.sp +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. +.sp +Use \-f/\-\-force to override the default behavior and push all +changesets on all branches. +.sp +If \-r/\-\-rev is used, the specified revision and all its ancestors +will be pushed to the remote repository. +.sp +If \-B/\-\-bookmark is used, the specified bookmarked revision, its +ancestors, and the bookmark will be pushed to the remote +repository. +.sp +Please see \%\fBhg help urls\fP\: for important details about \fBssh://\fP +URLs. If DESTINATION is omitted, a default path will be used. +.sp +Returns 0 if push was successful, 1 if nothing to push. +.sp +Options: +.INDENT 0.0 +.TP +.B \-f, \-\-force +. +force push +.TP +.B \-r, \-\-rev +. +a changeset intended to be included in the destination +.TP +.B \-B, \-\-bookmark +. +bookmark to push +.TP +.B \-b, \-\-branch +. +a specific branch you would like to push +.TP +.B \-\-new\-branch +. +allow pushing a new branch +.TP +.B \-e, \-\-ssh +. +specify ssh command to use +.TP +.B \-\-remotecmd +. +specify hg command to run on the remote side +.TP +.B \-\-insecure +. +do not verify server certificate (ignoring web.cacerts config) +.UNINDENT +.SS recover +.sp +.nf +.ft C +hg recover +.ft P +.fi +.sp +Recover from an interrupted commit or pull. +.sp +This command tries to fix the repository status after an +interrupted operation. It should only be necessary when Mercurial +suggests it. +.sp +Returns 0 if successful, 1 if nothing to recover or verify fails. +.SS remove +.sp +.nf +.ft C +hg remove [OPTION]... FILE... +.ft P +.fi +.sp +Schedule the indicated files for removal from the current branch. +.sp +This command schedules the files to be removed at the next commit. +To undo a remove before that, see \%\fBhg revert\fP\:. To undo added +files, see \%\fBhg forget\fP\:. +.sp +\-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. +.sp +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 \%\fBhg status\fP\:). The actions are Warn, Remove +(from branch) and Delete (from disk): +.TS +center; +|l|l|l|l|l|. +_ +T{ +T} T{ +T} T{ +T} T{ +T} T{ +T} +_ +T{ +none +T} T{ +W +T} T{ +RD +T} T{ +W +T} T{ +R +T} +_ +T{ +\-f +T} T{ +R +T} T{ +RD +T} T{ +RD +T} T{ +R +T} +_ +T{ +\-A +T} T{ +W +T} T{ +W +T} T{ +W +T} T{ +R +T} +_ +T{ +\-Af +T} T{ +R +T} T{ +R +T} T{ +R +T} T{ +R +T} +_ +.TE +.sp +Note that remove never deletes files in Added [A] state from the +working directory, not even if option \-\-force is specified. +.sp +Returns 0 on success, 1 if any warnings encountered. +.sp +Options: +.INDENT 0.0 +.TP +.B \-A, \-\-after +. +record delete for missing files +.TP +.B \-f, \-\-force +. +remove (and delete) file even if added or modified +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.sp +aliases: rm +.UNINDENT +.SS rename +.sp +.nf +.ft C +hg rename [OPTION]... SOURCE... DEST +.ft P +.fi +.sp +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. +.sp +By default, this command copies the contents of files as they +exist in the working directory. If invoked with \-A/\-\-after, the +operation is recorded, but no copying is performed. +.sp +This command takes effect at the next commit. To undo a rename +before that, see \%\fBhg revert\fP\:. +.sp +Returns 0 on success, 1 if errors are encountered. +.sp +Options: +.INDENT 0.0 +.TP +.B \-A, \-\-after +. +record a rename that has already occurred +.TP +.B \-f, \-\-force +. +forcibly copy over an existing managed file +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.TP +.B \-n, \-\-dry\-run +. +do not perform actions, just print output +.sp +aliases: move mv +.UNINDENT +.SS resolve +.sp +.nf +.ft C +hg resolve [OPTION]... [FILE]... +.ft P +.fi +.sp +Merges with unresolved conflicts are often the result of +non\-interactive merging using the \fBinternal:merge\fP configuration +setting, or a command\-line merge tool like \fBdiff3\fP. The resolve +command is used to manage the files involved in a merge, after +\%\fBhg merge\fP\: has been run, and before \%\fBhg commit\fP\: is run (i.e. the +working directory must have two parents). See \%\fBhg help +merge\-tools\fP\: for information on configuring merge tools. +.sp +The resolve command can be used in the following ways: +.INDENT 0.0 +.IP \(bu 2 +. +\%\fBhg resolve [\-\-tool TOOL] FILE...\fP\:: attempt to re\-merge the specified +files, discarding any previous merge attempts. Re\-merging is not +performed for files already marked as resolved. Use \fB\-\-all/\-a\fP +to select all unresolved files. \fB\-\-tool\fP 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 \fB.orig\fP suffix. +.IP \(bu 2 +. +\%\fBhg resolve \-m [FILE]\fP\:: mark a file as having been resolved +(e.g. after having manually fixed\-up the files). The default is +to mark all unresolved files. +.IP \(bu 2 +. +\%\fBhg resolve \-u [FILE]...\fP\:: mark a file as unresolved. The +default is to mark all resolved files. +.IP \(bu 2 +. +\%\fBhg resolve \-l\fP\:: list files which had or still have conflicts. +In the printed list, \fBU\fP = unresolved and \fBR\fP = resolved. +.UNINDENT +.sp +Note that Mercurial will not let you commit files with unresolved +merge conflicts. You must use \%\fBhg resolve \-m ...\fP\: before you can +commit after a conflicting merge. +.sp +Returns 0 on success, 1 if any files fail a resolve attempt. +.sp +Options: +.INDENT 0.0 +.TP +.B \-a, \-\-all +. +select all unresolved files +.TP +.B \-l, \-\-list +. +list state of files needing merge +.TP +.B \-m, \-\-mark +. +mark files as resolved +.TP +.B \-u, \-\-unmark +. +mark files as unresolved +.TP +.B \-n, \-\-no\-status +. +hide status prefix +.TP +.B \-t, \-\-tool +. +specify merge tool +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.UNINDENT +.SS revert +.sp +.nf +.ft C +hg revert [OPTION]... [\-r REV] [NAME]... +.ft P +.fi +.IP Note +. +To check out earlier revisions, you should use \%\fBhg update REV\fP\:. +To cancel an uncommitted merge (and lose your changes), use +\%\fBhg update \-\-clean .\fP\:. +.RE +.sp +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. +.sp +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 \%\fBhg backout\fP\: for a +related method. +.sp +Modified files are saved with a .orig suffix before reverting. +To disable these backups, use \-\-no\-backup. +.sp +See \%\fBhg help dates\fP\: for a list of formats valid for \-d/\-\-date. +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-a, \-\-all +. +revert all changes when no arguments given +.TP +.B \-d, \-\-date +. +tipmost revision matching date +.TP +.B \-r, \-\-rev +. +revert to the specified revision +.TP +.B \-C, \-\-no\-backup +. +do not save backup copies of files +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.TP +.B \-n, \-\-dry\-run +. +do not perform actions, just print output +.UNINDENT +.SS rollback +.sp +.nf +.ft C +hg rollback +.ft P +.fi +.sp +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. +.sp +Transactions are used to encapsulate the effects of all commands +that create new changesets or propagate existing changesets into a +repository. +.sp +For example, the following commands are transactional, and their +effects can be rolled back: +.INDENT 0.0 +.IP \(bu 2 +. +commit +.IP \(bu 2 +. +import +.IP \(bu 2 +. +pull +.IP \(bu 2 +. +push (with this repository as the destination) +.IP \(bu 2 +. +unbundle +.UNINDENT +.sp +To avoid permanent data loss, rollback will refuse to rollback a +commit transaction if it isn\(aqt checked out. Use \-\-force to +override this protection. +.sp +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. +.sp +Returns 0 on success, 1 if no rollback data is available. +.sp +Options: +.INDENT 0.0 +.TP +.B \-n, \-\-dry\-run +. +do not perform actions, just print output +.TP +.B \-f, \-\-force +. +ignore safety measures +.UNINDENT +.SS root +.sp +.nf +.ft C +hg root +.ft P +.fi +.sp +Print the root directory of the current repository. +.sp +Returns 0 on success. +.SS serve +.sp +.nf +.ft C +hg serve [OPTION]... +.ft P +.fi +.sp +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. +.sp +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 \fBweb.allow_push\fP +option to \fB*\fP to allow everybody to push to the server. You +should use a real web server if you need to authenticate users. +.sp +By default, the server logs accesses to stdout and errors to +stderr. Use the \-A/\-\-accesslog and \-E/\-\-errorlog options to log to +files. +.sp +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. +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-A, \-\-accesslog +. +name of access log file to write to +.TP +.B \-d, \-\-daemon +. +run server in background +.TP +.B \-\-daemon\-pipefds +. +used internally by daemon mode +.TP +.B \-E, \-\-errorlog +. +name of error log file to write to +.TP +.B \-p, \-\-port +. +port to listen on (default: 8000) +.TP +.B \-a, \-\-address +. +address to listen on (default: all interfaces) +.TP +.B \-\-prefix +. +prefix path to serve from (default: server root) +.TP +.B \-n, \-\-name +. +name to show in web pages (default: working directory) +.TP +.B \-\-web\-conf +. +name of the hgweb config file (see "hg help hgweb") +.TP +.B \-\-webdir\-conf +. +name of the hgweb config file (DEPRECATED) +.TP +.B \-\-pid\-file +. +name of file to write process ID to +.TP +.B \-\-stdio +. +for remote clients +.TP +.B \-\-cmdserver +. +for remote clients +.TP +.B \-t, \-\-templates +. +web templates to use +.TP +.B \-\-style +. +template style to use +.TP +.B \-6, \-\-ipv6 +. +use IPv6 in addition to IPv4 +.TP +.B \-\-certificate +. +SSL certificate file +.UNINDENT +.SS showconfig +.sp +.nf +.ft C +hg showconfig [\-u] [NAME]... +.ft P +.fi +.sp +With no arguments, print names and values of all config items. +.sp +With one argument of the form section.name, print just the value +of that config item. +.sp +With multiple arguments, print names and values of all config +items with matching section names. +.sp +With \-\-debug, the source (filename and line number) is printed +for each config item. +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-u, \-\-untrusted +. +show untrusted configuration options +.sp +aliases: debugconfig +.UNINDENT +.SS status +.sp +.nf +.ft C +hg status [OPTION]... [FILE]... +.ft P +.fi +.sp +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. +.sp +Option \-q/\-\-quiet hides untracked (unknown and ignored) files +unless explicitly requested with \-u/\-\-unknown or \-i/\-\-ignored. +.IP Note +. +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. +.RE +.sp +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. +.sp +The codes used to show the status of files are: +.sp +.nf +.ft C +M = modified +A = added +R = removed +C = clean +! = missing (deleted by non\-hg command, but still tracked) +? = not tracked +I = ignored + = origin of the previous file listed as A (added) +.ft P +.fi +.sp +Examples: +.INDENT 0.0 +.IP \(bu 2 +. +show changes in the working directory relative to a +changeset: +.sp +.nf +.ft C +hg status \-\-rev 9353 +.ft P +.fi +.IP \(bu 2 +. +show all changes including copies in an existing changeset: +.sp +.nf +.ft C +hg status \-\-copies \-\-change 9353 +.ft P +.fi +.IP \(bu 2 +. +get a NUL separated list of added files, suitable for xargs: +.sp +.nf +.ft C +hg status \-an0 +.ft P +.fi +.UNINDENT +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-A, \-\-all +. +show status of all files +.TP +.B \-m, \-\-modified +. +show only modified files +.TP +.B \-a, \-\-added +. +show only added files +.TP +.B \-r, \-\-removed +. +show only removed files +.TP +.B \-d, \-\-deleted +. +show only deleted (but tracked) files +.TP +.B \-c, \-\-clean +. +show only files without changes +.TP +.B \-u, \-\-unknown +. +show only unknown (not tracked) files +.TP +.B \-i, \-\-ignored +. +show only ignored files +.TP +.B \-n, \-\-no\-status +. +hide status prefix +.TP +.B \-C, \-\-copies +. +show source of copied files +.TP +.B \-0, \-\-print0 +. +end filenames with NUL, for use with xargs +.TP +.B \-\-rev +. +show difference from revision +.TP +.B \-\-change +. +list the changed files of a revision +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.TP +.B \-S, \-\-subrepos +. +recurse into subrepositories +.sp +aliases: st +.UNINDENT +.SS summary +.sp +.nf +.ft C +hg summary [\-\-remote] +.ft P +.fi +.sp +This generates a brief summary of the working directory state, +including parents, branch, commit status, and available updates. +.sp +With the \-\-remote option, this will check the default paths for +incoming and outgoing changes. This can be time\-consuming. +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-\-remote +. +check for push and pull +.sp +aliases: sum +.UNINDENT +.SS tag +.sp +.nf +.ft C +hg tag [\-f] [\-l] [\-m TEXT] [\-d DATE] [\-u USER] [\-r REV] NAME... +.ft P +.fi +.sp +Name a particular revision using <name>. +.sp +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. +.sp +If no revision is given, the parent of the working directory is +used, or tip if no revision is checked out. +.sp +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). +.sp +Tag commits are usually made at the head of a branch. If the parent +of the working directory is not a branch head, \%\fBhg tag\fP\: aborts; use +\-f/\-\-force to force the tag commit to be based on a non\-head +changeset. +.sp +See \%\fBhg help dates\fP\: for a list of formats valid for \-d/\-\-date. +.sp +Since tag names have priority over branch names during revision +lookup, using an existing branch name as a tag name is discouraged. +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-f, \-\-force +. +force tag +.TP +.B \-l, \-\-local +. +make the tag local +.TP +.B \-r, \-\-rev +. +revision to tag +.TP +.B \-\-remove +. +remove a tag +.TP +.B \-e, \-\-edit +. +edit commit message +.TP +.B \-m, \-\-message +. +use <text> as commit message +.TP +.B \-d, \-\-date +. +record the specified date as commit date +.TP +.B \-u, \-\-user +. +record the specified user as committer +.UNINDENT +.SS tags +.sp +.nf +.ft C +hg tags +.ft P +.fi +.sp +This lists both regular and local tags. When the \-v/\-\-verbose +switch is used, a third column "local" is printed for local tags. +.sp +Returns 0 on success. +.SS tip +.sp +.nf +.ft C +hg tip [\-p] [\-g] +.ft P +.fi +.sp +The tip revision (usually just called the tip) is the changeset +most recently added to the repository (and therefore the most +recently changed head). +.sp +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. +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-p, \-\-patch +. +show patch +.TP +.B \-g, \-\-git +. +use git extended diff format +.TP +.B \-\-style +. +display using template map file +.TP +.B \-\-template +. +display with template +.UNINDENT +.SS unbundle +.sp +.nf +.ft C +hg unbundle [\-u] FILE... +.ft P +.fi +.sp +Apply one or more compressed changegroup files generated by the +bundle command. +.sp +Returns 0 on success, 1 if an update has unresolved files. +.sp +Options: +.INDENT 0.0 +.TP +.B \-u, \-\-update +. +update to new branch head if changesets were unbundled +.UNINDENT +.SS update +.sp +.nf +.ft C +hg update [\-c] [\-C] [\-d DATE] [[\-r] REV] +.ft P +.fi +.sp +Update the repository\(aqs working directory to the specified +changeset. If no changeset is specified, update to the tip of the +current named branch and move the current bookmark (see \%\fBhg help +bookmarks\fP\:). +.sp +Update sets the working directory\(aqs parent revison to the specified +changeset (see \%\fBhg help parents\fP\:). +.sp +If the changeset is not a descendant or ancestor of the working +directory\(aqs 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. +.sp +The following rules apply when the working directory contains +uncommitted changes: +.INDENT 0.0 +.IP 1. 3 +. +If neither \-c/\-\-check nor \-C/\-\-clean is specified, and if +the requested changeset is an ancestor or descendant of +the working directory\(aqs 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. +.IP 2. 3 +. +With the \-c/\-\-check option, the update is aborted and the +uncommitted changes are preserved. +.IP 3. 3 +. +With the \-C/\-\-clean option, uncommitted changes are discarded and +the working directory is updated to the requested changeset. +.UNINDENT +.sp +To cancel an uncommitted merge (and lose your changes), use +\%\fBhg update \-\-clean .\fP\:. +.sp +Use null as the changeset to remove the working directory (like +\%\fBhg clone \-U\fP\:). +.sp +If you want to revert just one file to an older revision, use +\%\fBhg revert [\-r REV] NAME\fP\:. +.sp +See \%\fBhg help dates\fP\: for a list of formats valid for \-d/\-\-date. +.sp +Returns 0 on success, 1 if there are unresolved files. +.sp +Options: +.INDENT 0.0 +.TP +.B \-C, \-\-clean +. +discard uncommitted changes (no backup) +.TP +.B \-c, \-\-check +. +update across branches if no uncommitted changes +.TP +.B \-d, \-\-date +. +tipmost revision matching date +.TP +.B \-r, \-\-rev +. +revision +.sp +aliases: up checkout co +.UNINDENT +.SS verify +.sp +.nf +.ft C +hg verify +.ft P +.fi +.sp +Verify the integrity of the current repository. +.sp +This will perform an extensive check of the repository\(aqs +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. +.sp +Returns 0 on success, 1 if errors are encountered. +.SS version +.sp +.nf +.ft C +hg version +.ft P +.fi +.sp +output version and copyright information +.SH DATE FORMATS +.sp +Some commands allow the user to specify a date, e.g.: +.INDENT 0.0 +.IP \(bu 2 +. +backout, commit, import, tag: Specify the commit date. +.IP \(bu 2 +. +log, revert, update: Select revision(s) by date. +.UNINDENT +.sp +Many date formats are valid. Here are some examples: +.INDENT 0.0 +.IP \(bu 2 +. +\fBWed Dec 6 13:18:29 2006\fP (local timezone assumed) +.IP \(bu 2 +. +\fBDec 6 13:18 \-0600\fP (year assumed, time offset provided) +.IP \(bu 2 +. +\fBDec 6 13:18 UTC\fP (UTC and GMT are aliases for +0000) +.IP \(bu 2 +. +\fBDec 6\fP (midnight) +.IP \(bu 2 +. +\fB13:18\fP (today assumed) +.IP \(bu 2 +. +\fB3:39\fP (3:39AM assumed) +.IP \(bu 2 +. +\fB3:39pm\fP (15:39) +.IP \(bu 2 +. +\fB2006\-12\-06 13:18:29\fP (ISO 8601 format) +.IP \(bu 2 +. +\fB2006\-12\-6 13:18\fP +.IP \(bu 2 +. +\fB2006\-12\-6\fP +.IP \(bu 2 +. +\fB12\-6\fP +.IP \(bu 2 +. +\fB12/6\fP +.IP \(bu 2 +. +\fB12/6/6\fP (Dec 6 2006) +.UNINDENT +.sp +Lastly, there is Mercurial\(aqs internal format: +.INDENT 0.0 +.IP \(bu 2 +. +\fB1165432709 0\fP (Wed Dec 6 13:18:29 2006 UTC) +.UNINDENT +.sp +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). +.sp +The log command also accepts date ranges: +.INDENT 0.0 +.IP \(bu 2 +. +\fB<DATE\fP \- at or before a given date/time +.IP \(bu 2 +. +\fB>DATE\fP \- on or after a given date/time +.IP \(bu 2 +. +\fBDATE to DATE\fP \- a date range, inclusive +.IP \(bu 2 +. +\fB\-DAYS\fP \- within a given number of days of today +.UNINDENT +.SH DIFF FORMATS +.sp +Mercurial\(aqs 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. +.sp +While this standard format is often enough, it does not encode the +following information: +.INDENT 0.0 +.IP \(bu 2 +. +executable status and other permission bits +.IP \(bu 2 +. +copy or rename information +.IP \(bu 2 +. +changes in binary files +.IP \(bu 2 +. +creation or deletion of empty files +.UNINDENT +.sp +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. +.sp +This means that when generating diffs from a Mercurial repository +(e.g. with \%\fBhg export\fP\:), 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\(aqs internal operations (like push and +pull) are not affected by this, because they use an internal binary +format for communicating changes. +.sp +To make Mercurial produce the git extended diff format, use the \-\-git +option available for many commands, or set \(aqgit = True\(aq 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. +.SH ENVIRONMENT VARIABLES +.INDENT 0.0 +.TP +.B HG +. +Path to the \(aqhg\(aq executable, automatically passed when running +hooks, extensions or external tools. If unset or empty, this is +the hg executable\(aqs name if it\(aqs frozen, or an executable named +\(aqhg\(aq (with %PATHEXT% [defaulting to COM/EXE/BAT/CMD] extensions on +Windows) is searched. +.TP +.B HGEDITOR +. +This is the name of the editor to run when committing. See EDITOR. +.sp +(deprecated, use configuration file) +.TP +.B HGENCODING +. +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. +.TP +.B HGENCODINGMODE +. +This sets Mercurial\(aqs behavior for handling unknown characters +while transcoding user input. The default is "strict", which +causes Mercurial to abort if it can\(aqt 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. +.TP +.B HGENCODINGAMBIGUOUS +. +This sets Mercurial\(aqs 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. +.TP +.B HGMERGE +. +An executable to use for resolving merge conflicts. The program +will be executed with three arguments: local file, remote file, +ancestor file. +.sp +(deprecated, use configuration file) +.TP +.B HGRCPATH +. +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. +.sp +For each element in HGRCPATH: +.INDENT 7.0 +.IP \(bu 2 +. +if it\(aqs a directory, all files ending with .rc are added +.IP \(bu 2 +. +otherwise, the file itself will be added +.UNINDENT +.TP +.B HGPLAIN +. +When set, this disables any configuration settings that might +change Mercurial\(aqs 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. +.sp +Equivalent options set via command line flags or environment +variables are not overridden. +.TP +.B HGPLAINEXCEPT +. +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. +.sp +Setting HGPLAINEXCEPT to anything (even an empty string) will +enable plain mode. +.TP +.B HGUSER +. +This is the string used as the author of a commit. If not set, +available values will be considered in this order: +.INDENT 7.0 +.IP \(bu 2 +. +HGUSER (deprecated) +.IP \(bu 2 +. +configuration files from the HGRCPATH +.IP \(bu 2 +. +EMAIL +.IP \(bu 2 +. +interactive prompt +.IP \(bu 2 +. +LOGNAME (with \fB@hostname\fP appended) +.UNINDENT +.sp +(deprecated, use configuration file) +.TP +.B EMAIL +. +May be used as the author of a commit; see HGUSER. +.TP +.B LOGNAME +. +May be used as the author of a commit; see HGUSER. +.TP +.B VISUAL +. +This is the name of the editor to use when committing. See EDITOR. +.TP +.B EDITOR +. +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 \(aqvi\(aq. +.TP +.B PYTHONPATH +. +This is used by Python to find imported modules and may need to be +set appropriately if this Mercurial is not installed system\-wide. +.UNINDENT +.SH USING ADDITIONAL FEATURES +.sp +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. +.sp +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. +.sp +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: +.sp +.nf +.ft C +[extensions] +foo = +.ft P +.fi +.sp +You may also specify the full path to an extension: +.sp +.nf +.ft C +[extensions] +myfeature = ~/.hgext/myfeature.py +.ft P +.fi +.sp +To explicitly disable an extension enabled in a configuration file of +broader scope, prepend its path with !: +.sp +.nf +.ft C +[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 = ! +.ft P +.fi +.sp +disabled extensions: +.INDENT 0.0 +.INDENT 3.5 +.INDENT 0.0 +.TP +.B acl +. +hooks for controlling repository access +.TP +.B bugzilla +. +hooks for integrating with the Bugzilla bug tracker +.TP +.B children +. +command to display child changesets (DEPRECATED) +.TP +.B churn +. +command to display statistics about repository history +.TP +.B color +. +colorize output from some commands +.TP +.B convert +. +import revisions from foreign VCS repositories into Mercurial +.TP +.B eol +. +automatically manage newlines in repository files +.TP +.B extdiff +. +command to allow external programs to compare revisions +.TP +.B factotum +. +http authentication with factotum +.TP +.B fetch +. +pull, update and merge in one command (DEPRECATED) +.TP +.B gpg +. +commands to sign and verify changesets +.TP +.B graphlog +. +command to view revision graphs from a shell +.TP +.B hgcia +. +hooks for integrating with the CIA.vc notification service +.TP +.B hgk +. +browse the repository in a graphical way +.TP +.B highlight +. +syntax highlighting for hgweb (requires Pygments) +.TP +.B histedit +. +interactive history editing +.TP +.B inotify +. +accelerate status report using Linux\(aqs inotify service +.TP +.B interhg +. +expand expressions into changelog and summaries +.TP +.B keyword +. +expand keywords in tracked files +.TP +.B largefiles +. +track large binary files +.TP +.B mq +. +manage a stack of patches +.TP +.B notify +. +hooks for sending email push notifications +.TP +.B pager +. +browse command output with an external pager +.TP +.B patchbomb +. +command to send changesets as (a series of) patch emails +.TP +.B progress +. +show progress bars for some actions +.TP +.B purge +. +command to delete untracked files from the working directory +.TP +.B rebase +. +command to move sets of revisions to a different ancestor +.TP +.B record +. +commands to interactively select changes for commit/qrefresh +.TP +.B relink +. +recreates hardlinks between repository clones +.TP +.B schemes +. +extend schemes with shortcuts to repository swarms +.TP +.B share +. +share a common history between several working directories +.TP +.B transplant +. +command to transplant changesets from another branch +.TP +.B win32mbcs +. +allow the use of MBCS paths with problematic encodings +.TP +.B win32text +. +perform automatic newline conversion +.TP +.B zeroconf +. +discover and advertise repositories on the local network +.UNINDENT +.UNINDENT +.UNINDENT +.SH SPECIFYING FILE SETS +.sp +Mercurial supports a functional language for selecting a set of +files. +.sp +Like other file patterns, this pattern type is indicated by a prefix, +\(aqset:\(aq. The language supports a number of predicates which are joined +by infix operators. Parenthesis can be used for grouping. +.sp +Identifiers such as filenames or patterns must be quoted with single +or double quotes if they contain characters outside of +\fB[.*{}[]?/\e_a\-zA\-Z0\-9\ex80\-\exff]\fP or if they match one of the +predefined predicates. This generally applies to file patterns other +than globs and arguments for predicates. +.sp +Special characters can be used in quoted identifiers by escaping them, +e.g., \fB\en\fP is interpreted as a newline. To prevent them from being +interpreted, strings can be prefixed with \fBr\fP, e.g. \fBr\(aq...\(aq\fP. +.sp +There is a single prefix operator: +.INDENT 0.0 +.TP +.B \fBnot x\fP +.sp +Files not in x. Short form is \fB! x\fP. +.UNINDENT +.sp +These are the supported infix operators: +.INDENT 0.0 +.TP +.B \fBx and y\fP +.sp +The intersection of files in x and y. Short form is \fBx & y\fP. +.TP +.B \fBx or y\fP +.sp +The union of files in x and y. There are two alternative short +forms: \fBx | y\fP and \fBx + y\fP. +.TP +.B \fBx \- y\fP +.sp +Files in x but not in y. +.UNINDENT +.sp +The following predicates are supported: +.INDENT 0.0 +.TP +.B \fBadded()\fP +.sp +File that is added according to status. +.TP +.B \fBbinary()\fP +.sp +File that appears to be binary (contains NUL bytes). +.TP +.B \fBclean()\fP +.sp +File that is clean according to status. +.TP +.B \fBcopied()\fP +.sp +File that is recorded as being copied. +.TP +.B \fBdeleted()\fP +.sp +File that is deleted according to status. +.TP +.B \fBencoding(name)\fP +.sp +File can be successfully decoded with the given character +encoding. May not be useful for encodings other than ASCII and +UTF\-8. +.TP +.B \fBexec()\fP +.sp +File that is marked as executable. +.TP +.B \fBgrep(regex)\fP +.sp +File contains the given regular expression. +.TP +.B \fBhgignore()\fP +.sp +File that matches the active .hgignore pattern. +.TP +.B \fBignored()\fP +.sp +File that is ignored according to status. These files will only be +considered if this predicate is used. +.TP +.B \fBmodified()\fP +.sp +File that is modified according to status. +.TP +.B \fBremoved()\fP +.sp +File that is removed according to status. +.TP +.B \fBresolved()\fP +.sp +File that is marked resolved according to the resolve state. +.TP +.B \fBsize(expression)\fP +.sp +File size matches the given expression. Examples: +.INDENT 7.0 +.IP \(bu 2 +. +1k (files from 1024 to 2047 bytes) +.IP \(bu 2 +. +< 20k (files less than 20480 bytes) +.IP \(bu 2 +. +>= .5MB (files at least 524288 bytes) +.IP \(bu 2 +. +4k \- 1MB (files from 4096 bytes to 1048576 bytes) +.UNINDENT +.TP +.B \fBsubrepo([pattern])\fP +.sp +Subrepositories whose paths match the given pattern. +.TP +.B \fBsymlink()\fP +.sp +File that is marked as a symlink. +.TP +.B \fBunknown()\fP +.sp +File that is unknown according to status. These files will only be +considered if this predicate is used. +.TP +.B \fBunresolved()\fP +.sp +File that is marked unresolved according to the resolve state. +.UNINDENT +.sp +Some sample queries: +.INDENT 0.0 +.IP \(bu 2 +. +Show status of files that appear to be binary in the working directory: +.sp +.nf +.ft C +hg status \-A "set:binary()" +.ft P +.fi +.IP \(bu 2 +. +Forget files that are in .hgignore but are already tracked: +.sp +.nf +.ft C +hg forget "set:hgignore() and not ignored()" +.ft P +.fi +.IP \(bu 2 +. +Find text files that contain a string: +.sp +.nf +.ft C +hg locate "set:grep(magic) and not binary()" +.ft P +.fi +.IP \(bu 2 +. +Find C files in a non\-standard encoding: +.sp +.nf +.ft C +hg locate "set:**.c and not encoding(\(aqUTF\-8\(aq)" +.ft P +.fi +.IP \(bu 2 +. +Revert copies of large binary files: +.sp +.nf +.ft C +hg revert "set:copied() and binary() and size(\(aq>1M\(aq)" +.ft P +.fi +.IP \(bu 2 +. +Remove files listed in foo.lst that contain the letter a or b: +.sp +.nf +.ft C +hg remove "set: \(aqlistfile:foo.lst\(aq and (**a* or **b*)" +.ft P +.fi +.UNINDENT +.sp +See also \%\fBhg help patterns\fP\:. +.SH GLOSSARY +.INDENT 0.0 +.TP +.B Ancestor +. +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: \(aqDescendant\(aq. +.TP +.B Bookmark +. +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 \%\fBhg update\fP\:. Unlike tags, bookmarks move along +when you make a commit. +.sp +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. +.TP +.B Branch +. +(Noun) A child changeset that has been created from a parent that +is not a head. These are known as topological branches, see +\(aqBranch, topological\(aq. If a topological branch is named, it becomes +a named branch. If a topological branch is not named, it becomes +an anonymous branch. See \(aqBranch, anonymous\(aq and \(aqBranch, named\(aq. +.sp +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. +.sp +Example: "The experimental branch". +.sp +(Verb) The action of creating a child changeset which results in +its parent having more than one child. +.sp +Example: "I\(aqm going to branch at X". +.TP +.B Branch, anonymous +. +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. +.TP +.B Branch, closed +. +A named branch whose branch heads have all been closed. +.TP +.B Branch, default +. +The branch assigned to a changeset when no name has previously been +assigned. +.TP +.B Branch head +. +See \(aqHead, branch\(aq. +.TP +.B Branch, inactive +. +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 \%\fBhg branches\fP\: command +shows inactive branches by default, though they can be hidden with +\%\fBhg branches \-\-active\fP\:. +.sp +NOTE: this concept is deprecated because it is too implicit. +Branches should now be explicitly closed using \%\fBhg commit +\-\-close\-branch\fP\: when they are no longer needed. +.TP +.B Branch, named +. +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 \%\fBhg help branch\fP\:, \%\fBhg help branches\fP\: and +\%\fBhg commit \-\-close\-branch\fP\: for more information on managing +branches. +.sp +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. +.TP +.B Branch tip +. +See \(aqTip, branch\(aq. +.TP +.B Branch, topological +. +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. +.TP +.B Changelog +. +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. +.TP +.B Changeset +. +A snapshot of the state of the repository used to record a change. +.TP +.B Changeset, child +. +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. +.TP +.B Changeset id +. +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. +.TP +.B Changeset, merge +. +A changeset with two parents. This occurs when a merge is +committed. +.TP +.B Changeset, parent +. +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. +.TP +.B Checkout +. +(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. +.sp +Example: "I\(aqm using checkout X." +.sp +(Verb) Updating the working directory to a specific changeset. See +\%\fBhg help update\fP\:. +.sp +Example: "I\(aqm going to check out changeset X." +.TP +.B Child changeset +. +See \(aqChangeset, child\(aq. +.TP +.B Close changeset +. +See \(aqHead, closed branch\(aq +.TP +.B Closed branch +. +See \(aqBranch, closed\(aq. +.TP +.B Clone +. +(Noun) An entire or partial copy of a repository. The partial +clone must be in the form of a revision and its ancestors. +.sp +Example: "Is your clone up to date?". +.sp +(Verb) The process of creating a clone, using \%\fBhg clone\fP\:. +.sp +Example: "I\(aqm going to clone the repository". +.TP +.B Closed branch head +. +See \(aqHead, closed branch\(aq. +.TP +.B Commit +. +(Noun) A synonym for changeset. +.sp +Example: "Is the bug fixed in your recent commit?" +.sp +(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. +.sp +Example: "You should commit those changes now." +.TP +.B Cset +. +A common abbreviation of the term changeset. +.TP +.B DAG +. +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 \%\fBhg glog\fP\: +(graphlog). In Mercurial, the DAG is limited by the requirement +for children to have at most two parents. +.TP +.B Default branch +. +See \(aqBranch, default\(aq. +.TP +.B Descendant +. +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: \(aqAncestor\(aq. +.TP +.B Diff +. +(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". +.sp +Example: "Did you see my correction in the diff?" +.sp +(Verb) Diffing two changesets is the action of creating a diff or +patch. +.sp +Example: "If you diff with changeset X, you will see what I mean." +.TP +.B Directory, working +. +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 +\(aqParent, working directory\(aq. 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. +.TP +.B Draft +. +Changesets in the draft phase have not been shared with publishing +repositories and may thus be safely changed by history\-modifying +extensions. See \%\fBhg help phases\fP\:. +.TP +.B Graph +. +See DAG and \%\fBhg help graphlog\fP\:. +.TP +.B Head +. +The term \(aqhead\(aq may be used to refer to both a branch head or a +repository head, depending on the context. See \(aqHead, branch\(aq and +\(aqHead, repository\(aq for specific definitions. +.sp +Heads are where development generally takes place and are the +usual targets for update and merge operations. +.TP +.B Head, branch +. +A changeset with no descendants on the same named branch. +.TP +.B Head, closed branch +. +A changeset that marks a head as no longer interesting. The closed +head is no longer listed by \%\fBhg heads\fP\:. A branch is considered +closed when all its heads are closed and consequently is not +listed by \%\fBhg branches\fP\:. +.sp +Closed heads can be re\-opened by committing new changeset as the +child of the changeset that marks a head as closed. +.TP +.B Head, repository +. +A topological head which has not been closed. +.TP +.B Head, topological +. +A changeset with no children in the repository. +.TP +.B History, immutable +. +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. +.TP +.B History, rewriting +. +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. +.TP +.B Immutable history +. +See \(aqHistory, immutable\(aq. +.TP +.B Merge changeset +. +See \(aqChangeset, merge\(aq. +.TP +.B Manifest +. +Each changeset has a manifest, which is the list of files that are +tracked by the changeset. +.TP +.B Merge +. +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. +.TP +.B Named branch +. +See \(aqBranch, named\(aq. +.TP +.B Null changeset +. +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 \(aqnull\(aq +or by the changeset ID \(aq000000000000\(aq. +.TP +.B Parent +. +See \(aqChangeset, parent\(aq. +.TP +.B Parent changeset +. +See \(aqChangeset, parent\(aq. +.TP +.B Parent, working directory +. +The working directory parent reflects a virtual revision which is +the child of the changeset (or two changesets with an uncommitted +merge) shown by \%\fBhg parents\fP\:. This is changed with +\%\fBhg update\fP\:. Other commands to see the working directory parent +are \%\fBhg summary\fP\: and \%\fBhg id\fP\:. Can be specified by the alias ".". +.TP +.B Patch +. +(Noun) The product of a diff operation. +.sp +Example: "I\(aqve sent you my patch." +.sp +(Verb) The process of using a patch file to transform one +changeset into another. +.sp +Example: "You will need to patch that revision." +.TP +.B Phase +. +A per\-changeset state tracking how the changeset has been or +should be shared. See \%\fBhg help phases\fP\:. +.TP +.B Public +. +Changesets in the public phase have been shared with publishing +repositories and are therefore considered immutable. See \%\fBhg help +phases\fP\:. +.TP +.B Pull +. +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 \%\fBhg help pull\fP\:. +.TP +.B Push +. +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 \%\fBhg help push\fP\:. +.TP +.B Repository +. +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 \fB.hg\fP +subdirectory of a working directory. Any recorded state can be +recreated by "updating" a working directory to a specific +changeset. +.TP +.B Repository head +. +See \(aqHead, repository\(aq. +.TP +.B Revision +. +A state of the repository at some point in time. Earlier revisions +can be updated to by using \%\fBhg update\fP\:. See also \(aqRevision +number\(aq; See also \(aqChangeset\(aq. +.TP +.B Revision number +. +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 +\(aqChangeset id\(aq. +.TP +.B Revlog +. +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. +.TP +.B Rewriting history +. +See \(aqHistory, rewriting\(aq. +.TP +.B Root +. +A changeset that has only the null changeset as its parent. Most +repositories have only a single root changeset. +.TP +.B Secret +. +Changesets in the secret phase may not be shared via push, pull, +or clone. See \%\fBhg help phases\fP\:. +.TP +.B Tag +. +An alternative name given to a changeset. Tags can be used in all +places where Mercurial expects a changeset ID, e.g., with +\%\fBhg update\fP\:. The creation of a tag is stored in the history and +will thus automatically be shared with other using push and pull. +.TP +.B Tip +. +The changeset with the highest revision number. It is the changeset +most recently added in a repository. +.TP +.B Tip, branch +. +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 \(aqBranch, head\(aq. Note that because revision +numbers may be different in different repository clones, the +branch tip may be different in different cloned repositories. +.TP +.B Update +. +(Noun) Another synonym of changeset. +.sp +Example: "I\(aqve pushed an update". +.sp +(Verb) This term is usually used to describe updating the state of +the working directory to that of a specific changeset. See +\%\fBhg help update\fP\:. +.sp +Example: "You should update". +.TP +.B Working directory +. +See \(aqDirectory, working\(aq. +.TP +.B Working directory parent +. +See \(aqParent, working directory\(aq. +.UNINDENT +.SH SYNTAX FOR MERCURIAL IGNORE FILES +.SS Synopsis +.sp +The Mercurial system uses a file called \fB.hgignore\fP in the root +directory of a repository to control its behavior when it searches +for files that it is not currently tracking. +.SS Description +.sp +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 \fB.hgignore\fP file in +the root of the working directory. The \fB.hgignore\fP 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. +.sp +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 \fB.hgignore\fP. +.sp +For example, say we have an untracked file, \fBfile.c\fP, at +\fBa/b/file.c\fP inside our repository. Mercurial will ignore \fBfile.c\fP +if any pattern in \fB.hgignore\fP matches \fBa/b/file.c\fP, \fBa/b\fP or \fBa\fP. +.sp +In addition, a Mercurial configuration file can reference a set of +per\-user or global ignore files. See the \fBignore\fP configuration +key on the \fB[ui]\fP section of \%\fBhg help config\fP\: for details of how to +configure these files. +.sp +To control Mercurial\(aqs handling of files that it manages, many +commands support the \fB\-I\fP and \fB\-X\fP options; see +\%\fBhg help <command>\fP\: and \%\fBhg help patterns\fP\: for details. +.sp +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 \%\fBhg add X\fP\:, even if X would be excluded by a pattern +in .hgignore. +.SS Syntax +.sp +An ignore file is a plain text file consisting of a list of patterns, +with one pattern per line. Empty lines are skipped. The \fB#\fP +character is treated as a comment character, and the \fB\e\fP character +is treated as an escape character. +.sp +Mercurial supports several pattern syntaxes. The default syntax used +is Python/Perl\-style regular expressions. +.sp +To change the syntax used, use a line of the following form: +.sp +.nf +.ft C +syntax: NAME +.ft P +.fi +.sp +where \fBNAME\fP is one of the following: +.INDENT 0.0 +.TP +.B \fBregexp\fP +.sp +Regular expression, Python/Perl syntax. +.TP +.B \fBglob\fP +.sp +Shell\-style glob. +.UNINDENT +.sp +The chosen syntax stays in effect when parsing all patterns that +follow, until another syntax is selected. +.sp +Neither glob nor regexp patterns are rooted. A glob\-syntax pattern of +the form \fB*.c\fP will match a file ending in \fB.c\fP in any directory, +and a regexp pattern of the form \fB\e.c$\fP will do the same. To root a +regexp pattern, start it with \fB^\fP. +.IP Note +. +Patterns specified in other than \fB.hgignore\fP are always rooted. +Please see \%\fBhg help patterns\fP\: for details. +.RE +.SS Example +.sp +Here is an example ignore file. +.sp +.nf +.ft C +# use glob syntax. +syntax: glob + +*.elc +*.pyc +*~ + +# switch to regexp syntax. +syntax: regexp +^\e.pc/ +.ft P +.fi +.SH CONFIGURING HGWEB +.sp +Mercurial\(aqs 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 \%\fBhg serve\fP\:, \fBhgweb.wsgi\fP, +\fBhgweb.cgi\fP and \fBhgweb.fcgi\fP. +.sp +This file uses the same syntax as other Mercurial configuration files +but recognizes only the following sections: +.INDENT 0.0 +.INDENT 3.5 +.INDENT 0.0 +.IP \(bu 2 +. +web +.IP \(bu 2 +. +paths +.IP \(bu 2 +. +collections +.UNINDENT +.UNINDENT +.UNINDENT +.sp +The \fBweb\fP options are thorougly described in \%\fBhg help config\fP\:. +.sp +The \fBpaths\fP 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. +.sp +The left hand side is the path in the URL. Note that hgweb reserves +subpaths like \fBrev\fP or \fBfile\fP, try using different names for +nested repositories to avoid confusing effects. +.sp +The right hand side is the path in the filesystem. If the specified +path ends with \fB*\fP or \fB**\fP the filesystem will be searched +recursively for repositories below that point. +With \fB*\fP it will not recurse into the repositories it finds (except for +\fB.hg/patches\fP). +With \fB**\fP it will also search inside repository working directories +and possibly find subrepositories. +.sp +In this example: +.sp +.nf +.ft C +[paths] +/projects/a = /srv/tmprepos/a +/projects/b = c:/repos/b +/ = /srv/repos/* +/user/bob = /home/bob/repos/** +.ft P +.fi +.INDENT 0.0 +.IP \(bu 2 +. +The first two entries make two repositories in different directories +appear under the same directory in the web interface +.IP \(bu 2 +. +The third entry will publish every Mercurial repository found in +\fB/srv/repos/\fP, for instance the repository \fB/srv/repos/quux/\fP +will appear as \fBhttp://server/quux/\fP +.IP \(bu 2 +. +The fourth entry will publish both \fBhttp://server/user/bob/quux/\fP +and \fBhttp://server/user/bob/quux/testsubrepo/\fP +.UNINDENT +.sp +The \fBcollections\fP section is deprecated and has been superseeded by +\fBpaths\fP. +.SH MERGE TOOLS +.sp +To merge files Mercurial uses merge tools. +.sp +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. +.sp +Merge tools are used both for \%\fBhg resolve\fP\:, \%\fBhg merge\fP\:, \%\fBhg update\fP\:, +\%\fBhg backout\fP\: and in several extensions. +.sp +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. +.SS Available merge tools +.sp +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. +.sp +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. +.sp +There are some internal merge tools which can be used. The internal +merge tools are: +.INDENT 0.0 +.TP +.B \fBinternal:dump\fP +.sp +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 +\fBa.txt\fP, these files will accordingly be named \fBa.txt.local\fP, +\fBa.txt.other\fP and \fBa.txt.base\fP and they will be placed in the +same directory as \fBa.txt\fP. +.TP +.B \fBinternal:fail\fP +.sp +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. +.TP +.B \fBinternal:local\fP +.sp +Uses the local version of files as the merged version. +.TP +.B \fBinternal:merge\fP +.sp +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. +.TP +.B \fBinternal:other\fP +.sp +Uses the other version of files as the merged version. +.TP +.B \fBinternal:prompt\fP +.sp +Asks the user which of the local or the other version to keep as +the merged version. +.UNINDENT +.sp +Internal tools are always available and do not require a GUI but will by default +not handle symlinks or binary files. +.SS Choosing a merge tool +.sp +Mercurial uses these rules when deciding which merge tool to use: +.INDENT 0.0 +.IP 1. 3 +. +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. +.IP 2. 3 +. +If the \fBHGMERGE\fP environment variable is present, its value is used and +must be executable by the shell. +.IP 3. 3 +. +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. +.IP 4. 3 +. +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. +.IP 5. 3 +. +If any usable merge tools are present in the merge\-tools configuration +section, the one with the highest priority is used. +.IP 6. 3 +. +If a program named \fBhgmerge\fP can be found on the system, it is used \- but +it will by default not be used for symlinks and binary files. +.IP 7. 3 +. +If the file to be merged is not binary and is not a symlink, then +\fBinternal:merge\fP is used. +.IP 8. 3 +. +The merge of the file fails and must be resolved before commit. +.UNINDENT +.IP Note +. +After selecting a merge program, Mercurial will by default attempt +to merge the files using a simple merge algorithm first. Only if it doesn\(aqt +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. +.RE +.sp +See the merge\-tools and ui sections of hgrc(5) for details on the +configuration of merge tools. +.SH SPECIFYING MULTIPLE REVISIONS +.sp +When Mercurial accepts more than one revision, they may be specified +individually, or provided as a topologically continuous range, +separated by the ":" character. +.sp +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". +.sp +If BEGIN is greater than END, revisions are treated in reverse order. +.sp +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. +.SH FILE NAME PATTERNS +.sp +Mercurial accepts several notations for identifying one or more files +at a time. +.sp +By default, Mercurial treats filenames as shell\-style extended glob +patterns. +.sp +Alternate pattern notations must be specified explicitly. +.IP Note +. +Patterns specified in \fB.hgignore\fP are not rooted. +Please see \%\fBhg help hgignore\fP\: for details. +.RE +.sp +To use a plain path name without any pattern matching, start it with +\fBpath:\fP. These path names must completely match starting at the +current repository root. +.sp +To use an extended glob, start a name with \fBglob:\fP. Globs are rooted +at the current directory; a glob such as \fB*.c\fP will only match files +in the current directory ending with \fB.c\fP. +.sp +The supported glob syntax extensions are \fB**\fP to match any string +across path separators and \fB{a,b}\fP to mean "a or b". +.sp +To use a Perl/Python regular expression, start a name with \fBre:\fP. +Regexp pattern matching is anchored at the root of the repository. +.sp +To read name patterns from a file, use \fBlistfile:\fP or \fBlistfile0:\fP. +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. +.sp +Plain examples: +.sp +.nf +.ft C +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" +.ft P +.fi +.sp +Glob examples: +.sp +.nf +.ft C +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. +.ft P +.fi +.sp +Regexp examples: +.sp +.nf +.ft C +re:.*\e.c$ any name ending in ".c", anywhere in the repository +.ft P +.fi +.sp +File examples: +.sp +.nf +.ft C +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 +.ft P +.fi +.sp +See also \%\fBhg help filesets\fP\:. +.SH WORKING WITH PHASES +.SS What are phases? +.sp +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). +.sp +Each changeset in a repository is in one of the following phases: +.INDENT 0.0 +.INDENT 3.5 +.INDENT 0.0 +.IP \(bu 2 +. +public : changeset is visible on a public server +.IP \(bu 2 +. +draft : changeset is not yet published +.IP \(bu 2 +. +secret : changeset should not be pushed, pulled, or cloned +.UNINDENT +.UNINDENT +.UNINDENT +.sp +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. +.SS How are phases managed? +.sp +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. +.sp +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 \%\fBhg phase\fP\: command +if needed. See \%\fBhg help \-v phase\fP\: for examples. +.SS Phases and servers +.sp +Normally, all servers are \fBpublishing\fP by default. This means: +.sp +.nf +.ft C +\- 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 +.ft P +.fi +.IP Note +. +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. +.RE +.sp +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: +.sp +.nf +.ft C +[phases] +publish = False +.ft P +.fi +.sp +See \%\fBhg help config\fP\: for more information on config files. +.IP Note +. +Servers running older versions of Mercurial are treated as +publishing. +.RE +.SS Examples +.INDENT 0.0 +.INDENT 3.5 +.INDENT 0.0 +.IP \(bu 2 +. +list changesets in draft or secret phase: +.sp +.nf +.ft C +hg log \-r "not public()" +.ft P +.fi +.IP \(bu 2 +. +change all secret changesets to draft: +.sp +.nf +.ft C +hg phase \-\-draft "secret()" +.ft P +.fi +.IP \(bu 2 +. +forcibly move the current changeset and descendants from public to draft: +.sp +.nf +.ft C +hg phase \-\-force \-\-draft . +.ft P +.fi +.IP \(bu 2 +. +show a list of changeset revision and phase: +.sp +.nf +.ft C +hg log \-\-template "{rev} {phase}\en" +.ft P +.fi +.IP \(bu 2 +. +resynchronize draft changesets relative to a remote repository: +.sp +.nf +.ft C +hg phase \-fd \(aqoutgoing(URL)\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.sp +See \%\fBhg help phase\fP\: for more information on manually manipulating phases. +.SH SPECIFYING SINGLE REVISIONS +.sp +Mercurial supports several ways to specify individual revisions. +.sp +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. +.sp +A 40\-digit hexadecimal string is treated as a unique revision +identifier. +.sp +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. +.sp +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 revision +of that branch. Bookmark, tag, and branch names must not contain the ":" +character. +.sp +The reserved name "tip" always identifies the most recent revision. +.sp +The reserved name "null" indicates the null revision. This is the +revision of an empty repository, and the parent of revision 0. +.sp +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. +.SH SPECIFYING REVISION SETS +.sp +Mercurial supports a functional language for selecting a set of +revisions. +.sp +The language supports a number of predicates which are joined by infix +operators. Parenthesis can be used for grouping. +.sp +Identifiers such as branch names may need quoting with single or +double quotes if they contain characters like \fB\-\fP or if they match +one of the predefined predicates. +.sp +Special characters can be used in quoted identifiers by escaping them, +e.g., \fB\en\fP is interpreted as a newline. To prevent them from being +interpreted, strings can be prefixed with \fBr\fP, e.g. \fBr\(aq...\(aq\fP. +.sp +There is a single prefix operator: +.INDENT 0.0 +.TP +.B \fBnot x\fP +.sp +Changesets not in x. Short form is \fB! x\fP. +.UNINDENT +.sp +These are the supported infix operators: +.INDENT 0.0 +.TP +.B \fBx::y\fP +.sp +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 \fBancestors(y)\fP, if the second +is left out it is equivalent to \fBdescendants(x)\fP. +.sp +An alternative syntax is \fBx..y\fP. +.TP +.B \fBx:y\fP +.sp +All changesets with revision numbers between x and y, both +inclusive. Either endpoint can be left out, they default to 0 and +tip. +.TP +.B \fBx and y\fP +.sp +The intersection of changesets in x and y. Short form is \fBx & y\fP. +.TP +.B \fBx or y\fP +.sp +The union of changesets in x and y. There are two alternative short +forms: \fBx | y\fP and \fBx + y\fP. +.TP +.B \fBx \- y\fP +.sp +Changesets in x but not in y. +.TP +.B \fBx^n\fP +.sp +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. +.TP +.B \fBx~n\fP +.sp +The nth first ancestor of x; \fBx~0\fP is x; \fBx~3\fP is \fBx^^^\fP. +.UNINDENT +.sp +There is a single postfix operator: +.INDENT 0.0 +.TP +.B \fBx^\fP +.sp +Equivalent to \fBx^1\fP, the first parent of each changeset in x. +.UNINDENT +.sp +The following predicates are supported: +.INDENT 0.0 +.TP +.B \fBadds(pattern)\fP +.sp +Changesets that add a file matching pattern. +.TP +.B \fBall()\fP +.sp +All changesets, the same as \fB0:tip\fP. +.TP +.B \fBancestor(single, single)\fP +.sp +Greatest common ancestor of the two changesets. +.TP +.B \fBancestors(set)\fP +.sp +Changesets that are ancestors of a changeset in set. +.TP +.B \fBauthor(string)\fP +.sp +Alias for \fBuser(string)\fP. +.TP +.B \fBbisect(string)\fP +.sp +Changesets marked in the specified bisect status: +.INDENT 7.0 +.IP \(bu 2 +. +\fBgood\fP, \fBbad\fP, \fBskip\fP: csets explicitly marked as good/bad/skip +.IP \(bu 2 +. +\fBgoods\fP, \fBbads\fP : csets topologicaly good/bad +.IP \(bu 2 +. +\fBrange\fP : csets taking part in the bisection +.IP \(bu 2 +. +\fBpruned\fP : csets that are goods, bads or skipped +.IP \(bu 2 +. +\fBuntested\fP : csets whose fate is yet unknown +.IP \(bu 2 +. +\fBignored\fP : csets ignored due to DAG topology +.IP \(bu 2 +. +\fBcurrent\fP : the cset currently being bisected +.UNINDENT +.TP +.B \fBbookmark([name])\fP +.sp +The named bookmark or all bookmarks. +.sp +If \fIname\fP starts with \fIre:\fP, the remainder of the name is treated as +a regular expression. To match a bookmark that actually starts with \fIre:\fP, +use the prefix \fIliteral:\fP. +.TP +.B \fBbranch(string or set)\fP +.sp +All changesets belonging to the given branch or the branches of the given +changesets. +.sp +If \fIstring\fP starts with \fIre:\fP, the remainder of the name is treated as +a regular expression. To match a branch that actually starts with \fIre:\fP, +use the prefix \fIliteral:\fP. +.TP +.B \fBchildren(set)\fP +.sp +Child changesets of changesets in set. +.TP +.B \fBclosed()\fP +.sp +Changeset is closed. +.TP +.B \fBcontains(pattern)\fP +.sp +Revision contains a file matching pattern. See \%\fBhg help patterns\fP\: +for information about file patterns. +.TP +.B \fBconverted([id])\fP +.sp +Changesets converted from the given identifier in the old repository if +present, or all converted changesets if no identifier is specified. +.TP +.B \fBdate(interval)\fP +.sp +Changesets within the interval, see \%\fBhg help dates\fP\:. +.TP +.B \fBdesc(string)\fP +.sp +Search commit message for string. The match is case\-insensitive. +.TP +.B \fBdescendants(set)\fP +.sp +Changesets which are descendants of changesets in set. +.TP +.B \fBdestination([set])\fP +.sp +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(). +.TP +.B \fBdraft()\fP +.sp +Changeset in draft phase. +.TP +.B \fBextinct()\fP +.sp +Obsolete changesets with obsolete descendants only. +.TP +.B \fBextra(label, [value])\fP +.sp +Changesets with the given label in the extra metadata, with the given +optional value. +.sp +If \fIvalue\fP starts with \fIre:\fP, the remainder of the value is treated as +a regular expression. To match a value that actually starts with \fIre:\fP, +use the prefix \fIliteral:\fP. +.TP +.B \fBfile(pattern)\fP +.sp +Changesets affecting files matched by pattern. +.sp +For a faster but less accurate result, consider using \fBfilelog()\fP +instead. +.TP +.B \fBfilelog(pattern)\fP +.sp +Changesets connected to the specified filelog. +.sp +For performance reasons, \fBfilelog()\fP does not show every changeset +that affects the requested file(s). See \%\fBhg help log\fP\: for details. For +a slower, more accurate result, use \fBfile()\fP. +.TP +.B \fBfirst(set, [n])\fP +.sp +An alias for limit(). +.TP +.B \fBfollow([file])\fP +.sp +An alias for \fB::.\fP (ancestors of the working copy\(aqs first parent). +If a filename is specified, the history of the given file is followed, +including copies. +.TP +.B \fBgrep(regex)\fP +.sp +Like \fBkeyword(string)\fP but accepts a regex. Use \fBgrep(r\(aq...\(aq)\fP +to ensure special escape characters are handled correctly. Unlike +\fBkeyword(string)\fP, the match is case\-sensitive. +.TP +.B \fBhead()\fP +.sp +Changeset is a named branch head. +.TP +.B \fBheads(set)\fP +.sp +Members of set with no children in set. +.TP +.B \fBid(string)\fP +.sp +Revision non\-ambiguously specified by the given hex string prefix. +.TP +.B \fBkeyword(string)\fP +.sp +Search commit message, user name, and names of changed files for +string. The match is case\-insensitive. +.TP +.B \fBlast(set, [n])\fP +.sp +Last n members of set, defaulting to 1. +.TP +.B \fBlimit(set, [n])\fP +.sp +First n members of set, defaulting to 1. +.TP +.B \fBmatching(revision [, field])\fP +.sp +Changesets in which a given set of fields match the set of fields in the +selected revision or set. +.sp +To match more than one field pass the list of fields to match separated +by spaces (e.g. \fBauthor description\fP). +.sp +Valid fields are most regular revision fields and some special fields. +.sp +Regular revision fields are \fBdescription\fP, \fBauthor\fP, \fBbranch\fP, +\fBdate\fP, \fBfiles\fP, \fBphase\fP, \fBparents\fP, \fBsubstate\fP, \fBuser\fP +and \fBdiff\fP. +Note that \fBauthor\fP and \fBuser\fP are synonyms. \fBdiff\fP refers to the +contents of the revision. Two revisions matching their \fBdiff\fP will +also match their \fBfiles\fP. +.sp +Special fields are \fBsummary\fP and \fBmetadata\fP: +\fBsummary\fP matches the first line of the description. +\fBmetadata\fP is equivalent to matching \fBdescription user date\fP +(i.e. it matches the main metadata fields). +.sp +\fBmetadata\fP is the default field which is used when no fields are +specified. You can match more than one field at a time. +.TP +.B \fBmax(set)\fP +.sp +Changeset with highest revision number in set. +.TP +.B \fBmerge()\fP +.sp +Changeset is a merge changeset. +.TP +.B \fBmin(set)\fP +.sp +Changeset with lowest revision number in set. +.TP +.B \fBmodifies(pattern)\fP +.sp +Changesets modifying files matched by pattern. +.TP +.B \fBobsolete()\fP +.sp +Mutable changeset with a newer version. +.TP +.B \fBorigin([set])\fP +.sp +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. +.TP +.B \fBoutgoing([path])\fP +.sp +Changesets not found in the specified destination repository, or the +default push location. +.TP +.B \fBp1([set])\fP +.sp +First parent of changesets in set, or the working directory. +.TP +.B \fBp2([set])\fP +.sp +Second parent of changesets in set, or the working directory. +.TP +.B \fBparents([set])\fP +.sp +The set of all parents for all changesets in set, or the working directory. +.TP +.B \fBpresent(set)\fP +.sp +An empty set, if any revision in set isn\(aqt found; otherwise, +all revisions in set. +.sp +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. +.TP +.B \fBpublic()\fP +.sp +Changeset in public phase. +.TP +.B \fBremote([id [,path]])\fP +.sp +Local revision that corresponds to the given identifier in a +remote repository, if present. Here, the \(aq.\(aq identifier is a +synonym for the current local branch. +.TP +.B \fBremoves(pattern)\fP +.sp +Changesets which remove files matching pattern. +.TP +.B \fBrev(number)\fP +.sp +Revision with the given numeric identifier. +.TP +.B \fBreverse(set)\fP +.sp +Reverse order of set. +.TP +.B \fBroots(set)\fP +.sp +Changesets in set with no parent changeset in set. +.TP +.B \fBsecret()\fP +.sp +Changeset in secret phase. +.TP +.B \fBsort(set[, [\-]key...])\fP +.sp +Sort set by keys. The default sort order is ascending, specify a key +as \fB\-key\fP to sort in descending order. +.sp +The keys can be: +.INDENT 7.0 +.IP \(bu 2 +. +\fBrev\fP for the revision number, +.IP \(bu 2 +. +\fBbranch\fP for the branch name, +.IP \(bu 2 +. +\fBdesc\fP for the commit message (description), +.IP \(bu 2 +. +\fBuser\fP for user name (\fBauthor\fP can be used as an alias), +.IP \(bu 2 +. +\fBdate\fP for the commit date +.UNINDENT +.TP +.B \fBtag([name])\fP +.sp +The specified tag by name, or all tagged revisions if no name is given. +.TP +.B \fBunstable()\fP +.sp +Non\-obsolete changesets with obsolete ancestors. +.TP +.B \fBuser(string)\fP +.sp +User name contains string. The match is case\-insensitive. +.sp +If \fIstring\fP starts with \fIre:\fP, the remainder of the string is treated as +a regular expression. To match a user that actually contains \fIre:\fP, use +the prefix \fIliteral:\fP. +.UNINDENT +.sp +New predicates (known as "aliases") can be defined, using any combination of +existing predicates or other aliases. An alias definition looks like: +.sp +.nf +.ft C +<alias> = <definition> +.ft P +.fi +.sp +in the \fBrevsetalias\fP section of a Mercurial configuration file. Arguments +of the form \fI$1\fP, \fI$2\fP, etc. are substituted from the alias into the +definition. +.sp +For example, +.sp +.nf +.ft C +[revsetalias] +h = heads() +d($1) = sort($1, date) +rs($1, $2) = reverse(sort($1, $2)) +.ft P +.fi +.sp +defines three aliases, \fBh\fP, \fBd\fP, and \fBrs\fP. \fBrs(0:tip, author)\fP is +exactly equivalent to \fBreverse(sort(0:tip, author))\fP. +.sp +Command line equivalents for \%\fBhg log\fP\:: +.sp +.nf +.ft C +\-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) +.ft P +.fi +.sp +Some sample queries: +.INDENT 0.0 +.IP \(bu 2 +. +Changesets on the default branch: +.sp +.nf +.ft C +hg log \-r "branch(default)" +.ft P +.fi +.IP \(bu 2 +. +Changesets on the default branch since tag 1.5 (excluding merges): +.sp +.nf +.ft C +hg log \-r "branch(default) and 1.5:: and not merge()" +.ft P +.fi +.IP \(bu 2 +. +Open branch heads: +.sp +.nf +.ft C +hg log \-r "head() and not closed()" +.ft P +.fi +.IP \(bu 2 +. +Changesets between tags 1.3 and 1.5 mentioning "bug" that affect +\fBhgext/*\fP: +.sp +.nf +.ft C +hg log \-r "1.3::1.5 and keyword(bug) and file(\(aqhgext/*\(aq)" +.ft P +.fi +.IP \(bu 2 +. +Changesets committed in May 2008, sorted by user: +.sp +.nf +.ft C +hg log \-r "sort(date(\(aqMay 2008\(aq), user)" +.ft P +.fi +.IP \(bu 2 +. +Changesets mentioning "bug" or "issue" that are not in a tagged +release: +.sp +.nf +.ft C +hg log \-r "(keyword(bug) or keyword(issue)) and not ancestors(tagged())" +.ft P +.fi +.UNINDENT +.SH SUBREPOSITORIES +.sp +Subrepositories let you nest external repositories or projects into a +parent Mercurial repository, and make commands operate on them as a +group. +.sp +Mercurial currently supports Mercurial, Git, and Subversion +subrepositories. +.sp +Subrepositories are made of three components: +.INDENT 0.0 +.IP 1. 3 +. +Nested repository checkouts. They can appear anywhere in the +parent working directory. +.IP 2. 3 +. +Nested repository references. They are defined in \fB.hgsub\fP, which +should be placed in the root of working directory, and +tell where the subrepository checkouts come from. Mercurial +subrepositories are referenced like: +.INDENT 3.0 +.INDENT 3.5 +.sp +path/to/nested = \%https://example.com/nested/repo/path\: +.UNINDENT +.UNINDENT +.sp +Git and Subversion subrepos are also supported: +.INDENT 3.0 +.INDENT 3.5 +.sp +path/to/nested = [git]git://example.com/nested/repo/path +path/to/nested = [svn]https://example.com/nested/trunk/path +.UNINDENT +.UNINDENT +.sp +where \fBpath/to/nested\fP is the checkout location relatively to the +parent Mercurial root, and \fBhttps://example.com/nested/repo/path\fP +is the source repository path. The source can also reference a +filesystem path. +.sp +Note that \fB.hgsub\fP does not exist by default in Mercurial +repositories, you have to create and add it to the parent +repository before using subrepositories. +.IP 3. 3 +. +Nested repository states. They are defined in \fB.hgsubstate\fP, 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. +.IP Note +. +The \fB.hgsubstate\fP file should not be edited manually. +.RE +.UNINDENT +.SS Adding a Subrepository +.sp +If \fB.hgsub\fP 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 \fB.hgsub\fP and add the +subrepository entry as described above. At this point, the +subrepository is tracked and the next commit will record its state in +\fB.hgsubstate\fP and bind it to the committed changeset. +.SS Synchronizing a Subrepository +.sp +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. +.sp +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. +.SS Deleting a Subrepository +.sp +To remove a subrepository from the parent repository, delete its +reference from \fB.hgsub\fP, then remove its files. +.SS Interaction with Mercurial Commands +.INDENT 0.0 +.TP +.B add +. +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. +Git and Subversion subrepositories are currently silently +ignored. +.TP +.B archive +. +archive does not recurse in subrepositories unless +\-S/\-\-subrepos is specified. +.TP +.B commit +. +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 \%\fBhg help config\fP\:). After there are no +longer any modified subrepositories, it records their state and +finally commits it in the parent repository. +.TP +.B diff +. +diff does not recurse in subrepos unless \-S/\-\-subrepos is +specified. Changes are displayed as usual, on the subrepositories +elements. Git and Subversion subrepositories are currently +silently ignored. +.TP +.B forget +. +forget currently only handles exact file matches in subrepos. +Git and Subversion subrepositories are currently silently ignored. +.TP +.B incoming +. +incoming does not recurse in subrepos unless \-S/\-\-subrepos +is specified. Git and Subversion subrepositories are currently +silently ignored. +.TP +.B outgoing +. +outgoing does not recurse in subrepos unless \-S/\-\-subrepos +is specified. Git and Subversion subrepositories are currently +silently ignored. +.TP +.B pull +. +pull is not recursive since it is not clear what to pull prior +to running \%\fBhg update\fP\:. Listing and retrieving all +subrepositories changes referenced by the parent repository pulled +changesets is expensive at best, impossible in the Subversion +case. +.TP +.B push +. +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. +.TP +.B status +. +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. +.TP +.B update +. +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. +.UNINDENT +.SS Remapping Subrepositories Sources +.sp +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 \fBhgrc\fP +file or in Mercurial configuration. See the \fB[subpaths]\fP section in +hgrc(5) for more details. +.SH TEMPLATE USAGE +.sp +Mercurial allows you to customize output of commands through +templates. You can either pass in a template from the command +line, via the \-\-template option, or select an existing +template\-style (\-\-style). +.sp +You can customize output for any "log\-like" command: log, +outgoing, incoming, tip, parents, heads and glog. +.sp +Four styles are packaged with Mercurial: default (the style used +when no explicit preference is passed), compact, changelog, +and xml. +Usage: +.sp +.nf +.ft C +$ hg log \-r1 \-\-style changelog +.ft P +.fi +.sp +A template is a piece of text, with markup to invoke variable +expansion: +.sp +.nf +.ft C +$ hg log \-r1 \-\-template "{node}\en" +b56ce7b07c52de7d5fd79fb89701ea538af65746 +.ft P +.fi +.sp +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: +.INDENT 0.0 +.TP +.B author +. +String. The unmodified author of the changeset. +.TP +.B bisect +. +String. The changeset bisection status. +.TP +.B bookmarks +. +List of strings. Any bookmarks associated with the +changeset. +.TP +.B branch +. +String. The name of the branch on which the changeset was +committed. +.TP +.B branches +. +List of strings. The name of the branch on which the +changeset was committed. Will be empty if the branch name was +default. +.TP +.B children +. +List of strings. The children of the changeset. +.TP +.B date +. +Date information. The date when the changeset was committed. +.TP +.B desc +. +String. The text of the changeset description. +.TP +.B diffstat +. +String. Statistics of changes with the following format: +"modified files: +added/\-removed lines" +.TP +.B file_adds +. +List of strings. Files added by this changeset. +.TP +.B file_copies +. +List of strings. Files copied in this changeset with +their sources. +.TP +.B file_copies_switch +. +List of strings. Like "file_copies" but displayed +only if the \-\-copied switch is set. +.TP +.B file_dels +. +List of strings. Files removed by this changeset. +.TP +.B file_mods +. +List of strings. Files modified by this changeset. +.TP +.B files +. +List of strings. All files modified, added, or removed by this +changeset. +.TP +.B latesttag +. +String. Most recent global tag in the ancestors of this +changeset. +.TP +.B latesttagdistance +. +Integer. Longest path to the latest tag. +.TP +.B node +. +String. The changeset identification hash, as a 40 hexadecimal +digit string. +.TP +.B parents +. +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. +.TP +.B phase +. +String. The changeset phase name. +.TP +.B phaseidx +. +Integer. The changeset phase index. +.TP +.B rev +. +Integer. The repository\-local changeset revision number. +.TP +.B tags +. +List of strings. Any tags associated with the changeset. +.UNINDENT +.sp +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\(aqre +applying a string\-input filter to a list\-like input variable. +You can also use a chain of filters to get the desired output: +.sp +.nf +.ft C +$ hg tip \-\-template "{date|isodate}\en" +2008\-08\-21 18:22 +0000 +.ft P +.fi +.sp +List of filters: +.INDENT 0.0 +.TP +.B addbreaks +. +Any text. Add an XHTML "<br />" tag before the end of +every line except the last. +.TP +.B age +. +Date. Returns a human\-readable date/time difference between the +given date/time and the current date/time. +.TP +.B basename +. +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". +.TP +.B date +. +Date. Returns a date in a Unix date format, including the +timezone: "Mon Sep 04 15:13:13 2006 0700". +.TP +.B domain +. +Any text. Finds the first string that looks like an email +address, and extracts just the domain component. Example: \fBUser +<user@example.com>\fP becomes \fBexample.com\fP. +.TP +.B email +. +Any text. Extracts the first string that looks like an email +address. Example: \fBUser <user@example.com>\fP becomes +\fBuser@example.com\fP. +.TP +.B emailuser +. +Any text. Returns the user portion of an email address. +.TP +.B escape +. +Any text. Replaces the special XML/XHTML characters "&", "<" +and ">" with XML entities. +.TP +.B fill68 +. +Any text. Wraps the text to fit in 68 columns. +.TP +.B fill76 +. +Any text. Wraps the text to fit in 76 columns. +.TP +.B firstline +. +Any text. Returns the first line of text. +.TP +.B hex +. +Any text. Convert a binary Mercurial node identifier into +its long hexadecimal representation. +.TP +.B hgdate +. +Date. Returns the date as a pair of numbers: "1157407993 +25200" (Unix timestamp, timezone offset). +.TP +.B isodate +. +Date. Returns the date in ISO 8601 format: "2009\-08\-18 13:00 ++0200". +.TP +.B isodatesec +. +Date. Returns the date in ISO 8601 format, including +seconds: "2009\-08\-18 13:00:13 +0200". See also the rfc3339date +filter. +.TP +.B localdate +. +Date. Converts a date to local date. +.TP +.B nonempty +. +Any text. Returns \(aq(none)\(aq if the string is empty. +.TP +.B obfuscate +. +Any text. Returns the input text rendered as a sequence of +XML entities. +.TP +.B person +. +Any text. Returns the name before an email address, +interpreting it as per RFC 5322. +.TP +.B rfc3339date +. +Date. Returns a date using the Internet date format +specified in RFC 3339: "2009\-08\-18T13:00:13+02:00". +.TP +.B rfc822date +. +Date. Returns a date using the same format used in email +headers: "Tue, 18 Aug 2009 13:00:13 +0200". +.TP +.B short +. +Changeset hash. Returns the short form of a changeset hash, +i.e. a 12 hexadecimal digit string. +.TP +.B shortbisect +. +Any text. Treats \fItext\fP 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 \fItext\fP +is not a valid bisection status. +.TP +.B shortdate +. +Date. Returns a date like "2006\-09\-18". +.TP +.B stringify +. +Any type. Turns the value into text by converting values into +text and concatenating them. +.TP +.B strip +. +Any text. Strips all leading and trailing whitespace. +.TP +.B stripdir +. +Treat the text as path and strip a directory level, if +possible. For example, "foo" and "foo/bar" becomes "foo". +.TP +.B tabindent +. +Any text. Returns the text, with every line except the +first starting with a tab character. +.TP +.B urlescape +. +Any text. Escapes all "special" characters. For example, +"foo bar" becomes "foo%20bar". +.TP +.B user +. +Any text. Returns a short representation of a user name or email +address. +.UNINDENT +.SH URL PATHS +.sp +Valid URLs are of the form: +.sp +.nf +.ft C +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] +.ft P +.fi +.sp +Paths in the local filesystem can either point to Mercurial +repositories or to bundle files (as created by \%\fBhg bundle\fP\: or :hg:\(ga +incoming \-\-bundle\(ga). See also \%\fBhg help paths\fP\:. +.sp +An optional identifier after # indicates a particular branch, tag, or +changeset to use from the remote repository. See also \%\fBhg help +revisions\fP\:. +.sp +Some features, such as pushing to \%http://\: and \%https://\: URLs are only +possible if the feature is explicitly enabled on the remote Mercurial +server. +.sp +Note that the security of HTTPS URLs depends on proper configuration of +web.cacerts. +.sp +Some notes about using SSH with Mercurial: +.INDENT 0.0 +.IP \(bu 2 +. +SSH requires an accessible shell account on the destination machine +and a copy of hg in the remote path or specified with as remotecmd. +.IP \(bu 2 +. +path is relative to the remote user\(aqs home directory by default. Use +an extra slash at the start of a path to specify an absolute path: +.sp +.nf +.ft C +ssh://example.com//tmp/repository +.ft P +.fi +.IP \(bu 2 +. +Mercurial doesn\(aqt use its own compression via SSH; the right thing +to do is to configure it in your ~/.ssh/config, e.g.: +.sp +.nf +.ft C +Host *.mylocalnetwork.example.com + Compression no +Host * + Compression yes +.ft P +.fi +.sp +Alternatively specify "ssh \-C" as your ssh command in your +configuration file or with the \-\-ssh command line option. +.UNINDENT +.sp +These URLs can all be stored in your configuration file with path +aliases under the [paths] section like so: +.sp +.nf +.ft C +[paths] +alias1 = URL1 +alias2 = URL2 +\&... +.ft P +.fi +.sp +You can then use the alias for any command that uses a URL (for +example \%\fBhg pull alias1\fP\: will be treated as \%\fBhg pull URL1\fP\:). +.sp +Two path aliases are special because they are used as defaults when +you do not provide the URL to a command: +.INDENT 0.0 +.TP +.B default: +. +When you create a repository with hg clone, the clone command saves +the location of the source repository as the new repository\(aqs +\(aqdefault\(aq path. This is then used when you omit path from push\- and +pull\-like commands (including incoming and outgoing). +.TP +.B default\-push: +. +The push command will look for a path named \(aqdefault\-push\(aq, and +prefer it over \(aqdefault\(aq if both are defined. +.UNINDENT +.SH EXTENSIONS +.sp +This section contains help for extensions that are distributed together with Mercurial. Help for other extensions is available in the help system. +.SS acl +.sp +hooks for controlling repository access +.sp +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. +.sp +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). +.sp +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. +.sp +The order in which access checks are performed is: +.INDENT 0.0 +.IP 1. 3 +. +Deny list for branches (section \fBacl.deny.branches\fP) +.IP 2. 3 +. +Allow list for branches (section \fBacl.allow.branches\fP) +.IP 3. 3 +. +Deny list for paths (section \fBacl.deny\fP) +.IP 4. 3 +. +Allow list for paths (section \fBacl.allow\fP) +.UNINDENT +.sp +The allow and deny sections take key\-value pairs. +.SS Branch\-based Access Control +.sp +Use the \fBacl.deny.branches\fP and \fBacl.allow.branches\fP sections to +have branch\-based access control. Keys in these sections can be +either: +.INDENT 0.0 +.IP \(bu 2 +. +a branch name, or +.IP \(bu 2 +. +an asterisk, to match any branch; +.UNINDENT +.sp +The corresponding values can be either: +.INDENT 0.0 +.IP \(bu 2 +. +a comma\-separated list containing users and groups, or +.IP \(bu 2 +. +an asterisk, to match anyone; +.UNINDENT +.sp +You can add the "!" prefix to a user or group name to invert the sense +of the match. +.SS Path\-based Access Control +.sp +Use the \fBacl.deny\fP and \fBacl.allow\fP 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. +.SS Groups +.sp +Group names must be prefixed with an \fB@\fP symbol. Specifying a group +name has the same effect as specifying all the users in that group. +.sp +You can define group members in the \fBacl.groups\fP 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. +.SS Example Configuration +.sp +.nf +.ft C +[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 +.ft P +.fi +.SS Examples using the "!" prefix +.sp +Suppose there\(aqs a branch that only a given user (or group) should be able to +push to, and you don\(aqt want to restrict access to any other branch that may +be created. +.sp +The "!" prefix allows you to prevent anyone except a given user or group to +push changesets in a given branch or path. +.sp +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" +.sp +.nf +.ft C +[acl.allow.branches] +# Empty + +[acl.deny.branches] + +# 1) only \(aqgollum\(aq can commit to branch \(aqring\(aq; +# \(aqgollum\(aq and anyone else can still commit to any other branch. +ring = !gollum + +# 2) only members of the group \(aqhobbit\(aq can commit to branch \(aqlake\(aq; +# \(aqhobbit\(aq 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 \(aqgollum\(aq can change the file below; +# \(aqgollum\(aq and anyone else can still change any other file. +/misty/mountains/cave/ring = !gollum +.ft P +.fi +.SS bugzilla +.sp +hooks for integrating with the Bugzilla bug tracker +.sp +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. +.sp +The bug references can optionally include an update for Bugzilla of the +hours spent working on the bug. Bugs can also be marked fixed. +.sp +Three basic modes of access to Bugzilla are provided: +.INDENT 0.0 +.IP 1. 3 +. +Access via the Bugzilla XMLRPC interface. Requires Bugzilla 3.4 or later. +.IP 2. 3 +. +Check data via the Bugzilla XMLRPC interface and submit bug change +via email to Bugzilla email interface. Requires Bugzilla 3.4 or later. +.IP 3. 3 +. +Writing directly to the Bugzilla database. Only Bugzilla installations +using MySQL are supported. Requires Python MySQLdb. +.UNINDENT +.sp +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. +.sp +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. +.sp +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 recognised 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. +.sp +Configuration items common to all access modes: +.INDENT 0.0 +.TP +.B bugzilla.version +. +This access type to use. Values recognised are: +.INDENT 7.0 +.TP +.B \fBxmlrpc\fP +.sp +Bugzilla XMLRPC interface. +.TP +.B \fBxmlrpc+email\fP +.sp +Bugzilla XMLRPC and email interfaces. +.TP +.B \fB3.0\fP +.sp +MySQL access, Bugzilla 3.0 and later. +.TP +.B \fB2.18\fP +.sp +MySQL access, Bugzilla 2.18 and up to but not +including 3.0. +.TP +.B \fB2.16\fP +.sp +MySQL access, Bugzilla 2.16 and up to but not +including 2.18. +.UNINDENT +.TP +.B bugzilla.regexp +. +Regular expression to match bug IDs for update in changeset commit message. +It must contain one "()" named group \fB<ids>\fP containing the bug +IDs separated by non\-digit characters. It may also contain +a named group \fB<hours>\fP 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 \fBBug 1234\fP, \fBBug no. 1234\fP, +\fBBug number 1234\fP, \fBBugs 1234,5678\fP, \fBBug 1234 and 5678\fP and +variations thereof, followed by an hours number prefixed by \fBh\fP or +\fBhours\fP, e.g. \fBhours 1.5\fP. Matching is case insensitive. +.TP +.B bugzilla.fixregexp +. +Regular expression to match bug IDs for marking fixed in changeset +commit message. This must contain a "()" named group \fB<ids>\(ga containing +the bug IDs separated by non\-digit characters. It may also contain +a named group \(ga\(ga<hours>\fP 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 \fBFixes 1234\fP, \fBFixes bug 1234\fP, +\fBFixes bugs 1234,5678\fP, \fBFixes 1234 and 5678\fP and +variations thereof, followed by an hours number prefixed by \fBh\fP or +\fBhours\fP, e.g. \fBhours 1.5\fP. Matching is case insensitive. +.TP +.B bugzilla.fixstatus +. +The status to set a bug to when marking fixed. Default \fBRESOLVED\fP. +.TP +.B bugzilla.fixresolution +. +The resolution to set a bug to when marking fixed. Default \fBFIXED\fP. +.TP +.B bugzilla.style +. +The style file to use when formatting comments. +.TP +.B bugzilla.template +. +Template to use when formatting comments. Overrides style if +specified. In addition to the usual Mercurial keywords, the +extension specifies: +.INDENT 7.0 +.TP +.B \fB{bug}\fP +.sp +The Bugzilla bug ID. +.TP +.B \fB{root}\fP +.sp +The full pathname of the Mercurial repository. +.TP +.B \fB{webroot}\fP +.sp +Stripped pathname of the Mercurial repository. +.TP +.B \fB{hgweb}\fP +.sp +Base URL for browsing Mercurial repositories. +.UNINDENT +.sp +Default \fBchangeset {node|short} in repo {root} refers to bug +{bug}.\endetails:\en\et{desc|tabindent}\fP +.TP +.B bugzilla.strip +. +The number of path separator characters to strip from the front of +the Mercurial repository path (\fB{root}\fP in templates) to produce +\fB{webroot}\fP. For example, a repository with \fB{root}\fP +\fB/var/local/my\-project\fP with a strip of 2 gives a value for +\fB{webroot}\fP of \fBmy\-project\fP. Default 0. +.TP +.B web.baseurl +. +Base URL for browsing Mercurial repositories. Referenced from +templates as \fB{hgweb}\fP. +.UNINDENT +.sp +Configuration items common to XMLRPC+email and MySQL access modes: +.INDENT 0.0 +.TP +.B bugzilla.usermap +. +Path of file containing Mercurial committer email to Bugzilla user email +mappings. If specified, the file should contain one mapping per +line: +.sp +.nf +.ft C +committer = Bugzilla user +.ft P +.fi +.sp +See also the \fB[usermap]\fP section. +.UNINDENT +.sp +The \fB[usermap]\fP section is used to specify mappings of Mercurial +committer email to Bugzilla user email. See also \fBbugzilla.usermap\fP. +Contains entries of the form \fBcommitter = Bugzilla user\fP. +.sp +XMLRPC access mode configuration: +.INDENT 0.0 +.TP +.B bugzilla.bzurl +. +The base URL for the Bugzilla installation. +Default \fBhttp://localhost/bugzilla\fP. +.TP +.B bugzilla.user +. +The username to use to log into Bugzilla via XMLRPC. Default +\fBbugs\fP. +.TP +.B bugzilla.password +. +The password for Bugzilla login. +.UNINDENT +.sp +XMLRPC+email access mode uses the XMLRPC access mode configuration items, +and also: +.INDENT 0.0 +.TP +.B bugzilla.bzemail +. +The Bugzilla email address. +.UNINDENT +.sp +In addition, the Mercurial email settings must be configured. See the +documentation in hgrc(5), sections \fB[email]\fP and \fB[smtp]\fP. +.sp +MySQL access mode configuration: +.INDENT 0.0 +.TP +.B bugzilla.host +. +Hostname of the MySQL server holding the Bugzilla database. +Default \fBlocalhost\fP. +.TP +.B bugzilla.db +. +Name of the Bugzilla database in MySQL. Default \fBbugs\fP. +.TP +.B bugzilla.user +. +Username to use to access MySQL server. Default \fBbugs\fP. +.TP +.B bugzilla.password +. +Password to use to access MySQL server. +.TP +.B bugzilla.timeout +. +Database connection timeout (seconds). Default 5. +.TP +.B bugzilla.bzuser +. +Fallback Bugzilla user name to record comments with, if changeset +committer cannot be found as a Bugzilla user. +.TP +.B bugzilla.bzdir +. +Bugzilla install directory. Used by default notify. Default +\fB/var/www/html/bugzilla\fP. +.TP +.B bugzilla.notify +. +The command to run to get Bugzilla to send bug change notification +emails. Substitutes from a map with 3 keys, \fBbzdir\fP, \fBid\fP (bug +id) and \fBuser\fP (committer bugzilla email). Default depends on +version; from 2.18 it is "cd %(bzdir)s && perl \-T +contrib/sendbugmail.pl %(id)s %(user)s". +.UNINDENT +.sp +Activating the extension: +.sp +.nf +.ft C +[extensions] +bugzilla = + +[hooks] +# run bugzilla hook on every change pulled or pushed in here +incoming.bugzilla = python:hgext.bugzilla.hook +.ft P +.fi +.sp +Example configurations: +.sp +XMLRPC example configuration. This uses the Bugzilla at +\fBhttp://my\-project.org/bugzilla\fP, logging in as user +\fBbugmail@my\-project.org\fP with password \fBplugh\fP. It is used with a +collection of Mercurial repositories in \fB/var/local/hg/repos/\fP, +with a web interface at \fBhttp://my\-project.org/hg\fP. +.sp +.nf +.ft C +[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}\en + {desc}\en +strip=5 + +[web] +baseurl=http://my\-project.org/hg +.ft P +.fi +.sp +XMLRPC+email example configuration. This uses the Bugzilla at +\fBhttp://my\-project.org/bugzilla\fP, logging in as user +\fBbugmail@my\-project.org\fP with password \fBplugh\fP. It is used with a +collection of Mercurial repositories in \fB/var/local/hg/repos/\fP, +with a web interface at \fBhttp://my\-project.org/hg\fP. Bug comments +are sent to the Bugzilla email address +\fBbugzilla@my\-project.org\fP. +.sp +.nf +.ft C +[bugzilla] +bzurl=http://my\-project.org/bugzilla +user=bugmail@my\-project.org +password=plugh +version=xmlrpc +bzemail=bugzilla@my\-project.org +template=Changeset {node|short} in {root|basename}. + {hgweb}/{webroot}/rev/{node|short}\en + {desc}\en +strip=5 + +[web] +baseurl=http://my\-project.org/hg + +[usermap] +user@emaildomain.com=user.name@bugzilladomain.com +.ft P +.fi +.sp +MySQL example configuration. This has a local Bugzilla 3.2 installation +in \fB/opt/bugzilla\-3.2\fP. The MySQL database is on \fBlocalhost\fP, +the Bugzilla database name is \fBbugs\fP and MySQL is +accessed with MySQL username \fBbugs\fP password \fBXYZZY\fP. It is used +with a collection of Mercurial repositories in \fB/var/local/hg/repos/\fP, +with a web interface at \fBhttp://my\-project.org/hg\fP. +.sp +.nf +.ft C +[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}\en + {desc}\en +strip=5 + +[web] +baseurl=http://my\-project.org/hg + +[usermap] +user@emaildomain.com=user.name@bugzilladomain.com +.ft P +.fi +.sp +All the above add a comment to the Bugzilla bug record of the form: +.sp +.nf +.ft C +Changeset 3b16791d6642 in repository\-name. +http://my\-project.org/hg/repository\-name/rev/3b16791d6642 + +Changeset commit comment. Bug 1234. +.ft P +.fi +.SS children +.sp +command to display child changesets (DEPRECATED) +.sp +This extension is deprecated. You should use \%\fBhg log \-r +"children(REV)"\fP\: instead. +.SS Commands +.SS children +.sp +.nf +.ft C +hg children [\-r REV] [FILE] +.ft P +.fi +.sp +Print the children of the working directory\(aqs 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. +.sp +Options: +.INDENT 0.0 +.TP +.B \-r, \-\-rev +. +show children of the specified revision +.TP +.B \-\-style +. +display using template map file +.TP +.B \-\-template +. +display with template +.UNINDENT +.SS churn +.sp +command to display statistics about repository history +.SS Commands +.SS churn +.sp +.nf +.ft C +hg churn [\-d DATE] [\-r REV] [\-\-aliases FILE] [FILE] +.ft P +.fi +.sp +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. +.sp +Statistics are based on the number of changed lines, or +alternatively the number of matching revisions if the +\-\-changesets option is specified. +.sp +Examples: +.sp +.nf +.ft C +# display count of changed lines for every committer +hg churn \-t \(aq{author|email}\(aq + +# display daily activity graph +hg churn \-f \(aq%H\(aq \-s \-c + +# display activity of developers by month +hg churn \-f \(aq%Y\-%m\(aq \-s \-c + +# display count of lines changed in every year +hg churn \-f \(aq%Y\(aq \-s +.ft P +.fi +.sp +It is possible to map alternate email addresses to a main address +by providing a file using the following format: +.sp +.nf +.ft C +<alias email> = <actual email> +.ft P +.fi +.sp +Such a file may be specified with the \-\-aliases option, otherwise +a .hgchurn file will be looked for in the working directory root. +.sp +Options: +.INDENT 0.0 +.TP +.B \-r, \-\-rev +. +count rate for the specified revision or range +.TP +.B \-d, \-\-date +. +count rate for revisions matching date spec +.TP +.B \-t, \-\-template +. +template to group changesets (default: {author|email}) +.TP +.B \-f, \-\-dateformat +. +strftime\-compatible format for grouping by date +.TP +.B \-c, \-\-changesets +. +count rate by number of changesets +.TP +.B \-s, \-\-sort +. +sort by key (default: sort by count) +.TP +.B \-\-diffstat +. +display added/removed lines separately +.TP +.B \-\-aliases +. +file with email aliases +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.UNINDENT +.SS color +.sp +colorize output from some commands +.sp +This extension modifies the status and resolve commands to add color +to their output to reflect file status, the qseries command to add +color to reflect patch status (applied, unapplied, missing), and to +diff\-related commands to highlight additions, removals, diff headers, +and trailing whitespace. +.sp +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). +.sp +Default effects may be overridden from your configuration file: +.sp +.nf +.ft C +[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 + +# \(aqnone\(aq turns off all effects +status.clean = none +status.copied = none + +qseries.applied = blue bold underline +qseries.unapplied = black bold +qseries.missing = red bold + +diff.diffline = bold +diff.extended = cyan bold +diff.file_a = red bold +diff.file_b = green bold +diff.hunk = magenta +diff.deleted = red +diff.inserted = green +diff.changed = white +diff.trailingwhitespace = bold red_background + +resolve.unresolved = red bold +resolve.resolved = green bold + +bookmarks.current = green + +branches.active = none +branches.closed = black bold +branches.current = green +branches.inactive = none + +tags.normal = green +tags.local = black bold +.ft P +.fi +.sp +The available effects in terminfo mode are \(aqblink\(aq, \(aqbold\(aq, \(aqdim\(aq, +\(aqinverse\(aq, \(aqinvisible\(aq, \(aqitalic\(aq, \(aqstandout\(aq, and \(aqunderline\(aq; in +ECMA\-48 mode, the options are \(aqbold\(aq, \(aqinverse\(aq, \(aqitalic\(aq, and +\(aqunderline\(aq. How each is rendered depends on the terminal emulator. +Some may not be available for a given terminal type, and will be +silently ignored. +.sp +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\(aqt 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). +.sp +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: +.sp +.nf +.ft C +color.brightblue = 12 +color.pink = 207 +color.orange = 202 +.ft P +.fi +.sp +to set \(aqbrightblue\(aq to color slot 12 (useful for 16 color terminals +that have brighter colors defined in the upper eight) and, \(aqpink\(aq and +\(aqorange\(aq to colors in 256\-color xterm\(aqs default color cube. These +defined colors may then be used as any of the pre\-defined eight, +including appending \(aq_background\(aq to set the background to that color. +.sp +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: +.sp +.nf +.ft C +[color] +mode = terminfo +.ft P +.fi +.sp +Any value other than \(aqansi\(aq, \(aqwin32\(aq, \(aqterminfo\(aq, or \(aqauto\(aq will +disable color. +.SS convert +.sp +import revisions from foreign VCS repositories into Mercurial +.SS Commands +.SS convert +.sp +.nf +.ft C +hg convert [OPTION]... SOURCE [DEST [REVMAP]] +.ft P +.fi +.sp +Accepted source formats [identifiers]: +.INDENT 0.0 +.IP \(bu 2 +. +Mercurial [hg] +.IP \(bu 2 +. +CVS [cvs] +.IP \(bu 2 +. +Darcs [darcs] +.IP \(bu 2 +. +git [git] +.IP \(bu 2 +. +Subversion [svn] +.IP \(bu 2 +. +Monotone [mtn] +.IP \(bu 2 +. +GNU Arch [gnuarch] +.IP \(bu 2 +. +Bazaar [bzr] +.IP \(bu 2 +. +Perforce [p4] +.UNINDENT +.sp +Accepted destination formats [identifiers]: +.INDENT 0.0 +.IP \(bu 2 +. +Mercurial [hg] +.IP \(bu 2 +. +Subversion [svn] (history on branches is not preserved) +.UNINDENT +.sp +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). +.sp +If no destination directory name is specified, it defaults to the +basename of the source with \fB\-hg\fP appended. If the destination +repository doesn\(aqt exist, it will be created. +.sp +By default, all sources except Mercurial will use \-\-branchsort. +Mercurial uses \-\-sourcesort to preserve original revision numbers +order. Sort modes have the following effects: +.INDENT 0.0 +.TP +.B \-\-branchsort +. +convert from parent to child revision when possible, +which means branches are usually converted one after +the other. It generates more compact repositories. +.TP +.B \-\-datesort +. +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. +.TP +.B \-\-sourcesort +. +try to preserve source revisions order, only +supported by Mercurial sources. +.UNINDENT +.sp +If \fBREVMAP\fP isn\(aqt given, it will be put in a default location +(\fB<dest>/.hg/shamap\fP by default). The \fBREVMAP\fP is a simple +text file that maps each source commit ID to the destination ID +for that revision, like so: +.sp +.nf +.ft C +<source ID> <destination ID> +.ft P +.fi +.sp +If the file doesn\(aqt exist, it\(aqs automatically created. It\(aqs +updated on each commit copied, so \%\fBhg convert\fP\: can be interrupted +and can be run repeatedly to copy new commits. +.sp +The authormap is a simple text file that maps each source commit +author to a destination commit author. It is handy for source SCMs +that use unix logins to identify authors (eg: CVS). One line per +author mapping and the line format is: +.sp +.nf +.ft C +source author = destination author +.ft P +.fi +.sp +Empty lines and lines starting with a \fB#\fP are ignored. +.sp +The filemap is a file that allows filtering and remapping of files +and directories. Each line can contain one of the following +directives: +.sp +.nf +.ft C +include path/to/file\-or\-dir + +exclude path/to/file\-or\-dir + +rename path/to/source path/to/destination +.ft P +.fi +.sp +Comment lines start with \fB#\fP. A specified path matches if it +equals the full relative name of a file or one of its parent +directories. The \fBinclude\fP or \fBexclude\fP directive with the +longest matching path applies, so line order does not matter. +.sp +The \fBinclude\fP directive causes a file, or all files under a +directory, to be included in the destination repository, and the +exclusion of all other files and directories not explicitly +included. The \fBexclude\fP directive causes files or directories to +be omitted. The \fBrename\fP directive renames a file or directory if +it is converted. To rename from a subdirectory into the root of +the repository, use \fB.\fP as the path to rename to. +.sp +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: +.sp +.nf +.ft C +key parent1, parent2 +.ft P +.fi +.sp +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. +.sp +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: +.sp +.nf +.ft C +original_branch_name new_branch_name +.ft P +.fi +.sp +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. +.SS Mercurial Source +.sp +The Mercurial source recognizes the following configuration +options, which you can set on the command line with \fB\-\-config\fP: +.INDENT 0.0 +.TP +.B convert.hg.ignoreerrors +. +ignore integrity errors when reading. +Use it to fix Mercurial repositories with missing revlogs, by +converting from and to Mercurial. Default is False. +.TP +.B convert.hg.saverev +. +store original revision ID in changeset +(forces target IDs to change). It takes a boolean argument and +defaults to False. +.TP +.B convert.hg.startrev +. +convert start revision and its descendants. +It takes a hg revision identifier and defaults to 0. +.UNINDENT +.SS CVS Source +.sp +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 \fB:local:\fP. 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. +.sp +The following options can be used with \fB\-\-config\fP: +.INDENT 0.0 +.TP +.B convert.cvsps.cache +. +Set to False to disable remote log caching, +for testing and debugging purposes. Default is True. +.TP +.B convert.cvsps.fuzz +. +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. +.TP +.B convert.cvsps.mergeto +. +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 \fB{{mergetobranch +([\-\ew]+)}}\fP +.TP +.B convert.cvsps.mergefrom +. +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 \fB{{mergefrombranch ([\-\ew]+)}}\fP +.TP +.B hook.cvslog +. +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. +.TP +.B hook.cvschangesets +. +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. +.UNINDENT +.sp +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. +.SS Subversion Source +.sp +Subversion source detects classical trunk/branches/tags layouts. +By default, the supplied \fBsvn://repo/path/\fP source URL is +converted as a single branch. If \fBsvn://repo/path/trunk\fP exists +it replaces the default branch. If \fBsvn://repo/path/branches\fP +exists, its subdirectories are listed as possible branches. If +\fBsvn://repo/path/tags\fP exists, it is looked for tags referencing +converted branches. Default \fBtrunk\fP, \fBbranches\fP and \fBtags\fP +values can be overridden with following options. Set them to paths +relative to the source URL, or leave them blank to disable auto +detection. +.sp +The following options can be set with \fB\-\-config\fP: +.INDENT 0.0 +.TP +.B convert.svn.branches +. +specify the directory containing branches. +The default is \fBbranches\fP. +.TP +.B convert.svn.tags +. +specify the directory containing tags. The +default is \fBtags\fP. +.TP +.B convert.svn.trunk +. +specify the name of the trunk branch. The +default is \fBtrunk\fP. +.UNINDENT +.sp +Source history can be retrieved starting at a specific revision, +instead of being integrally converted. Only single branch +conversions are supported. +.INDENT 0.0 +.TP +.B convert.svn.startrev +. +specify start Subversion revision number. +The default is 0. +.UNINDENT +.SS Perforce Source +.sp +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 \fB...\-hg\fP. +.sp +It is possible to limit the amount of source history to be +converted by specifying an initial Perforce revision: +.INDENT 0.0 +.TP +.B convert.p4.startrev +. +specify initial Perforce revision (a +Perforce changelist number). +.UNINDENT +.SS Mercurial Destination +.sp +The following options are supported: +.INDENT 0.0 +.TP +.B convert.hg.clonebranches +. +dispatch source branches in separate +clones. The default is False. +.TP +.B convert.hg.tagsbranch +. +branch name for tag revisions, defaults to +\fBdefault\fP. +.TP +.B convert.hg.usebranchnames +. +preserve branch names. The default is +True. +.UNINDENT +.sp +Options: +.INDENT 0.0 +.TP +.B \-\-authors +. +username mapping filename (DEPRECATED, use \-\-authormap instead) +.TP +.B \-s, \-\-source\-type +. +source repository type +.TP +.B \-d, \-\-dest\-type +. +destination repository type +.TP +.B \-r, \-\-rev +. +import up to target revision REV +.TP +.B \-A, \-\-authormap +. +remap usernames using this file +.TP +.B \-\-filemap +. +remap file names using contents of file +.TP +.B \-\-splicemap +. +splice synthesized history into place +.TP +.B \-\-branchmap +. +change branch names while converting +.TP +.B \-\-branchsort +. +try to sort changesets by branches +.TP +.B \-\-datesort +. +try to sort changesets by date +.TP +.B \-\-sourcesort +. +preserve source changesets order +.UNINDENT +.SS eol +.sp +automatically manage newlines in repository files +.sp +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. +.sp +The extension reads its configuration from a versioned \fB.hgeol\fP +configuration file found in the root of the working copy. The +\fB.hgeol\fP file use the same syntax as all other Mercurial +configuration files. It uses two sections, \fB[patterns]\fP and +\fB[repository]\fP. +.sp +The \fB[patterns]\fP section specifies how line endings should be +converted between the working copy and the repository. The format is +specified by a file pattern. The first match is used, so put more +specific patterns first. The available line endings are \fBLF\fP, +\fBCRLF\fP, and \fBBIN\fP. +.sp +Files with the declared format of \fBCRLF\fP or \fBLF\fP are always +checked out and stored in the repository in that format and files +declared to be binary (\fBBIN\fP) are left unchanged. Additionally, +\fBnative\fP is an alias for checking out in the platform\(aqs default line +ending: \fBLF\fP on Unix (including Mac OS X) and \fBCRLF\fP on +Windows. Note that \fBBIN\fP (do nothing to line endings) is Mercurial\(aqs +default behaviour; it is only needed if you need to override a later, +more general pattern. +.sp +The optional \fB[repository]\fP section specifies the line endings to +use for files stored in the repository. It has a single setting, +\fBnative\fP, which determines the storage line endings for files +declared as \fBnative\fP in the \fB[patterns]\fP section. It can be set to +\fBLF\fP or \fBCRLF\fP. The default is \fBLF\fP. For example, this means +that on Windows, files configured as \fBnative\fP (\fBCRLF\fP by default) +will be converted to \fBLF\fP when stored in the repository. Files +declared as \fBLF\fP, \fBCRLF\fP, or \fBBIN\fP in the \fB[patterns]\fP section +are always stored as\-is in the repository. +.sp +Example versioned \fB.hgeol\fP file: +.sp +.nf +.ft C +[patterns] +**.py = native +**.vcproj = CRLF +**.txt = native +Makefile = LF +**.jpg = BIN + +[repository] +native = LF +.ft P +.fi +.IP Note +. +The rules will first apply when files are touched in the working +copy, e.g. by updating to null and back to tip to touch all files. +.RE +.sp +The extension uses an optional \fB[eol]\fP section read from both the +normal Mercurial configuration files and the \fB.hgeol\fP file, with the +latter overriding the former. You can use that section to control the +overall behavior. There are three settings: +.INDENT 0.0 +.IP \(bu 2 +. +\fBeol.native\fP (default \fBos.linesep\fP) can be set to \fBLF\fP or +\fBCRLF\fP to override the default interpretation of \fBnative\fP for +checkout. This can be used with \%\fBhg archive\fP\: on Unix, say, to +generate an archive where files have line endings for Windows. +.IP \(bu 2 +. +\fBeol.only\-consistent\fP (default True) can be set to False to make +the extension convert files with inconsistent EOLs. Inconsistent +means that there is both \fBCRLF\fP and \fBLF\fP present in the file. +Such files are normally not touched under the assumption that they +have mixed EOLs on purpose. +.IP \(bu 2 +. +\fBeol.fix\-trailing\-newline\fP (default False) can be set to True to +ensure that converted files end with a EOL character (either \fB\en\fP +or \fB\er\en\fP as per the configured patterns). +.UNINDENT +.sp +The extension provides \fBcleverencode:\fP and \fBcleverdecode:\fP 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 \fB.hgeol\fP file. +.sp +The \fBwin32text.forbid*\fP hooks provided by the win32text extension +have been unified into a single hook named \fBeol.checkheadshook\fP. The +hook will lookup the expected line endings from the \fB.hgeol\fP file, +which means you must migrate to a \fB.hgeol\fP file first before using +the hook. \fBeol.checkheadshook\fP only checks heads, intermediate +invalid revisions will be pushed. To forbid them completely, use the +\fBeol.checkallhook\fP hook. These hooks are best used as +\fBpretxnchangegroup\fP hooks. +.sp +See \%\fBhg help patterns\fP\: for more information about the glob patterns +used. +.SS extdiff +.sp +command to allow external programs to compare revisions +.sp +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. +.sp +The extdiff extension also allows you to configure new diff commands, so +you do not need to type \%\fBhg extdiff \-p kdiff3\fP\: always. +.sp +.nf +.ft C +[extdiff] +# add new command that runs GNU diff(1) in \(aqcontext diff\(aq mode +cdiff = gdiff \-Nprc5 +## or the old way: +#cmd.cdiff = gdiff +#opts.cdiff = \-Nprc5 + +# add new command called vdiff, runs kdiff3 +vdiff = kdiff3 + +# add new command called meld, runs meld (no need to name twice) +meld = + +# add new command called vimdiff, runs gvimdiff with DirDiff plugin +# (see http://www.vim.org/scripts/script.php?script_id=102) Non +# English user, be sure to put "let g:DirDiffDynamicDiffText = 1" in +# your .vimrc +vimdiff = gvim \-f "+next" \e + "+execute \(aqDirDiff\(aq fnameescape(argv(0)) fnameescape(argv(1))" +.ft P +.fi +.sp +Tool arguments can include variables that are expanded at runtime: +.sp +.nf +.ft C +$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. +.ft P +.fi +.sp +The extdiff extension will look in your [diff\-tools] and [merge\-tools] +sections for diff tool arguments, when none are specified in [extdiff]. +.sp +.nf +.ft C +[extdiff] +kdiff3 = + +[diff\-tools] +kdiff3.diffargs=\-\-L1 \(aq$plabel1\(aq \-\-L2 \(aq$clabel\(aq $parent $child +.ft P +.fi +.sp +You can use \-I/\-X and list of file or directory names like normal +\%\fBhg diff\fP\: 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). +.SS Commands +.SS extdiff +.sp +.nf +.ft C +hg extdiff [OPT]... [FILE]... +.ft P +.fi +.sp +Show differences between revisions for the specified files, using +an external program. The default program used is diff, with +default options "\-Npru". +.sp +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. +.sp +When two revision arguments are given, then changes are shown +between those revisions. If only one revision is specified then +that revision is compared to the working directory, and, when no +revisions are specified, the working directory files are compared +to its parent. +.sp +Options: +.INDENT 0.0 +.TP +.B \-p, \-\-program +. +comparison program to run +.TP +.B \-o, \-\-option +. +pass option to comparison program +.TP +.B \-r, \-\-rev +. +revision +.TP +.B \-c, \-\-change +. +change made by revision +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.UNINDENT +.SS factotum +.sp +http authentication with factotum +.sp +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. +.sp +By default, keys are specified as: +.sp +.nf +.ft C +proto=pass service=hg prefix=<prefix> user=<username> !password=<password> +.ft P +.fi +.sp +If the factotum extension is unable to read the required key, one will be +requested interactively. +.sp +A configuration section is available to customize runtime behavior. By +default, these entries are: +.sp +.nf +.ft C +[factotum] +executable = /bin/auth/factotum +mountpoint = /mnt/factotum +service = hg +.ft P +.fi +.sp +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. +.SS fetch +.sp +pull, update and merge in one command (DEPRECATED) +.SS Commands +.SS fetch +.sp +.nf +.ft C +hg fetch [SOURCE] +.ft P +.fi +.sp +This finds all changes from the repository at the specified path +or URL and adds them to the local repository. +.sp +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. +.sp +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. +.sp +See \%\fBhg help dates\fP\: for a list of formats valid for \-d/\-\-date. +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-r, \-\-rev +. +a specific revision you would like to pull +.TP +.B \-e, \-\-edit +. +edit commit message +.TP +.B \-\-force\-editor +. +edit commit message (DEPRECATED) +.TP +.B \-\-switch\-parent +. +switch parents when merging +.TP +.B \-m, \-\-message +. +use text as commit message +.TP +.B \-l, \-\-logfile +. +read commit message from file +.TP +.B \-d, \-\-date +. +record the specified date as commit date +.TP +.B \-u, \-\-user +. +record the specified user as committer +.TP +.B \-e, \-\-ssh +. +specify ssh command to use +.TP +.B \-\-remotecmd +. +specify hg command to run on the remote side +.TP +.B \-\-insecure +. +do not verify server certificate (ignoring web.cacerts config) +.UNINDENT +.SS gpg +.sp +commands to sign and verify changesets +.SS Commands +.SS sigcheck +.sp +.nf +.ft C +hg sigcheck REV +.ft P +.fi +.sp +verify all the signatures there may be for a particular revision +.SS sign +.sp +.nf +.ft C +hg sign [OPTION]... [REV]... +.ft P +.fi +.sp +If no revision is given, the parent of the working directory is used, +or tip if no revision is checked out. +.sp +See \%\fBhg help dates\fP\: for a list of formats valid for \-d/\-\-date. +.sp +Options: +.INDENT 0.0 +.TP +.B \-l, \-\-local +. +make the signature local +.TP +.B \-f, \-\-force +. +sign even if the sigfile is modified +.TP +.B \-\-no\-commit +. +do not commit the sigfile after signing +.TP +.B \-k, \-\-key +. +the key id to sign with +.TP +.B \-m, \-\-message +. +commit message +.TP +.B \-d, \-\-date +. +record the specified date as commit date +.TP +.B \-u, \-\-user +. +record the specified user as committer +.UNINDENT +.SS sigs +.sp +.nf +.ft C +hg sigs +.ft P +.fi +.sp +list signed changesets +.SS graphlog +.sp +command to view revision graphs from a shell +.sp +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. +.SS Commands +.SS glog +.sp +.nf +.ft C +hg glog [OPTION]... [FILE] +.ft P +.fi +.sp +Print a revision history alongside a revision graph drawn with +ASCII characters. +.sp +Nodes printed as an @ character are parents of the working +directory. +.sp +Options: +.INDENT 0.0 +.TP +.B \-f, \-\-follow +. +follow changeset history, or file history across copies and renames +.TP +.B \-\-follow\-first +. +only follow the first parent of merge changesets (DEPRECATED) +.TP +.B \-d, \-\-date +. +show revisions matching date spec +.TP +.B \-C, \-\-copies +. +show copied files +.TP +.B \-k, \-\-keyword +. +do case\-insensitive search for a given text +.TP +.B \-r, \-\-rev +. +show the specified revision or range +.TP +.B \-\-removed +. +include revisions where files were removed +.TP +.B \-m, \-\-only\-merges +. +show only merges (DEPRECATED) +.TP +.B \-u, \-\-user +. +revisions committed by user +.TP +.B \-\-only\-branch +. +show only changesets within the given named branch (DEPRECATED) +.TP +.B \-b, \-\-branch +. +show changesets within the given named branch +.TP +.B \-P, \-\-prune +. +do not display revision or any of its ancestors +.TP +.B \-\-hidden +. +show hidden changesets (DEPRECATED) +.TP +.B \-p, \-\-patch +. +show patch +.TP +.B \-g, \-\-git +. +use git extended diff format +.TP +.B \-l, \-\-limit +. +limit number of changes displayed +.TP +.B \-M, \-\-no\-merges +. +do not show merges +.TP +.B \-\-stat +. +output diffstat\-style summary of changes +.TP +.B \-G, \-\-graph +. +show the revision DAG +.TP +.B \-\-style +. +display using template map file +.TP +.B \-\-template +. +display with template +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.UNINDENT +.SS hgcia +.sp +hooks for integrating with the CIA.vc notification service +.sp +This is meant to be run as a changegroup or incoming hook. To +configure it, set the following options in your hgrc: +.sp +.nf +.ft C +[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}\en{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, eg +# mailto:cia@cia.vc +# Make sure to set email.from if you do this. +#url = http://cia.vc/ +# print message instead of sending it (optional) +#test = False +# 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 +.ft P +.fi +.SS hgk +.sp +browse the repository in a graphical way +.sp +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.) +.sp +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. +.sp +The \%\fBhg view\fP\: 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: +.sp +.nf +.ft C +[hgk] +path=/location/of/hgk +.ft P +.fi +.sp +hgk can make use of the extdiff extension to visualize revisions. +Assuming you had already configured extdiff vdiff command, just add: +.sp +.nf +.ft C +[hgk] +vdiff=vdiff +.ft P +.fi +.sp +Revisions context menu will now display additional entries to fire +vdiff on hovered and selected revisions. +.SS Commands +.SS view +.sp +.nf +.ft C +hg view [\-l LIMIT] [REVRANGE] +.ft P +.fi +.sp +start interactive history viewer +.sp +Options: +.INDENT 0.0 +.TP +.B \-l, \-\-limit +. +limit number of changes displayed +.UNINDENT +.SS highlight +.sp +syntax highlighting for hgweb (requires Pygments) +.sp +It depends on the Pygments syntax highlighting library: +\%http://pygments.org/\: +.sp +There is a single configuration option: +.sp +.nf +.ft C +[web] +pygments_style = <style> +.ft P +.fi +.sp +The default is \(aqcolorful\(aq. +.SS histedit +.sp +interactive history editing +.sp +With this extension installed, Mercurial gains one new command: histedit. Usage +is as follows, assuming the following history: +.sp +.nf +.ft C +@ 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 +.ft P +.fi +.sp +If you were to run \fBhg histedit c561b4e977df\fP, you would see the following +file open in your editor: +.sp +.nf +.ft C +pick c561b4e977df Add beta +pick 030b686bedc4 Add gamma +pick 7c2fd3b9020c Add delta + +# Edit history between 633536316234 and 7c2fd3b9020c +# +# Commands: +# p, pick = use commit +# e, edit = use commit, but stop for amending +# f, fold = use commit, but fold into previous commit +# d, drop = remove commit from history +# m, mess = edit message without changing commit content +# +.ft P +.fi +.sp +In this file, lines beginning with \fB#\fP 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: +.sp +.nf +.ft C +pick 030b686bedc4 Add gamma +pick c561b4e977df Add beta +fold 7c2fd3b9020c Add delta + +# Edit history between 633536316234 and 7c2fd3b9020c +# +# Commands: +# p, pick = use commit +# e, edit = use commit, but stop for amending +# f, fold = use commit, but fold into previous commit +# d, drop = remove commit from history +# m, mess = edit message without changing commit content +# +.ft P +.fi +.sp +At which point you close the editor and \fBhistedit\fP starts working. When you +specify a \fBfold\fP operation, \fBhistedit\fP will open an editor when it folds +those revisions together, offering you a chance to clean up the commit message: +.sp +.nf +.ft C +Add beta +*** +Add delta +.ft P +.fi +.sp +Edit the commit message to your liking, then close the editor. For +this example, let\(aqs assume that the commit message was changed to +\fBAdd beta and delta.\fP After histedit has run and had a chance to +remove any old or temporary revisions it needed, the history looks +like this: +.sp +.nf +.ft C +@ 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 +.ft P +.fi +.sp +Note that \fBhistedit\fP does \fInot\fP 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\(aqs 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 \fB\-\-keep\fP flag. +.sp +The \fBedit\fP operation will drop you back to a command prompt, +allowing you to edit files freely, or even use \fBhg record\fP to commit +some changes as a separate commit. When you\(aqre done, any remaining +uncommitted changes will be committed as well. When done, run \fBhg +histedit \-\-continue\fP to finish this step. You\(aqll be prompted for a +new commit message, but the default commit message will be the +original message for the \fBedit\fP ed revision. +.sp +The \fBmessage\fP operation will give you a chance to revise a commit +message without changing the contents. It\(aqs a shortcut for doing +\fBedit\fP immediately followed by \fIhg histedit \-\-continue\(ga\fP. +.sp +If \fBhistedit\fP encounters a conflict when moving a revision (while +handling \fBpick\fP or \fBfold\fP), it\(aqll stop in a similar manner to +\fBedit\fP with the difference that it won\(aqt prompt you for a commit +message when done. If you decide at this point that you don\(aqt like how +much work it will be to rearrange history, or that you made a mistake, +you can use \fBhg histedit \-\-abort\fP to abandon the new changes you +have made and return to the state before you attempted to edit your +history. +.sp +If we clone the example repository above and add three more changes, such that +we have the following history: +.sp +.nf +.ft C +@ 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 +.ft P +.fi +.sp +If you run \fBhg histedit \-\-outgoing\fP on the clone then it is the same +as running \fBhg histedit 836302820282\fP. 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 \fB\-\-force\fP option. +.SS Commands +.SS histedit +.sp +.nf +.ft C +hg histedit [PARENT] +.ft P +.fi +.sp +interactively edit changeset history +.sp +Options: +.INDENT 0.0 +.TP +.B \-\-commands +. +Read history edits from the specified file. +.TP +.B \-c, \-\-continue +. +continue an edit already in progress +.TP +.B \-k, \-\-keep +. +don\(aqt strip old nodes after edit is complete +.TP +.B \-\-abort +. +abort an edit in progress +.TP +.B \-o, \-\-outgoing +. +changesets not found in destination +.TP +.B \-f, \-\-force +. +force outgoing even for unrelated repositories +.TP +.B \-r, \-\-rev +. +first revision to be edited +.UNINDENT +.SS inotify +.sp +accelerate status report using Linux\(aqs inotify service +.SS Commands +.SS inserve +.sp +.nf +.ft C +hg inserve [OPTION]... +.ft P +.fi +.sp +start an inotify server for this repository +.sp +Options: +.INDENT 0.0 +.TP +.B \-d, \-\-daemon +. +run server in background +.TP +.B \-\-daemon\-pipefds +. +used internally by daemon mode +.TP +.B \-t, \-\-idle\-timeout +. +minutes to sit idle before exiting +.TP +.B \-\-pid\-file +. +name of file to write process ID to +.UNINDENT +.SS interhg +.sp +expand expressions into changelog and summaries +.sp +This extension allows the use of a special syntax in summaries, which +will be automatically expanded into links or any other arbitrary +expression, much like InterWiki does. +.sp +A few example patterns (link to bug tracking, etc.) that may be used +in your hgrc: +.sp +.nf +.ft C +[interhg] +issues = s!issue(\ed+)!<a href="http://bts/issue\e1">issue\e1</a>! +bugzilla = s!((?:bug|b=|(?=#?\ed{4,}))(?:\es*#?)(\ed+))!<a..=\e2">\e1</a>!i +boldify = s!(^|\es)#(\ed+)\eb! <b>#\e2</b>! +.ft P +.fi +.SS keyword +.sp +expand keywords in tracked files +.sp +This extension expands RCS/CVS\-like or self\-customized $Keywords$ in +tracked text files selected by your configuration. +.sp +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. +.sp +Keywords expand to the changeset data pertaining to the latest change +relative to the working directory parent of each file. +.sp +Configuration is done in the [keyword], [keywordset] and [keywordmaps] +sections of hgrc files. +.sp +Example: +.sp +.nf +.ft C +[keyword] +# expand keywords in every python file except those matching "x*" +**.py = +x* = ignore + +[keywordset] +# prefer svn\- over cvs\-like default keywordmaps +svn = True +.ft P +.fi +.IP Note +. +The more specific you are in your filename patterns the less you +lose speed in huge repositories. +.RE +.sp +For [keywordmaps] template mapping and expansion demonstration and +control run \%\fBhg kwdemo\fP\:. See \%\fBhg help templates\fP\: for a list of +available templates and filters. +.sp +Three additional date template filters are provided: +.INDENT 0.0 +.TP +.B \fButcdate\fP +.sp +"2006/09/18 15:13:13" +.TP +.B \fBsvnutcdate\fP +.sp +"2006\-09\-18 15:13:13Z" +.TP +.B \fBsvnisodate\fP +.sp +"2006\-09\-18 08:13:13 \-700 (Mon, 18 Sep 2006)" +.UNINDENT +.sp +The default template mappings (view with \%\fBhg kwdemo \-d\fP\:) can be +replaced with customized keywords and templates. Again, run +\%\fBhg kwdemo\fP\: to control the results of your configuration changes. +.sp +Before changing/disabling active keywords, you must run \%\fBhg kwshrink\fP\: +to avoid storing expanded keywords in the change history. +.sp +To force expansion after enabling it, or a configuration change, run +\%\fBhg kwexpand\fP\:. +.sp +Expansions spanning more than one line and incremental expansions, +like CVS\(aq $Log$, are not supported. A keyword template map "Log = +{desc}" expands to the first line of the changeset description. +.SS Commands +.SS kwdemo +.sp +.nf +.ft C +hg kwdemo [\-d] [\-f RCFILE] [TEMPLATEMAP]... +.ft P +.fi +.sp +Show current, custom, or default keyword template maps and their +expansions. +.sp +Extend the current configuration by specifying maps as arguments +and using \-f/\-\-rcfile to source an external hgrc file. +.sp +Use \-d/\-\-default to disable current configuration. +.sp +See \%\fBhg help templates\fP\: for information on templates and filters. +.sp +Options: +.INDENT 0.0 +.TP +.B \-d, \-\-default +. +show default keyword template maps +.TP +.B \-f, \-\-rcfile +. +read maps from rcfile +.UNINDENT +.SS kwexpand +.sp +.nf +.ft C +hg kwexpand [OPTION]... [FILE]... +.ft P +.fi +.sp +Run after (re)enabling keyword expansion. +.sp +kwexpand refuses to run if given files contain local changes. +.sp +Options: +.INDENT 0.0 +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.UNINDENT +.SS kwfiles +.sp +.nf +.ft C +hg kwfiles [OPTION]... [FILE]... +.ft P +.fi +.sp +List which files in the working directory are matched by the +[keyword] configuration patterns. +.sp +Useful to prevent inadvertent keyword expansion and to speed up +execution by including only files that are actual candidates for +expansion. +.sp +See \%\fBhg help keyword\fP\: on how to construct patterns both for +inclusion and exclusion of files. +.sp +With \-A/\-\-all and \-v/\-\-verbose the codes used to show the status +of files are: +.sp +.nf +.ft C +K = keyword expansion candidate +k = keyword expansion candidate (not tracked) +I = ignored +i = ignored (not tracked) +.ft P +.fi +.sp +Options: +.INDENT 0.0 +.TP +.B \-A, \-\-all +. +show keyword status flags of all files +.TP +.B \-i, \-\-ignore +. +show files excluded from expansion +.TP +.B \-u, \-\-unknown +. +only show unknown (not tracked) files +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.UNINDENT +.SS kwshrink +.sp +.nf +.ft C +hg kwshrink [OPTION]... [FILE]... +.ft P +.fi +.sp +Must be run before changing/disabling active keywords. +.sp +kwshrink refuses to run if given files contain local changes. +.sp +Options: +.INDENT 0.0 +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.UNINDENT +.SS largefiles +.sp +track large binary files +.sp +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\(aqs 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\(aqs memory usage. The largefiles extension addresses these +problems by adding a centralized client\-server layer on top of +Mercurial: largefiles live in a \fIcentral store\fP out on the network +somewhere, and you only fetch the revisions that you need when you +need them. +.sp +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\(aqt need to retrieve all historical revisions +of large files when you clone or pull. +.sp +To start a new repository or add new large binary files, just add +\-\-large to your \%\fBhg add\fP\: command. For example: +.sp +.nf +.ft C +$ dd if=/dev/urandom of=randomdata count=2000 +$ hg add \-\-large randomdata +$ hg commit \-m \(aqadd randomdata as a largefile\(aq +.ft P +.fi +.sp +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. +.sp +When you pull a changeset that affects largefiles from a remote +repository, Mercurial behaves as normal. 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). This means +that network access may be required to update to changesets you have +not previously updated to. +.sp +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 +\%\fBhg lfconvert\fP\: command: +.sp +.nf +.ft C +$ hg lfconvert \-\-size 10 oldrepo newrepo +.ft P +.fi +.sp +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 \fBlargefiles.minsize\fP 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): +.sp +.nf +.ft C +[largefiles] +minsize = 2 + +$ hg add \-\-lfsize 2 +.ft P +.fi +.sp +The \fBlargefiles.patterns\fP config option allows you to specify a list +of filename patterns (see \%\fBhg help patterns\fP\:) that should always be +tracked as largefiles: +.sp +.nf +.ft C +[largefiles] +patterns = + *.jpg + re:.*\e.(png|bmp)$ + library.zip + content/audio/* +.ft P +.fi +.sp +Files that match one of these patterns will be added as largefiles +regardless of their size. +.sp +The \fBlargefiles.minsize\fP and \fBlargefiles.patterns\fP 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 \%\fBhg add\fP\: +command. +.SS Commands +.SS lfconvert +.sp +.nf +.ft C +hg lfconvert SOURCE DEST [FILE ...] +.ft P +.fi +.sp +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 \fIor\fP 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 \fBlargefiles.size\fP. +.sp +After running this command you will need to make sure that +largefiles is enabled anywhere you intend to push the new +repository. +.sp +Use \-\-to\-normal to convert largefiles back to normal files; after +this, the DEST repository can be used without largefiles at all. +.sp +Options: +.INDENT 0.0 +.TP +.B \-s, \-\-size +. +minimum size (MB) for files to be converted as largefiles +.TP +.B \-\-to\-normal +. +convert from a largefiles repo to a normal repo +.UNINDENT +.SS mq +.sp +manage a stack of patches +.sp +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). +.sp +Known patches are represented as patch files in the .hg/patches +directory. Applied patches are both patch files and changesets. +.sp +Common tasks (use \%\fBhg help command\fP\: for more details): +.sp +.nf +.ft C +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 +.ft P +.fi +.sp +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: +.sp +.nf +.ft C +[mq] +git = auto/keep/yes/no +.ft P +.fi +.sp +If set to \(aqkeep\(aq, mq will obey the [diff] section configuration while +preserving existing git patches upon qrefresh. If set to \(aqyes\(aq or +\(aqno\(aq, mq will override the [diff] section and always generate git or +regular patches, possibly losing data in the second case. +.sp +It may be desirable for mq changesets to be kept in the secret phase (see +\%\fBhg help phases\fP\:), which can be enabled with the following setting: +.sp +.nf +.ft C +[mq] +secret = True +.ft P +.fi +.sp +You will by default be managing a patch queue named "patches". You can +create other, independent patch queues with the \%\fBhg qqueue\fP\: command. +.sp +If the working directory contains uncommitted files, qpush, qpop and +qgoto abort immediately. If \-f/\-\-force is used, the changes are +discarded. Setting: +.sp +.nf +.ft C +[mq] +keepchanges = True +.ft P +.fi +.sp +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. +.SS Commands +.SS qapplied +.sp +.nf +.ft C +hg qapplied [\-1] [\-s] [PATCH] +.ft P +.fi +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-1, \-\-last +. +show only the preceding applied patch +.TP +.B \-s, \-\-summary +. +print first line of patch header +.UNINDENT +.SS qclone +.sp +.nf +.ft C +hg qclone [OPTION]... SOURCE [DEST] +.ft P +.fi +.sp +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. +.sp +Source patch repository is looked for in <src>/.hg/patches by +default. Use \-p <url> to change. +.sp +The patch directory must be a nested Mercurial repository, as +would be created by \%\fBhg init \-\-mq\fP\:. +.sp +Return 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-\-pull +. +use pull protocol to copy metadata +.TP +.B \-U, \-\-noupdate +. +do not update the new working directories +.TP +.B \-\-uncompressed +. +use uncompressed transfer (fast over LAN) +.TP +.B \-p, \-\-patches +. +location of source patch repository +.TP +.B \-e, \-\-ssh +. +specify ssh command to use +.TP +.B \-\-remotecmd +. +specify hg command to run on the remote side +.TP +.B \-\-insecure +. +do not verify server certificate (ignoring web.cacerts config) +.UNINDENT +.SS qcommit +.sp +.nf +.ft C +hg qcommit [OPTION]... [FILE]... +.ft P +.fi +.sp +This command is deprecated; use \%\fBhg commit \-\-mq\fP\: instead. +.sp +Options: +.INDENT 0.0 +.TP +.B \-A, \-\-addremove +. +mark new/missing files as added/removed before committing +.TP +.B \-\-close\-branch +. +mark a branch as closed, hiding it from the branch list +.TP +.B \-\-amend +. +amend the parent of the working dir +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.TP +.B \-m, \-\-message +. +use text as commit message +.TP +.B \-l, \-\-logfile +. +read commit message from file +.TP +.B \-d, \-\-date +. +record the specified date as commit date +.TP +.B \-u, \-\-user +. +record the specified user as committer +.TP +.B \-S, \-\-subrepos +. +recurse into subrepositories +.sp +aliases: qci +.UNINDENT +.SS qdelete +.sp +.nf +.ft C +hg qdelete [\-k] [PATCH]... +.ft P +.fi +.sp +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. +.sp +To stop managing a patch and move it into permanent history, +use the \%\fBhg qfinish\fP\: command. +.sp +Options: +.INDENT 0.0 +.TP +.B \-k, \-\-keep +. +keep patch file +.TP +.B \-r, \-\-rev +. +stop managing a revision (DEPRECATED) +.sp +aliases: qremove qrm +.UNINDENT +.SS qdiff +.sp +.nf +.ft C +hg qdiff [OPTION]... [FILE]... +.ft P +.fi +.sp +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). +.sp +Use \%\fBhg diff\fP\: if you only want to see the changes made since the +last qrefresh, or \%\fBhg export qtip\fP\: if you want to see changes +made by the current patch without including changes made since the +qrefresh. +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-a, \-\-text +. +treat all files as text +.TP +.B \-g, \-\-git +. +use git extended diff format +.TP +.B \-\-nodates +. +omit dates from diff headers +.TP +.B \-p, \-\-show\-function +. +show which function each change is in +.TP +.B \-\-reverse +. +produce a diff that undoes the changes +.TP +.B \-w, \-\-ignore\-all\-space +. +ignore white space when comparing lines +.TP +.B \-b, \-\-ignore\-space\-change +. +ignore changes in the amount of white space +.TP +.B \-B, \-\-ignore\-blank\-lines +. +ignore changes whose lines are all blank +.TP +.B \-U, \-\-unified +. +number of lines of context to show +.TP +.B \-\-stat +. +output diffstat\-style summary of changes +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.UNINDENT +.SS qfinish +.sp +.nf +.ft C +hg qfinish [\-a] [REV]... +.ft P +.fi +.sp +Finishes the specified revisions (corresponding to applied +patches) by moving them out of mq control into regular repository +history. +.sp +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. +.sp +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. +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-a, \-\-applied +. +finish all applied changesets +.UNINDENT +.SS qfold +.sp +.nf +.ft C +hg qfold [\-e] [\-k] [\-m TEXT] [\-l FILE] PATCH... +.ft P +.fi +.sp +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. +.sp +The header for each folded patch will be concatenated with the +current patch header, separated by a line of \fB* * *\fP. +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-e, \-\-edit +. +edit patch header +.TP +.B \-k, \-\-keep +. +keep folded patch files +.TP +.B \-m, \-\-message +. +use text as commit message +.TP +.B \-l, \-\-logfile +. +read commit message from file +.UNINDENT +.SS qgoto +.sp +.nf +.ft C +hg qgoto [OPTION]... PATCH +.ft P +.fi +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-\-keep\-changes +. +tolerate non\-conflicting local changes +.TP +.B \-f, \-\-force +. +overwrite any local changes +.TP +.B \-\-no\-backup +. +do not save backup copies of files +.UNINDENT +.SS qguard +.sp +.nf +.ft C +hg qguard [\-l] [\-n] [PATCH] [\-\- [+GUARD]... [\-GUARD]...] +.ft P +.fi +.sp +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 \%\fBhg qselect\fP\: command has activated it. A patch with +a negative guard ("\-foo") is never pushed if the \%\fBhg qselect\fP\: command +has activated it. +.sp +With no arguments, print the currently active guards. +With arguments, set guards for the named patch. +.IP Note +. +Specifying negative guards now requires \(aq\-\-\(aq. +.RE +.sp +To set guards on another patch: +.sp +.nf +.ft C +hg qguard other.patch \-\- +2.6.17 \-stable +.ft P +.fi +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-l, \-\-list +. +list all patches and guards +.TP +.B \-n, \-\-none +. +drop all guards +.UNINDENT +.SS qheader +.sp +.nf +.ft C +hg qheader [PATCH] +.ft P +.fi +.sp +Returns 0 on success. +.SS qimport +.sp +.nf +.ft C +hg qimport [\-e] [\-n NAME] [\-f] [\-g] [\-P] [\-r REV]... [FILE]... +.ft P +.fi +.sp +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. +.sp +The patch will have the same name as its source file unless you +give it a new one with \-n/\-\-name. +.sp +You can register an existing patch inside the patch directory with +the \-e/\-\-existing flag. +.sp +With \-f/\-\-force, an existing patch of the same name will be +overwritten. +.sp +An existing changeset may be placed under mq control with \-r/\-\-rev +(e.g. qimport \-\-rev tip \-n patch will place tip under mq control). +With \-g/\-\-git, patches imported with \-\-rev will use the git diff +format. See the diffs help topic for information on why this is +important for preserving rename/copy information and permission +changes. Use \%\fBhg qfinish\fP\: to remove changesets from mq control. +.sp +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. +.sp +To import an existing patch while renaming it: +.sp +.nf +.ft C +hg qimport \-e existing\-patch \-n new\-name +.ft P +.fi +.sp +Returns 0 if import succeeded. +.sp +Options: +.INDENT 0.0 +.TP +.B \-e, \-\-existing +. +import file in patch directory +.TP +.B \-n, \-\-name +. +name of patch file +.TP +.B \-f, \-\-force +. +overwrite existing files +.TP +.B \-r, \-\-rev +. +place existing revisions under mq control +.TP +.B \-g, \-\-git +. +use git extended diff format +.TP +.B \-P, \-\-push +. +qpush after importing +.UNINDENT +.SS qinit +.sp +.nf +.ft C +hg qinit [\-c] +.ft P +.fi +.sp +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. +.sp +This command is deprecated. Without \-c, it\(aqs implied by other relevant +commands. With \-c, use \%\fBhg init \-\-mq\fP\: instead. +.sp +Options: +.INDENT 0.0 +.TP +.B \-c, \-\-create\-repo +. +create queue repository +.UNINDENT +.SS qnew +.sp +.nf +.ft C +hg qnew [\-e] [\-m TEXT] [\-l FILE] PATCH [FILE]... +.ft P +.fi +.sp +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. +.sp +\-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. +.sp +\-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 \(aq[mq]: PATCH\(aq. +.sp +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. +.sp +Returns 0 on successful creation of a new patch. +.sp +Options: +.INDENT 0.0 +.TP +.B \-e, \-\-edit +. +edit commit message +.TP +.B \-f, \-\-force +. +import uncommitted changes (DEPRECATED) +.TP +.B \-g, \-\-git +. +use git extended diff format +.TP +.B \-U, \-\-currentuser +. +add "From: <current user>" to patch +.TP +.B \-u, \-\-user +. +add "From: <USER>" to patch +.TP +.B \-D, \-\-currentdate +. +add "Date: <current date>" to patch +.TP +.B \-d, \-\-date +. +add "Date: <DATE>" to patch +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.TP +.B \-m, \-\-message +. +use text as commit message +.TP +.B \-l, \-\-logfile +. +read commit message from file +.UNINDENT +.SS qnext +.sp +.nf +.ft C +hg qnext [\-s] +.ft P +.fi +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-s, \-\-summary +. +print first line of patch header +.UNINDENT +.SS qpop +.sp +.nf +.ft C +hg qpop [\-a] [\-f] [PATCH | INDEX] +.ft P +.fi +.sp +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. +.sp +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. +.sp +Return 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-a, \-\-all +. +pop all patches +.TP +.B \-n, \-\-name +. +queue name to pop (DEPRECATED) +.TP +.B \-\-keep\-changes +. +tolerate non\-conflicting local changes +.TP +.B \-f, \-\-force +. +forget any local changes to patched files +.TP +.B \-\-no\-backup +. +do not save backup copies of files +.UNINDENT +.SS qprev +.sp +.nf +.ft C +hg qprev [\-s] +.ft P +.fi +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-s, \-\-summary +. +print first line of patch header +.UNINDENT +.SS qpush +.sp +.nf +.ft C +hg qpush [\-f] [\-l] [\-a] [\-\-move] [PATCH | INDEX] +.ft P +.fi +.sp +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. +.sp +Return 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-\-keep\-changes +. +tolerate non\-conflicting local changes +.TP +.B \-f, \-\-force +. +apply on top of local changes +.TP +.B \-e, \-\-exact +. +apply the target patch to its recorded parent +.TP +.B \-l, \-\-list +. +list patch name in commit text +.TP +.B \-a, \-\-all +. +apply all patches +.TP +.B \-m, \-\-merge +. +merge from another queue (DEPRECATED) +.TP +.B \-n, \-\-name +. +merge queue name (DEPRECATED) +.TP +.B \-\-move +. +reorder patch series and apply only the patch +.TP +.B \-\-no\-backup +. +do not save backup copies of files +.UNINDENT +.SS qqueue +.sp +.nf +.ft C +hg qqueue [OPTION] [QUEUE] +.ft P +.fi +.sp +Supports switching between different patch queues, as well as creating +new patch queues and deleting existing ones. +.sp +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. +.sp +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. +.sp +To delete an existing queue, use \-\-delete. You cannot delete the currently +active queue. +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-l, \-\-list +. +list all available queues +.TP +.B \-\-active +. +print name of active queue +.TP +.B \-c, \-\-create +. +create new queue +.TP +.B \-\-rename +. +rename active queue +.TP +.B \-\-delete +. +delete reference to queue +.TP +.B \-\-purge +. +delete queue, and remove patch dir +.UNINDENT +.SS qrefresh +.sp +.nf +.ft C +hg qrefresh [\-I] [\-X] [\-e] [\-m TEXT] [\-l FILE] [\-s] [FILE]... +.ft P +.fi +.sp +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. +.sp +If \-s/\-\-short is specified, files currently included in the patch +will be refreshed just like matched files and remain in the patch. +.sp +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 \fB.hg/last\-message.txt\fP. +.sp +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. +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-e, \-\-edit +. +edit commit message +.TP +.B \-g, \-\-git +. +use git extended diff format +.TP +.B \-s, \-\-short +. +refresh only files already in the patch and specified files +.TP +.B \-U, \-\-currentuser +. +add/update author field in patch with current user +.TP +.B \-u, \-\-user +. +add/update author field in patch with given user +.TP +.B \-D, \-\-currentdate +. +add/update date field in patch with current date +.TP +.B \-d, \-\-date +. +add/update date field in patch with given date +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.TP +.B \-m, \-\-message +. +use text as commit message +.TP +.B \-l, \-\-logfile +. +read commit message from file +.UNINDENT +.SS qrename +.sp +.nf +.ft C +hg qrename PATCH1 [PATCH2] +.ft P +.fi +.sp +With one argument, renames the current patch to PATCH1. +With two arguments, renames PATCH1 to PATCH2. +.sp +Returns 0 on success. +.INDENT 0.0 +.INDENT 3.5 +.sp +aliases: qmv +.UNINDENT +.UNINDENT +.SS qrestore +.sp +.nf +.ft C +hg qrestore [\-d] [\-u] REV +.ft P +.fi +.sp +This command is deprecated, use \%\fBhg rebase\fP\: instead. +.sp +Options: +.INDENT 0.0 +.TP +.B \-d, \-\-delete +. +delete save entry +.TP +.B \-u, \-\-update +. +update queue working directory +.UNINDENT +.SS qsave +.sp +.nf +.ft C +hg qsave [\-m TEXT] [\-l FILE] [\-c] [\-n NAME] [\-e] [\-f] +.ft P +.fi +.sp +This command is deprecated, use \%\fBhg rebase\fP\: instead. +.sp +Options: +.INDENT 0.0 +.TP +.B \-c, \-\-copy +. +copy patch directory +.TP +.B \-n, \-\-name +. +copy directory name +.TP +.B \-e, \-\-empty +. +clear queue status file +.TP +.B \-f, \-\-force +. +force copy +.TP +.B \-m, \-\-message +. +use text as commit message +.TP +.B \-l, \-\-logfile +. +read commit message from file +.UNINDENT +.SS qselect +.sp +.nf +.ft C +hg qselect [OPTION]... [GUARD]... +.ft P +.fi +.sp +Use the \%\fBhg qguard\fP\: 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: +.sp +.nf +.ft C +qguard foo.patch \-\- \-stable (negative guard) +qguard bar.patch +stable (positive guard) +qselect stable +.ft P +.fi +.sp +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). +.sp +With no arguments, prints the currently active guards. +With one argument, sets the active guard. +.sp +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. +.sp +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. +.sp +Use \-s/\-\-series to print a list of all guards in the series file +(no other arguments needed). Use \-v for more information. +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-n, \-\-none +. +disable all guards +.TP +.B \-s, \-\-series +. +list all guards in series file +.TP +.B \-\-pop +. +pop to before first guarded applied patch +.TP +.B \-\-reapply +. +pop, then reapply patches +.UNINDENT +.SS qseries +.sp +.nf +.ft C +hg qseries [\-ms] +.ft P +.fi +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-m, \-\-missing +. +print patches not in series +.TP +.B \-s, \-\-summary +. +print first line of patch header +.UNINDENT +.SS qtop +.sp +.nf +.ft C +hg qtop [\-s] +.ft P +.fi +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-s, \-\-summary +. +print first line of patch header +.UNINDENT +.SS qunapplied +.sp +.nf +.ft C +hg qunapplied [\-1] [\-s] [PATCH] +.ft P +.fi +.sp +Returns 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-1, \-\-first +. +show only the first patch +.TP +.B \-s, \-\-summary +. +print first line of patch header +.UNINDENT +.SS strip +.sp +.nf +.ft C +hg strip [\-k] [\-f] [\-n] [\-B bookmark] [\-r] REV... +.ft P +.fi +.sp +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. +.sp +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. +.sp +Any stripped changesets are stored in \fB.hg/strip\-backup\fP as a +bundle (see \%\fBhg help bundle\fP\: and \%\fBhg help unbundle\fP\:). They can +be restored by running \%\fBhg unbundle .hg/strip\-backup/BUNDLE\fP\:, +where BUNDLE is the bundle file created by the strip. Note that +the local revision numbers will in general be different after the +restore. +.sp +Use the \-\-no\-backup option to discard the backup bundle once the +operation completes. +.sp +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. +.sp +Return 0 on success. +.sp +Options: +.INDENT 0.0 +.TP +.B \-r, \-\-rev +. +strip specified revision (optional, can specify revisions without this option) +.TP +.B \-f, \-\-force +. +force removal of changesets, discard uncommitted changes (no backup) +.TP +.B \-b, \-\-backup +. +bundle only changesets with local revision number greater than REV which are not descendants of REV (DEPRECATED) +.TP +.B \-\-no\-backup +. +no backups +.TP +.B \-\-nobackup +. +no backups (DEPRECATED) +.TP +.B \-n +. +ignored (DEPRECATED) +.TP +.B \-k, \-\-keep +. +do not modify working copy during strip +.TP +.B \-B, \-\-bookmark +. +remove revs only reachable from given bookmark +.UNINDENT +.SS notify +.sp +hooks for sending email push notifications +.sp +This extension implements hooks to send email notifications when +changesets are sent from or received by the local repository. +.sp +First, enable the extension as explained in \%\fBhg help extensions\fP\:, and +register the hook you want to run. \fBincoming\fP and \fBchangegroup\fP hooks +are run when changesets are received, while \fBoutgoing\fP hooks are for +changesets sent to another repository: +.sp +.nf +.ft C +[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 +.ft P +.fi +.sp +This registers the hooks. To enable notification, subscribers must +be assigned to repositories. The \fB[usersubs]\fP section maps multiple +repositories to a given recipient. The \fB[reposubs]\fP section maps +multiple recipients to a single repository: +.sp +.nf +.ft C +[usersubs] +# key is subscriber email, value is a comma\-separated list of repo glob +# patterns +user@host = pattern + +[reposubs] +# key is glob pattern, value is a comma\-separated list of subscriber +# emails +pattern = user@host +.ft P +.fi +.sp +Glob patterns are matched against absolute path to repository +root. +.sp +In order to place them under direct user management, \fB[usersubs]\fP and +\fB[reposubs]\fP sections may be placed in a separate \fBhgrc\fP file and +incorporated by reference: +.sp +.nf +.ft C +[notify] +config = /path/to/subscriptionsfile +.ft P +.fi +.sp +Notifications will not be sent until the \fBnotify.test\fP value is set +to \fBFalse\fP; see below. +.sp +Notifications content can be tweaked with the following configuration entries: +.INDENT 0.0 +.TP +.B notify.test +. +If \fBTrue\fP, print messages to stdout instead of sending them. Default: True. +.TP +.B notify.sources +. +Space\-separated list of change sources. Notifications are activated only +when a changeset\(aqs source is in this list. Sources may be: +.INDENT 7.0 +.TP +.B \fBserve\fP +.sp +changesets received via http or ssh +.TP +.B \fBpull\fP +.sp +changesets received via \fBhg pull\fP +.TP +.B \fBunbundle\fP +.sp +changesets received via \fBhg unbundle\fP +.TP +.B \fBpush\fP +.sp +changesets sent or received via \fBhg push\fP +.TP +.B \fBbundle\fP +.sp +changesets sent via \fBhg unbundle\fP +.UNINDENT +.sp +Default: serve. +.TP +.B notify.strip +. +Number of leading slashes to strip from url paths. By default, notifications +reference repositories with their absolute path. \fBnotify.strip\fP lets you +turn them into relative paths. For example, \fBnotify.strip=3\fP will change +\fB/long/path/repository\fP into \fBrepository\fP. Default: 0. +.TP +.B notify.domain +. +Default email domain for sender or recipients with no explicit domain. +.TP +.B notify.style +. +Style file to use when formatting emails. +.TP +.B notify.template +. +Template to use when formatting emails. +.TP +.B notify.incoming +. +Template to use when run as an incoming hook, overriding \fBnotify.template\fP. +.TP +.B notify.outgoing +. +Template to use when run as an outgoing hook, overriding \fBnotify.template\fP. +.TP +.B notify.changegroup +. +Template to use when running as a changegroup hook, overriding +\fBnotify.template\fP. +.TP +.B notify.maxdiff +. +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. +.TP +.B notify.maxsubject +. +Maximum number of characters in email\(aqs subject line. Default: 67. +.TP +.B notify.diffstat +. +Set to True to include a diffstat before diff content. Default: True. +.TP +.B notify.merge +. +If True, send notifications for merge changesets. Default: True. +.TP +.B notify.mbox +. +If set, append mails to this mbox file instead of sending. Default: None. +.TP +.B notify.fromauthor +. +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. +.UNINDENT +.sp +If set, the following entries will also be used to customize the +notifications: +.INDENT 0.0 +.TP +.B email.from +. +Email \fBFrom\fP address to use if none can be found in the generated +email content. +.TP +.B web.baseurl +. +Root repository URL to combine with repository paths when making +references. See also \fBnotify.strip\fP. +.UNINDENT +.SS pager +.sp +browse command output with an external pager +.sp +To set the pager that should be used, set the application variable: +.sp +.nf +.ft C +[pager] +pager = less \-FRX +.ft P +.fi +.sp +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. +.sp +You can disable the pager for certain commands by adding them to the +pager.ignore list: +.sp +.nf +.ft C +[pager] +ignore = version, help, update +.ft P +.fi +.sp +You can also enable the pager only for certain commands using +pager.attend. Below is the default list of commands to be paged: +.sp +.nf +.ft C +[pager] +attend = annotate, cat, diff, export, glog, log, qdiff +.ft P +.fi +.sp +Setting pager.attend to an empty value will cause all commands to be +paged. +.sp +If pager.attend is present, pager.ignore will be ignored. +.sp +To ignore global commands like \%\fBhg version\fP\: or \%\fBhg help\fP\:, you have +to specify them in your user configuration file. +.sp +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. +.SS patchbomb +.sp +command to send changesets as (a series of) patch emails +.sp +The series is started off with a "[PATCH 0 of N]" introduction, which +describes the series as a whole. +.sp +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: +.INDENT 0.0 +.IP \(bu 2 +. +The changeset description. +.IP \(bu 2 +. +[Optional] The result of running diffstat on the patch. +.IP \(bu 2 +. +The patch itself, as generated by \%\fBhg export\fP\:. +.UNINDENT +.sp +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. +.sp +To configure other defaults, add a section like this to your +configuration file: +.sp +.nf +.ft C +[email] +from = My Name <my@email> +to = recipient1, recipient2, ... +cc = cc1, cc2, ... +bcc = bcc1, bcc2, ... +reply\-to = address1, address2, ... +.ft P +.fi +.sp +Use \fB[patchbomb]\fP as configuration section name if you need to +override global \fB[email]\fP address settings. +.sp +Then you can use the \%\fBhg email\fP\: command to mail a series of +changesets as a patchbomb. +.sp +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. +.SS Commands +.SS email +.sp +.nf +.ft C +hg email [OPTION]... [DEST]... +.ft P +.fi +.sp +By default, diffs are sent in the format generated by +\%\fBhg export\fP\:, one per message. The series starts with a "[PATCH 0 +of N]" introduction, which describes the series as a whole. +.sp +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. +.sp +With the \-d/\-\-diffstat option, if the diffstat program is +installed, the result of running diffstat on the patch is inserted. +.sp +Finally, the patch itself, as generated by \%\fBhg export\fP\:. +.sp +With the \-d/\-\-diffstat or \-c/\-\-confirm options, you will be presented +with a final summary of all messages and asked for confirmation before +the messages are sent. +.sp +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. +.sp +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) +.sp +With \-b/\-\-bundle, changesets are selected as for \-\-outgoing, but a +single email containing a binary Mercurial bundle as an attachment +will be sent. +.sp +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. +.sp +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. +.sp +In case email sending fails, you will find a backup of your series +introductory message in \fB.hg/last\-email.txt\fP. +.sp +Examples: +.sp +.nf +.ft C +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 \e # ... and use formail to send from the mbox + \-bm \-t < mbox # ... using sendmail +.ft P +.fi +.sp +Before using this command, you will need to enable email in your +hgrc. See the [email] section in hgrc(5) for details. +.sp +Options: +.INDENT 0.0 +.TP +.B \-g, \-\-git +. +use git extended diff format +.TP +.B \-\-plain +. +omit hg patch header +.TP +.B \-o, \-\-outgoing +. +send changes not found in the target repository +.TP +.B \-b, \-\-bundle +. +send changes not in target as a binary bundle +.TP +.B \-\-bundlename +. +name of the bundle attachment file (default: bundle) +.TP +.B \-r, \-\-rev +. +a revision to send +.TP +.B \-\-force +. +run even when remote repository is unrelated (with \-b/\-\-bundle) +.TP +.B \-\-base +. +a base changeset to specify instead of a destination (with \-b/\-\-bundle) +.TP +.B \-\-intro +. +send an introduction email for a single patch +.TP +.B \-\-body +. +send patches as inline message text (default) +.TP +.B \-a, \-\-attach +. +send patches as attachments +.TP +.B \-i, \-\-inline +. +send patches as inline attachments +.TP +.B \-\-bcc +. +email addresses of blind carbon copy recipients +.TP +.B \-c, \-\-cc +. +email addresses of copy recipients +.TP +.B \-\-confirm +. +ask for confirmation before sending +.TP +.B \-d, \-\-diffstat +. +add diffstat output to messages +.TP +.B \-\-date +. +use the given date as the sending date +.TP +.B \-\-desc +. +use the given file as the series description +.TP +.B \-f, \-\-from +. +email address of sender +.TP +.B \-n, \-\-test +. +print messages that would be sent +.TP +.B \-m, \-\-mbox +. +write messages to mbox file instead of sending them +.TP +.B \-\-reply\-to +. +email addresses replies should be sent to +.TP +.B \-s, \-\-subject +. +subject of first message (intro or single patch) +.TP +.B \-\-in\-reply\-to +. +message identifier to reply to +.TP +.B \-\-flag +. +flags to add in subject prefixes +.TP +.B \-t, \-\-to +. +email addresses of recipients +.TP +.B \-e, \-\-ssh +. +specify ssh command to use +.TP +.B \-\-remotecmd +. +specify hg command to run on the remote side +.TP +.B \-\-insecure +. +do not verify server certificate (ignoring web.cacerts config) +.UNINDENT +.SS progress +.sp +show progress bars for some actions +.sp +This extension uses the progress information logged by hg commands +to draw progress bars that are as informative as possible. Some progress +bars only offer indeterminate information, while others have a definite +end point. +.sp +The following settings are available: +.sp +.nf +.ft C +[progress] +delay = 3 # number of seconds (float) before showing the progress bar +changedelay = 1 # changedelay: minimum delay before showing a new topic. + # If set to less than 3 * refresh, that value will + # be used instead. +refresh = 0.1 # time in seconds between refreshes of the progress bar +format = topic bar number estimate # format of the progress bar +width = <none> # if set, the maximum width of the progress information + # (that is, min(width, term width) will be used) +clear\-complete = True # clear the progress bar after it\(aqs done +disable = False # if true, don\(aqt show a progress bar +assume\-tty = False # if true, ALWAYS show a progress bar, unless + # disable is given +.ft P +.fi +.sp +Valid entries for the format field are topic, bar, number, unit, +estimate, speed, and item. item defaults to the last 20 characters of +the item, but this can be changed by adding either \fB\-<num>\fP which +would take the last num characters, or \fB+<num>\fP for the first num +characters. +.SS purge +.sp +command to delete untracked files from the working directory +.SS Commands +.SS purge +.sp +.nf +.ft C +hg purge [OPTION]... [DIR]... +.ft P +.fi +.sp +Delete files not known to Mercurial. This is useful to test local +and uncommitted changes in an otherwise\-clean source tree. +.sp +This means that purge will delete: +.INDENT 0.0 +.IP \(bu 2 +. +Unknown files: files marked with "?" by \%\fBhg status\fP\: +.IP \(bu 2 +. +Empty directories: in fact Mercurial ignores directories unless +they contain files under source control management +.UNINDENT +.sp +But it will leave untouched: +.INDENT 0.0 +.IP \(bu 2 +. +Modified and unmodified tracked files +.IP \(bu 2 +. +Ignored files (unless \-\-all is specified) +.IP \(bu 2 +. +New files added to the repository (with \%\fBhg add\fP\:) +.UNINDENT +.sp +If directories are given on the command line, only files in these +directories are considered. +.sp +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. +.sp +Options: +.INDENT 0.0 +.TP +.B \-a, \-\-abort\-on\-err +. +abort if an error occurs +.TP +.B \-\-all +. +purge ignored files too +.TP +.B \-p, \-\-print +. +print filenames instead of deleting them +.TP +.B \-0, \-\-print0 +. +end filenames with NUL, for use with xargs (implies \-p/\-\-print) +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.sp +aliases: clean +.UNINDENT +.SS rebase +.sp +command to move sets of revisions to a different ancestor +.sp +This extension lets you rebase changesets in an existing Mercurial +repository. +.sp +For more information: +\%http://mercurial.selenic.com/wiki/RebaseExtension\: +.SS Commands +.SS rebase +.sp +.nf +.ft C +hg rebase [\-s REV | \-b REV] [\-d REV] [OPTION] +.ft P +.fi +.sp +Rebase uses repeated merging to graft changesets from one part of +history (the source) onto another (the destination). This can be +useful for linearizing \fIlocal\fP changes relative to a master +development tree. +.sp +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. +.sp +If you don\(aqt specify a destination changeset (\fB\-d/\-\-dest\fP), +rebase uses the tipmost head of the current named branch as the +destination. (The destination changeset is not modified by +rebasing, but new changesets are added as its descendants.) +.sp +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 (\fB\-s/\-\-source\fP), rebase will +rebase that changeset and all of its descendants onto dest. If you +specify base (\fB\-b/\-\-base\fP), rebase will select ancestors of base +back to but not including the common ancestor with dest. Thus, +\fB\-b\fP is less precise but more convenient than \fB\-s\fP: you can +specify any changeset in the source branch, and rebase will select +the whole branch. If you specify neither \fB\-s\fP nor \fB\-b\fP, rebase +uses the parent of the working directory as the base. +.sp +By default, rebase recreates the changesets in the source branch +as descendants of dest and then destroys the originals. Use +\fB\-\-keep\fP 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. +.sp +One result of the rules for selecting the destination changeset +and source branch is that, unlike \fBmerge\fP, rebase will do +nothing if you are at the latest (tipmost) head of a named branch +with two heads. You need to explicitly specify source and/or +destination (or \fBupdate\fP to the other head, if it\(aqs the head of +the intended source branch). +.sp +If a rebase is interrupted to manually resolve a merge, it can be +continued with \-\-continue/\-c or aborted with \-\-abort/\-a. +.sp +Returns 0 on success, 1 if nothing to rebase. +.sp +Options: +.INDENT 0.0 +.TP +.B \-s, \-\-source +. +rebase from the specified changeset +.TP +.B \-b, \-\-base +. +rebase from the base of the specified changeset (up to greatest common ancestor of base and dest) +.TP +.B \-r, \-\-rev +. +rebase these revisions +.TP +.B \-d, \-\-dest +. +rebase onto the specified changeset +.TP +.B \-\-collapse +. +collapse the rebased changesets +.TP +.B \-m, \-\-message +. +use text as collapse commit message +.TP +.B \-e, \-\-edit +. +invoke editor on commit messages +.TP +.B \-l, \-\-logfile +. +read collapse commit message from file +.TP +.B \-\-keep +. +keep original changesets +.TP +.B \-\-keepbranches +. +keep original branch names +.TP +.B \-D, \-\-detach +. +(DEPRECATED) +.TP +.B \-t, \-\-tool +. +specify merge tool +.TP +.B \-c, \-\-continue +. +continue an interrupted rebase +.TP +.B \-a, \-\-abort +. +abort an interrupted rebase +.TP +.B \-\-style +. +display using template map file +.TP +.B \-\-template +. +display with template +.UNINDENT +.SS record +.sp +commands to interactively select changes for commit/qrefresh +.SS Commands +.SS qrecord +.sp +.nf +.ft C +hg qrecord [OPTION]... PATCH [FILE]... +.ft P +.fi +.sp +See \%\fBhg help qnew\fP\: & \%\fBhg help record\fP\: for more information and +usage. +.SS record +.sp +.nf +.ft C +hg record [OPTION]... [FILE]... +.ft P +.fi +.sp +If a list of files is omitted, all changes reported by \%\fBhg status\fP\: +will be candidates for recording. +.sp +See \%\fBhg help dates\fP\: for a list of formats valid for \-d/\-\-date. +.sp +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: +.sp +.nf +.ft C +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 +.ft P +.fi +.sp +This command is not available when committing a merge. +.sp +Options: +.INDENT 0.0 +.TP +.B \-A, \-\-addremove +. +mark new/missing files as added/removed before committing +.TP +.B \-\-close\-branch +. +mark a branch as closed, hiding it from the branch list +.TP +.B \-\-amend +. +amend the parent of the working dir +.TP +.B \-I, \-\-include +. +include names matching the given patterns +.TP +.B \-X, \-\-exclude +. +exclude names matching the given patterns +.TP +.B \-m, \-\-message +. +use text as commit message +.TP +.B \-l, \-\-logfile +. +read commit message from file +.TP +.B \-d, \-\-date +. +record the specified date as commit date +.TP +.B \-u, \-\-user +. +record the specified user as committer +.TP +.B \-S, \-\-subrepos +. +recurse into subrepositories +.TP +.B \-w, \-\-ignore\-all\-space +. +ignore white space when comparing lines +.TP +.B \-b, \-\-ignore\-space\-change +. +ignore changes in the amount of white space +.TP +.B \-B, \-\-ignore\-blank\-lines +. +ignore changes whose lines are all blank +.UNINDENT +.SS relink +.sp +recreates hardlinks between repository clones +.SS Commands +.SS relink +.sp +.nf +.ft C +hg relink [ORIGIN] +.ft P +.fi +.sp +When repositories are cloned locally, their data files will be +hardlinked so that they only use the space of a single repository. +.sp +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. +.sp +Similarly, passing \-\-rev to "hg clone" will fail to use any +hardlinks, falling back to a complete copy of the source +repository. +.sp +This command lets you recreate those hardlinks and reclaim that +wasted space. +.sp +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]. +.sp +Do not attempt any read operations on this repository while the +command is running. (Both repositories will be locked against +writes.) +.SS schemes +.sp +extend schemes with shortcuts to repository swarms +.sp +This extension allows you to specify shortcuts for parent URLs with a +lot of repositories to act like a scheme, for example: +.sp +.nf +.ft C +[schemes] +py = http://code.python.org/hg/ +.ft P +.fi +.sp +After that you can use it like: +.sp +.nf +.ft C +hg clone py://trunk/ +.ft P +.fi +.sp +Additionally there is support for some more complex schemas, for +example used by Google Code: +.sp +.nf +.ft C +[schemes] +gcode = http://{1}.googlecode.com/hg/ +.ft P +.fi +.sp +The syntax is taken from Mercurial templates, and you have unlimited +number of variables, starting with \fB{1}\fP and continuing with +\fB{2}\fP, \fB{3}\fP and so on. This variables will receive parts of URL +supplied, split by \fB/\fP. Anything not specified as \fB{part}\fP will be +just appended to an URL. +.sp +For convenience, the extension adds these schemes by default: +.sp +.nf +.ft C +[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/ +.ft P +.fi +.sp +You can override a predefined scheme by defining a new scheme with the +same name. +.SS share +.sp +share a common history between several working directories +.SS Commands +.SS share +.sp +.nf +.ft C +hg share [\-U] SOURCE [DEST] +.ft P +.fi +.sp +Initialize a new repository and working directory that shares its +history with another repository. +.IP Note +. +using rollback or extensions that destroy/modify history (mq, +rebase, etc.) can cause considerable confusion with shared +clones. In particular, if two shared clones are both updated to +the same changeset, and one of them destroys that changeset +with rollback, the other clone will suddenly stop working: all +operations will fail with "abort: working directory has unknown +parent". The only known workaround is to use debugsetparents on +the broken clone to reset it to a changeset that still exists +(e.g. tip). +.RE +.sp +Options: +.INDENT 0.0 +.TP +.B \-U, \-\-noupdate +. +do not create a working copy +.UNINDENT +.SS unshare +.sp +.nf +.ft C +hg unshare +.ft P +.fi +.sp +Copy the store data to the repo and remove the sharedpath data. +.SS transplant +.sp +command to transplant changesets from another branch +.sp +This extension allows you to transplant patches from another branch. +.sp +Transplanted patches are recorded in .hg/transplant/transplants, as a +map from a changeset hash to its hash in the source repository. +.SS Commands +.SS transplant +.sp +.nf +.ft C +hg transplant [\-s REPO] [\-b BRANCH [\-a]] [\-p REV] [\-m REV] [REV]... +.ft P +.fi +.sp +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. Use the +rebase extension instead if you want to move a whole branch of +unpublished changesets. +.sp +If \-\-log is specified, log messages will have a comment appended +of the form: +.sp +.nf +.ft C +(transplanted from CHANGESETHASH) +.ft P +.fi +.sp +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. +.sp +If \-\-source/\-s is specified, selects changesets from the named +repository. If \-\-branch/\-b is specified, selects changesets from +the branch holding the named revision, up to that revision. If +\-\-all/\-a is specified, all changesets on the branch will be +transplanted, otherwise you will be prompted to select the +changesets you want. +.sp +\%\fBhg transplant \-\-branch REV \-\-all\fP\: will transplant the +selected branch (up to the named revision) onto your current +working directory. +.sp +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. +.sp +Merge changesets may be transplanted directly by specifying the +proper parent changeset by calling \%\fBhg transplant \-\-parent\fP\:. +.sp +If no merges or revisions are provided, \%\fBhg transplant\fP\: will +start an interactive changeset browser. +.sp +If a changeset application fails, you can fix the merge by hand +and then resume where you left off by calling \%\fBhg transplant +\-\-continue/\-c\fP\:. +.sp +Options: +.INDENT 0.0 +.TP +.B \-s, \-\-source +. +pull patches from REPO +.TP +.B \-b, \-\-branch +. +pull patches from branch BRANCH +.TP +.B \-a, \-\-all +. +pull all changesets up to BRANCH +.TP +.B \-p, \-\-prune +. +skip over REV +.TP +.B \-m, \-\-merge +. +merge at REV +.TP +.B \-\-parent +. +parent to choose when transplanting merge +.TP +.B \-e, \-\-edit +. +invoke editor on commit messages +.TP +.B \-\-log +. +append transplant info to log message +.TP +.B \-c, \-\-continue +. +continue last transplant session after repair +.TP +.B \-\-filter +. +filter changesets through command +.UNINDENT +.SS win32mbcs +.sp +allow the use of MBCS paths with problematic encodings +.sp +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. +.sp +This extension is useful for: +.INDENT 0.0 +.IP \(bu 2 +. +Japanese Windows users using shift_jis encoding. +.IP \(bu 2 +. +Chinese Windows users using big5 encoding. +.IP \(bu 2 +. +All users who use a repository with one of problematic encodings on +case\-insensitive file system. +.UNINDENT +.sp +This extension is not needed for: +.INDENT 0.0 +.IP \(bu 2 +. +Any user who use only ASCII chars in path. +.IP \(bu 2 +. +Any user who do not use any of problematic encodings. +.UNINDENT +.sp +Note that there are some limitations on using this extension: +.INDENT 0.0 +.IP \(bu 2 +. +You should use single encoding in one repository. +.IP \(bu 2 +. +If the repository path ends with 0x5c, .hg/hgrc cannot be read. +.IP \(bu 2 +. +win32mbcs is not compatible with fixutf8 extension. +.UNINDENT +.sp +By default, win32mbcs uses encoding.encoding decided by Mercurial. +You can specify the encoding by config option: +.sp +.nf +.ft C +[win32mbcs] +encoding = sjis +.ft P +.fi +.sp +It is useful for the users who want to commit with UTF\-8 log message. +.SS win32text +.sp +perform automatic newline conversion +.INDENT 0.0 +.INDENT 3.5 +.sp +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. +.sp +We have therefore made the \fBeol\fP as an alternative. The \fBeol\fP +uses a version controlled file for its configuration and each clone +will therefore use the right settings from the start. +.UNINDENT +.UNINDENT +.sp +To perform automatic newline conversion, use: +.sp +.nf +.ft C +[extensions] +win32text = +[encode] +** = cleverencode: +# or ** = macencode: + +[decode] +** = cleverdecode: +# or ** = macdecode: +.ft P +.fi +.sp +If not doing conversion, to make sure you do not commit CRLF/CR by accident: +.sp +.nf +.ft C +[hooks] +pretxncommit.crlf = python:hgext.win32text.forbidcrlf +# or pretxncommit.cr = python:hgext.win32text.forbidcr +.ft P +.fi +.sp +To do the same check on a server to prevent CRLF/CR from being +pushed or pulled: +.sp +.nf +.ft C +[hooks] +pretxnchangegroup.crlf = python:hgext.win32text.forbidcrlf +# or pretxnchangegroup.cr = python:hgext.win32text.forbidcr +.ft P +.fi +.SS zeroconf +.sp +discover and advertise repositories on the local network +.sp +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. +.sp +To allow other people to discover your repository using run +\%\fBhg serve\fP\: in your repository: +.sp +.nf +.ft C +$ cd test +$ hg serve +.ft P +.fi +.sp +You can discover Zeroconf\-enabled repositories by running +\%\fBhg paths\fP\:: +.sp +.nf +.ft C +$ hg paths +zc\-test = http://example.com:8000/test +.ft P +.fi +.SH FILES +.INDENT 0.0 +.TP +.B \fB/etc/mercurial/hgrc\fP, \fB$HOME/.hgrc\fP, \fB.hg/hgrc\fP +.sp +This file contains defaults and configuration. Values in +\fB.hg/hgrc\fP override those in \fB$HOME/.hgrc\fP, and these override +settings made in the global \fB/etc/mercurial/hgrc\fP configuration. +See \%\fBhgrc\fP(5)\: for details of the contents and format of these +files. +.TP +.B \fB.hgignore\fP +.sp +This file contains regular expressions (one per line) that +describe file names that should be ignored by \fBhg\fP. For details, +see \%\fBhgignore\fP(5)\:. +.TP +.B \fB.hgsub\fP +.sp +This file defines the locations of all subrepositories, and +tells where the subrepository checkouts came from. For details, see +\%\fBhg help subrepos\fP\:. +.TP +.B \fB.hgsubstate\fP +.sp +This file is where Mercurial stores all nested repository states. \fINB: This +file should not be edited manually.\fP +.TP +.B \fB.hgtags\fP +.sp +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. +.TP +.B \fB.hg/last\-message.txt\fP +.sp +This file is used by \%\fBhg commit\fP\: to store a backup of the commit message +in case the commit fails. +.TP +.B \fB.hg/localtags\fP +.sp +This file can be used to define local tags which are not shared among +repositories. The file format is the same as for \fB.hgtags\fP, but it is +encoded using the local system encoding. +.UNINDENT +.sp +Some commands (e.g. revert) produce backup files ending in \fB.orig\fP, +if the \fB.orig\fP file already exists and is not tracked by Mercurial, +it will be overwritten. +.SH BUGS +.sp +Probably lots, please post them to the mailing list (see \%Resources\: +below) when you find them. +.SH SEE ALSO +.sp +\%\fBhgignore\fP(5)\:, \%\fBhgrc\fP(5)\: +.SH AUTHOR +.sp +Written by Matt Mackall <\%mpm@selenic.com\:> +.SH RESOURCES +.sp +Main Web Site: \%http://mercurial.selenic.com/\: +.sp +Source code repository: \%http://selenic.com/hg\: +.sp +Mailing list: \%http://selenic.com/mailman/listinfo/mercurial\: +.SH COPYING +.sp +Copyright (C) 2005\-2012 Matt Mackall. +Free use of this software is granted under the terms of the GNU General +Public License version 2 or any later version. +.\" Common link and substitution definitions. +. +.SH AUTHOR +Matt Mackall <mpm@selenic.com> + +Organization: Mercurial +.\" Generated by docutils manpage writer. +.\" +. diff --git a/doc/hg.1.html b/doc/hg.1.html new file mode 100644 index 0000000..9a0a22f --- /dev/null +++ b/doc/hg.1.html @@ -0,0 +1,8975 @@ +<?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.8.1: http://docutils.sourceforge.net/" /> +<title>hg</title> +<meta name="author" content="Matt Mackall <mpm@selenic.com>" /> +<meta name="organization" content="Mercurial" /> +<link rel="stylesheet" href="style.css" type="text/css" /> +</head> +<body> +<div class="document" id="hg"> +<h1 class="title">hg</h1> +<h2 class="subtitle" id="mercurial-source-code-management-system">Mercurial source code management system</h2> +<table class="docinfo" frame="void" rules="none"> +<col class="docinfo-name" /> +<col class="docinfo-content" /> +<tbody valign="top"> +<tr><th class="docinfo-name">Author:</th> +<td>Matt Mackall <<a class="reference external" href="mailto:mpm@selenic.com">mpm@selenic.com</a>></td></tr> +<tr><th class="docinfo-name">Organization:</th> +<td>Mercurial</td></tr> +<tr class="field"><th class="docinfo-name">Manual section:</th><td class="field-body">1</td> +</tr> +<tr class="field"><th class="docinfo-name">Manual group:</th><td class="field-body">Mercurial Manual</td> +</tr> +</tbody> +</table> +<div class="contents htmlonly topic" id="contents"> +<p class="topic-title first">Contents</p> +<ul class="simple"> +<li><a class="reference internal" href="#synopsis" id="id39">Synopsis</a></li> +<li><a class="reference internal" href="#description" id="id40">Description</a></li> +<li><a class="reference internal" href="#command-elements" id="id41">Command Elements</a></li> +<li><a class="reference internal" href="#options" id="id42">Options</a></li> +<li><a class="reference internal" href="#commands" id="id43">Commands</a></li> +<li><a class="reference internal" href="#date-formats" id="id44">Date Formats</a></li> +<li><a class="reference internal" href="#diff-formats" id="id45">Diff Formats</a></li> +<li><a class="reference internal" href="#environment-variables" id="id46">Environment Variables</a></li> +<li><a class="reference internal" href="#using-additional-features" id="id47">Using Additional Features</a></li> +<li><a class="reference internal" href="#specifying-file-sets" id="id48">Specifying File Sets</a></li> +<li><a class="reference internal" href="#id1" id="id49">Glossary</a></li> +<li><a class="reference internal" href="#syntax-for-mercurial-ignore-files" id="id50">Syntax for Mercurial Ignore Files</a></li> +<li><a class="reference internal" href="#configuring-hgweb" id="id51">Configuring hgweb</a></li> +<li><a class="reference internal" href="#id4" id="id52">Merge Tools</a></li> +<li><a class="reference internal" href="#specifying-multiple-revisions" id="id53">Specifying Multiple Revisions</a></li> +<li><a class="reference internal" href="#file-name-patterns" id="id54">File Name Patterns</a></li> +<li><a class="reference internal" href="#working-with-phases" id="id55">Working with Phases</a></li> +<li><a class="reference internal" href="#specifying-single-revisions" id="id56">Specifying Single Revisions</a></li> +<li><a class="reference internal" href="#specifying-revision-sets" id="id57">Specifying Revision Sets</a></li> +<li><a class="reference internal" href="#subrepositories" id="id58">Subrepositories</a></li> +<li><a class="reference internal" href="#template-usage" id="id59">Template Usage</a></li> +<li><a class="reference internal" href="#url-paths" id="id60">URL Paths</a></li> +<li><a class="reference internal" href="#id5" id="id61">Extensions</a></li> +<li><a class="reference internal" href="#files" id="id62">Files</a></li> +<li><a class="reference internal" href="#bugs" id="id63">Bugs</a></li> +<li><a class="reference internal" href="#see-also" id="id64">See Also</a></li> +<li><a class="reference internal" href="#author" id="id65">Author</a></li> +<li><a class="reference internal" href="#resources" id="id66">Resources</a></li> +<li><a class="reference internal" href="#copying" id="id67">Copying</a></li> +</ul> +</div> +<div class="section" id="synopsis"> +<h1><a class="toc-backref" href="#contents">Synopsis</a></h1> +<p><strong>hg</strong> <em>command</em> [<em>option</em>]... [<em>argument</em>]...</p> +</div> +<div class="section" id="description"> +<h1><a class="toc-backref" href="#contents">Description</a></h1> +<p>The <strong>hg</strong> command provides a command line interface to the Mercurial +system.</p> +</div> +<div class="section" id="command-elements"> +<h1><a class="toc-backref" href="#contents">Command Elements</a></h1> +<dl class="docutils"> +<dt>files...</dt> +<dd>indicates one or more filename or relative path filenames; see +<a class="reference internal" href="#file-name-patterns">File Name Patterns</a> for information on pattern matching</dd> +<dt>path</dt> +<dd>indicates a path on the local machine</dd> +<dt>revision</dt> +<dd>indicates a changeset which can be specified as a changeset +revision number, a tag, or a unique substring of the changeset +hash value</dd> +<dt>repository path</dt> +<dd>either the pathname of a local repository or the URI of a remote +repository.</dd> +</dl> +</div> +<div class="section" id="options"> +<h1><a class="toc-backref" href="#contents">Options</a></h1> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-R</span>, <span class="option">--repository</span></kbd></td> +</tr> +<tr><td> </td><td>repository root directory or name of overlay bundle file</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--cwd</span></kbd></td> +<td>change working directory</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-y</span>, <span class="option">--noninteractive</span></kbd></td> +</tr> +<tr><td> </td><td>do not prompt, 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"> +<kbd><span class="option">--config</span></kbd></td> +<td>set/override config option (use 'section.name=value')</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--debug</span></kbd></td> +<td>enable debugging output</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--debugger</span></kbd></td> +<td>start debugger</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--encoding</span></kbd></td> +<td>set the charset encoding (default: ascii)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--encodingmode</span></kbd></td> +<td>set the charset encoding mode (default: strict)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--traceback</span></kbd></td> +<td>always print a traceback on exception</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--time</span></kbd></td> +<td>time how long the command takes</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--profile</span></kbd></td> +<td>print command execution profile</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--version</span></kbd></td> +<td>output version information and exit</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-h</span>, <span class="option">--help</span></kbd></td> +<td>display help and exit</td></tr> +</tbody> +</table> +</div> +<div class="section" id="commands"> +<h1><a class="toc-backref" href="#contents">Commands</a></h1> +<div class="section" id="add"> +<h2>add</h2> +<pre class="literal-block"> +hg add [OPTION]... [FILE]... +</pre> +<p>Schedule files to be version controlled and added to the +repository.</p> +<p>The files will be added to the repository at the next commit. To +undo an add before that, see <a class="reference external" href="hg.1.html#forget"><tt class="docutils literal">hg forget</tt></a>.</p> +<p>If no names are given, add all files to the repository.</p> +<div class="verbose container"> +<p>An example showing how new (unknown) files are added +automatically by <a class="reference external" href="hg.1.html#add"><tt class="docutils literal">hg add</tt></a>:</p> +<pre class="literal-block"> +$ ls +foo.c +$ hg status +? foo.c +$ hg add +adding foo.c +$ hg status +A foo.c +</pre> +</div> +<p>Returns 0 if all files are successfully added.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td>exclude names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-S</span>, <span class="option">--subrepos</span></kbd></td> +<td>recurse into subrepositories</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-n</span>, <span class="option">--dry-run</span></kbd></td> +<td>do not perform actions, just print output</td></tr> +</tbody> +</table> +</div> +<div class="section" id="addremove"> +<h2>addremove</h2> +<pre class="literal-block"> +hg addremove [OPTION]... [FILE]... +</pre> +<p>Add all new files and remove all missing files from the +repository.</p> +<p>New files are ignored if they match any of the patterns in +<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</span></kbd></td> +</tr> +<tr><td> </td><td>guess renamed files by similarity (0<=s<=100)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td>exclude names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-n</span>, <span class="option">--dry-run</span></kbd></td> +<td>do not perform actions, just print output</td></tr> +</tbody> +</table> +</div> +<div class="section" id="annotate"> +<h2>annotate</h2> +<pre class="literal-block"> +hg annotate [-r REV] [-f] [-a] [-u] [-d] [-n] [-c] [-l] FILE... +</pre> +<p>List changes in files, showing the revision id responsible for +each line</p> +<p>This command is useful for discovering when a change was made and +by whom.</p> +<p>Without the -a/--text option, annotate will avoid processing files +it detects as binary. With -a, annotate will annotate the file +anyway, although the results will probably be neither useful +nor desirable.</p> +<p>Returns 0 on success.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>annotate the specified revision</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--follow</span></kbd></td> +<td>follow copies/renames and list the filename (DEPRECATED)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--no-follow</span></kbd></td> +<td>don't follow copies and renames</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-a</span>, <span class="option">--text</span></kbd></td> +<td>treat all files as text</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td> +<td>list the author (long with -v)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-f</span>, <span class="option">--file</span></kbd></td> +<td>list the filename</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td> +<td>list the date (short with -q)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-n</span>, <span class="option">--number</span></kbd></td> +<td>list the revision number (default)</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-c</span>, <span class="option">--changeset</span></kbd></td> +</tr> +<tr><td> </td><td>list the changeset</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-l</span>, <span class="option">--line-number</span></kbd></td> +</tr> +<tr><td> </td><td>show line number at the first appearance</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-w</span>, <span class="option">--ignore-all-space</span></kbd></td> +</tr> +<tr><td> </td><td>ignore white space when comparing lines</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-b</span>, <span class="option">--ignore-space-change</span></kbd></td> +</tr> +<tr><td> </td><td>ignore changes in the amount of white space</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-B</span>, <span class="option">--ignore-blank-lines</span></kbd></td> +</tr> +<tr><td> </td><td>ignore changes whose lines are all blank</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td><p class="first">exclude names matching the given patterns</p> +<p class="last">aliases: blame</p> +</td></tr> +</tbody> +</table> +</div> +<div class="section" id="archive"> +<h2>archive</h2> +<pre class="literal-block"> +hg archive [OPTION]... DEST +</pre> +<p>By default, the revision used is the parent of the working +directory; use -r/--rev to specify a different revision.</p> +<p>The archive type is automatically detected based on file +extension (or override using -t/--type).</p> +<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"> +<kbd><span class="option">-p</span>, <span class="option">--prefix</span></kbd></td> +<td>directory prefix for files in archive</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>revision to distribute</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-t</span>, <span class="option">--type</span></kbd></td> +<td>type of distribution to create</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-S</span>, <span class="option">--subrepos</span></kbd></td> +<td>recurse into subrepositories</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td>exclude names matching the given patterns</td></tr> +</tbody> +</table> +</div> +<div class="section" id="backout"> +<h2>backout</h2> +<pre class="literal-block"> +hg backout [OPTION]... [-r] REV +</pre> +<p>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.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">--merge</span></kbd></td> +<td>merge with old dirstate parent after backout</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--parent</span></kbd></td> +<td>parent to choose when backing out merge (DEPRECATED)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>revision to backout</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-t</span>, <span class="option">--tool</span></kbd></td> +<td>specify merge tool</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td>exclude names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td> +<td>use text as commit message</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td> +<td>read commit message from file</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td> +<td>record the specified date as commit date</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td> +<td>record the specified user as committer</td></tr> +</tbody> +</table> +</div> +<div class="section" id="bisect"> +<h2>bisect</h2> +<pre class="literal-block"> +hg bisect [-gbsr] [-U] [-c CMD] [REV] +</pre> +<p>This command helps to find changesets which introduce problems. To +use, mark the earliest changeset you know exhibits the problem as +bad, then mark the latest changeset which is free from the problem +as good. Bisect will update your working directory to a revision +for testing (unless the -U/--noupdate option is specified). Once +you have performed tests, mark the working directory as good or +bad, and bisect will either update to another candidate changeset +or announce that it has found the bad revision.</p> +<p>As a shortcut, you can also use the revision argument to mark a +revision as good or bad without checking it out first.</p> +<p>If you supply a command, it will be used for automatic bisection. +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 12, and good revision 34:</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 (eg. 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">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">with the graphlog extension, 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"> +<kbd><span class="option">-c</span>, <span class="option">--command</span></kbd></td> +<td>use command to check changeset state</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-U</span>, <span class="option">--noupdate</span></kbd></td> +<td>do not update to target</td></tr> +</tbody> +</table> +</div> +<div class="section" id="bookmarks"> +<h2>bookmarks</h2> +<pre class="literal-block"> +hg bookmarks [-f] [-d] [-i] [-m NAME] [-r REV] [NAME] +</pre> +<p>Bookmarks are pointers to certain commits that move when committing. +Bookmarks are local. They can be renamed, copied and deleted. It is +possible to use <a class="reference external" href="hg.1.html#merge"><tt class="docutils literal">hg merge NAME</tt></a> to merge from a given bookmark, and +<a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update NAME</tt></a> to update to a given bookmark.</p> +<p>You can use <a class="reference external" href="hg.1.html#bookmark"><tt class="docutils literal">hg bookmark NAME</tt></a> to set a bookmark on the working +directory's parent revision with the given name. If you specify +a revision using -r REV (where REV may be an existing bookmark), +the bookmark is assigned to that revision.</p> +<p>Bookmarks can be pushed and pulled between repositories (see <a class="reference external" href="hg.1.html#push"><tt class="docutils literal">hg help +push</tt></a> and <a class="reference external" href="hg.1.html#pull"><tt class="docutils literal">hg help pull</tt></a>). This requires both the local and remote +repositories to support bookmarks. For versions prior to 1.8, this means +the bookmarks extension must be enabled.</p> +<p>With -i/--inactive, the new bookmark will not be made the active +bookmark. If -r/--rev is given, the new bookmark will not be made +active even if -i/--inactive is not given. If no NAME is given, the +current active bookmark will be marked inactive.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td> +<td>force</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>revision</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-d</span>, <span class="option">--delete</span></kbd></td> +<td>delete a given bookmark</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-m</span>, <span class="option">--rename</span></kbd></td> +<td>rename a given bookmark</td></tr> +<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> +</tbody> +</table> +</div> +<div class="section" id="branch"> +<h2>branch</h2> +<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, even if it's inactive.</p> +<p>Use -C/--clean to reset the working directory branch to that of +the parent of the working directory, negating a previous branch +change.</p> +<p>Use the command <a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update</tt></a> to switch to an existing branch. Use +<a class="reference external" href="hg.1.html#commit"><tt class="docutils literal">hg commit <span class="pre">--close-branch</span></tt></a> to mark this branch as closed.</p> +<p>Returns 0 on success.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td> +<td>set branch name even if it shadows an existing branch</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-C</span>, <span class="option">--clean</span></kbd></td> +<td>reset branch name to parent branch name</td></tr> +</tbody> +</table> +</div> +<div class="section" id="branches"> +<h2>branches</h2> +<pre class="literal-block"> +hg branches [-ac] +</pre> +<p>List the repository's named branches, indicating which ones are +inactive. If -c/--closed is specified, also list branches which have +been marked closed (see <a class="reference external" href="hg.1.html#commit"><tt class="docutils literal">hg commit <span class="pre">--close-branch</span></tt></a>).</p> +<p>If -a/--active is specified, only show active branches. A branch +is considered active if it contains repository heads.</p> +<p>Use the command <a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update</tt></a> to switch to an existing branch.</p> +<p>Returns 0.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-a</span>, <span class="option">--active</span></kbd></td> +<td>show only branches that have unmerged heads</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-c</span>, <span class="option">--closed</span></kbd></td> +<td>show normal and closed branches</td></tr> +</tbody> +</table> +</div> +<div class="section" id="bundle"> +<h2>bundle</h2> +<pre class="literal-block"> +hg bundle [-f] [-t TYPE] [-a] [-r REV]... [--base REV]... FILE [DEST] +</pre> +<p>Generate a compressed changegroup file collecting changesets not +known to be in another repository.</p> +<p>If you omit the destination repository, then hg assumes the +destination will have all the nodes you specify with --base +parameters. To create a bundle containing all changesets, use +-a/--all (or --base null).</p> +<p>You can change compression method with the -t/--type option. +The available compression methods are: none, bzip2, and +gzip (by default, bundles are compressed using bzip2).</p> +<p>The bundle file can then be transferred using conventional means +and applied to another repository with the unbundle or pull +command. This is useful when direct push and pull are not +available or when exporting an entire repository is undesirable.</p> +<p>Applying bundles preserves all changeset contents including +permissions, copy/rename information, and revision history.</p> +<p>Returns 0 on success, 1 if no changes found.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td> +<td>run even when the destination is unrelated</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>a changeset intended to be added to the destination</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td> +<td>a specific branch you would like to bundle</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--base</span></kbd></td> +<td>a base changeset assumed to be available at the destination</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-a</span>, <span class="option">--all</span></kbd></td> +<td>bundle all changesets in the repository</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-t</span>, <span class="option">--type</span></kbd></td> +<td>bundle compression type to use (default: bzip2)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td> +<td>specify ssh command to use</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--remotecmd</span></kbd></td> +<td>specify hg command to run on the remote side</td></tr> +<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="cat"> +<h2>cat</h2> +<pre class="literal-block"> +hg cat [OPTION]... FILE... +</pre> +<p>Print the specified files as they were at the given revision. If +no revision is given, the parent of the working directory is used, +or tip if no revision is checked out.</p> +<p>Output may be to a file, in which case the name of the file is +given using a format string. The formatting rules are the same as +for the export command, with the following additions:</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field"><th class="field-name"><tt class="docutils literal">%s</tt>:</th><td class="field-body">basename of file being printed</td> +</tr> +<tr class="field"><th class="field-name"><tt class="docutils literal">%d</tt>:</th><td class="field-body">dirname of file being printed, or '.' if in repository root</td> +</tr> +<tr class="field"><th class="field-name"><tt class="docutils literal">%p</tt>:</th><td class="field-body">root-relative path name of file being printed</td> +</tr> +</tbody> +</table> +<p>Returns 0 on success.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-o</span>, <span class="option">--output</span></kbd></td> +<td>print output to file with formatted name</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>print the given revision</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--decode</span></kbd></td> +<td>apply any matching decode filter</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td>exclude names matching the given patterns</td></tr> +</tbody> +</table> +</div> +<div class="section" id="clone"> +<h2>clone</h2> +<pre class="literal-block"> +hg clone [OPTION]... SOURCE [DEST] +</pre> +<p>Create a copy of an existing repository in a new directory.</p> +<p>If no destination directory name is specified, it defaults to the +basename of the source.</p> +<p>The location of the source is added to the new repository's +<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>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 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 copy (only a repository)</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-u</span>, <span class="option">--updaterev</span></kbd></td> +</tr> +<tr><td> </td><td>revision, tag or branch to check out</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>include the specified changeset</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td> +<td>clone only the specified branch</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--pull</span></kbd></td> +<td>use pull protocol to copy metadata</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--uncompressed</span></kbd></td> +<td>use uncompressed transfer (fast over LAN)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td> +<td>specify ssh command to use</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--remotecmd</span></kbd></td> +<td>specify hg command to run on the remote side</td></tr> +<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="commit"> +<h2>commit</h2> +<pre class="literal-block"> +hg commit [OPTION]... [FILE]... +</pre> +<p>Commit changes to the given files into the repository. Unlike a +centralized 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 --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 as closed, hiding it from the branch list</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--amend</span></kbd></td> +<td>amend the parent of the working dir</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td>exclude names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td> +<td>use text as commit message</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td> +<td>read commit message from file</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td> +<td>record the specified date as commit date</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td> +<td>record the specified user as committer</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-S</span>, <span class="option">--subrepos</span></kbd></td> +<td><p class="first">recurse into subrepositories</p> +<p class="last">aliases: ci</p> +</td></tr> +</tbody> +</table> +</div> +<div class="section" id="copy"> +<h2>copy</h2> +<pre class="literal-block"> +hg copy [OPTION]... [SOURCE]... DEST +</pre> +<p>Mark dest as having copies of source files. If dest is a +directory, copies are put in that directory. If dest is a file, +the source must be a single file.</p> +<p>By default, this command copies the contents of files as they +exist in the working directory. If invoked with -A/--after, the +operation is recorded, but no copying is performed.</p> +<p>This command takes effect with the next commit. To undo a copy +before that, see <a class="reference external" href="hg.1.html#revert"><tt class="docutils literal">hg revert</tt></a>.</p> +<p>Returns 0 on success, 1 if errors are encountered.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-A</span>, <span class="option">--after</span></kbd></td> +<td>record a copy that has already occurred</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td> +<td>forcibly copy over an existing managed file</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td>exclude names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-n</span>, <span class="option">--dry-run</span></kbd></td> +<td><p class="first">do not perform actions, just print output</p> +<p class="last">aliases: cp</p> +</td></tr> +</tbody> +</table> +</div> +<div class="section" id="diff"> +<h2>diff</h2> +<pre class="literal-block"> +hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]... +</pre> +<p>Show differences between revisions for the specified files.</p> +<p>Differences between files are shown using the unified diff format.</p> +<div class="note"> +<p class="first admonition-title">Note</p> +<p class="last">diff may generate unexpected results for merges, as it will +default to comparing against the working directory's first +parent changeset if no revisions are specified.</p> +</div> +<p>When two revision arguments are given, then changes are shown +between those revisions. If only one revision is specified then +that revision is compared to the working directory, and, when no +revisions are specified, the working directory files are compared +to its parent.</p> +<p>Alternatively you can specify -c/--change with a revision to see +the changes in that changeset relative to its first parent.</p> +<p>Without the -a/--text option, diff will avoid generating diffs of +files it detects as binary. With -a, diff will generate a diff +anyway, probably with undesirable results.</p> +<p>Use the -g/--git option to generate diffs in the git extended diff +format. For more information, read <a class="reference external" href="hg.1.html#diffs"><tt class="docutils literal">hg help diffs</tt></a>.</p> +<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"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>revision</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-c</span>, <span class="option">--change</span></kbd></td> +<td>change made by revision</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-a</span>, <span class="option">--text</span></kbd></td> +<td>treat all files as text</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td> +<td>use git extended diff format</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--nodates</span></kbd></td> +<td>omit dates from diff headers</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-p</span>, <span class="option">--show-function</span></kbd></td> +</tr> +<tr><td> </td><td>show which function each change is in</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--reverse</span></kbd></td> +<td>produce a diff that undoes the changes</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-w</span>, <span class="option">--ignore-all-space</span></kbd></td> +</tr> +<tr><td> </td><td>ignore white space when comparing lines</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-b</span>, <span class="option">--ignore-space-change</span></kbd></td> +</tr> +<tr><td> </td><td>ignore changes in the amount of white space</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-B</span>, <span class="option">--ignore-blank-lines</span></kbd></td> +</tr> +<tr><td> </td><td>ignore changes whose lines are all blank</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-U</span>, <span class="option">--unified</span></kbd></td> +<td>number of lines of context to show</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--stat</span></kbd></td> +<td>output diffstat-style summary of changes</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td>exclude names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-S</span>, <span class="option">--subrepos</span></kbd></td> +<td>recurse into subrepositories</td></tr> +</tbody> +</table> +</div> +<div class="section" id="export"> +<h2>export</h2> +<pre class="literal-block"> +hg export [OPTION]... [-o OUTFILESPEC] [-r] REV... +</pre> +<p>Print the changeset header and diffs for one or more revisions.</p> +<p>The information shown in the changeset header is: author, date, +branch name (if non-default), changeset hash, parent(s) and commit +comment.</p> +<div class="note"> +<p class="first admonition-title">Note</p> +<p class="last">export may generate unexpected diff output for merge +changesets, as it will compare the merge changeset against its +first parent only.</p> +</div> +<p>Output may be to a file, in which case the name of the file is +given using a format string. The formatting rules are as follows:</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field"><th class="field-name"><tt class="docutils literal">%%</tt>:</th><td class="field-body">literal "%" character</td> +</tr> +<tr class="field"><th class="field-name"><tt class="docutils literal">%H</tt>:</th><td class="field-body">changeset hash (40 hexadecimal digits)</td> +</tr> +<tr class="field"><th class="field-name"><tt class="docutils literal">%N</tt>:</th><td class="field-body">number of patches being generated</td> +</tr> +<tr class="field"><th class="field-name"><tt class="docutils literal">%R</tt>:</th><td class="field-body">changeset revision number</td> +</tr> +<tr class="field"><th class="field-name"><tt class="docutils literal">%b</tt>:</th><td class="field-body">basename of the exporting repository</td> +</tr> +<tr class="field"><th class="field-name"><tt class="docutils literal">%h</tt>:</th><td class="field-body">short-form changeset hash (12 hexadecimal digits)</td> +</tr> +<tr class="field"><th class="field-name"><tt class="docutils literal">%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"> +<kbd><span class="option">-o</span>, <span class="option">--output</span></kbd></td> +<td>print output to file with formatted name</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">--switch-parent</span></kbd></td> +</tr> +<tr><td> </td><td>diff against the second parent</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>revisions to export</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-a</span>, <span class="option">--text</span></kbd></td> +<td>treat all files as text</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td> +<td>use git extended diff format</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--nodates</span></kbd></td> +<td>omit dates from diff headers</td></tr> +</tbody> +</table> +</div> +<div class="section" id="forget"> +<h2>forget</h2> +<pre class="literal-block"> +hg forget [OPTION]... FILE... +</pre> +<p>Mark the specified files so they will no longer be tracked +after the next commit.</p> +<p>This only removes files from the current branch, not from the +entire project history, and it does not delete them from the +working directory.</p> +<p>To undo a forget before the next commit, see <a class="reference external" href="hg.1.html#add"><tt class="docutils literal">hg add</tt></a>.</p> +<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"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td>exclude names matching the given patterns</td></tr> +</tbody> +</table> +</div> +<div class="section" id="graft"> +<h2>graft</h2> +<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 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.</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 tip +</pre> +</li> +</ul> +</div> +<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"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></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" 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"> +<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td> +<td>record the specified date as commit date</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td> +<td>record the specified user as committer</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-t</span>, <span class="option">--tool</span></kbd></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> +</div> +<div class="section" id="grep"> +<h2>grep</h2> +<pre class="literal-block"> +hg grep [OPTION]... PATTERN [FILE]... +</pre> +<p>Search revisions of files for a regular expression.</p> +<p>This command behaves differently than Unix grep. It only accepts +Python/Perl regexps. It searches repository history, not the +working directory. It always prints the revision number in which a +match appears.</p> +<p>By default, grep only prints output for the first revision of a +file in which it finds a match. To get it to print every revision +that contains a change in match status ("-" for a match that +becomes a non-match, or "+" for a non-match that becomes a match), +use the --all flag.</p> +<p>Returns 0 if a match is found, 1 otherwise.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-0</span>, <span class="option">--print0</span></kbd></td> +<td>end fields with NUL</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--all</span></kbd></td> +<td>print all revisions that match</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-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"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>only search files changed within revision range</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td> +<td>list the author (long with -v)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td> +<td>list the date (short with -q)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td>exclude names matching the given patterns</td></tr> +</tbody> +</table> +</div> +<div class="section" id="heads"> +<h2>heads</h2> +<pre class="literal-block"> +hg heads [-ct] [-r STARTREV] [REV]... +</pre> +<p>With no arguments, show all repository branch heads.</p> +<p>Repository "heads" are changesets with no child changesets. They are +where development generally takes place and are the usual targets +for update and merge operations. Branch heads are changesets that have +no child changeset on the same branch.</p> +<p>If one or more REVs are given, only branch heads on the branches +associated with the specified changesets are shown. This means +that you can use <a class="reference external" href="hg.1.html#heads"><tt class="docutils literal">hg heads foo</tt></a> to see the heads on a branch +named <tt class="docutils literal">foo</tt>.</p> +<p>If -c/--closed is specified, also show branch heads marked closed +(see <a class="reference external" href="hg.1.html#commit"><tt class="docutils literal">hg commit <span class="pre">--close-branch</span></tt></a>).</p> +<p>If STARTREV is specified, only those heads that are descendants of +STARTREV will be displayed.</p> +<p>If -t/--topo is specified, named branch mechanics will be ignored and only +changesets without children will be shown.</p> +<p>Returns 0 if matching heads are found, 1 if not.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>show only heads which are descendants of STARTREV</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-t</span>, <span class="option">--topo</span></kbd></td> +<td>show topological heads only</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-a</span>, <span class="option">--active</span></kbd></td> +<td>show active branchheads only (DEPRECATED)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-c</span>, <span class="option">--closed</span></kbd></td> +<td>show normal and closed branch heads</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--style</span></kbd></td> +<td>display using template map file</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--template</span></kbd></td> +<td>display with template</td></tr> +</tbody> +</table> +</div> +<div class="section" id="help"> +<h2>help</h2> +<pre class="literal-block"> +hg help [-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"> +<kbd><span class="option">-k</span>, <span class="option">--keyword</span></kbd></td> +<td>show topics matching keyword</td></tr> +</tbody> +</table> +</div> +<div class="section" id="identify"> +<h2>identify</h2> +<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"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>identify the specified revision</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-n</span>, <span class="option">--num</span></kbd></td> +<td>show local revision number</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-i</span>, <span class="option">--id</span></kbd></td> +<td>show global revision id</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td> +<td>show branch</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-t</span>, <span class="option">--tags</span></kbd></td> +<td>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"> +<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td> +<td>specify ssh command to use</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--remotecmd</span></kbd></td> +<td>specify hg command to run on the remote side</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--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> +<pre class="literal-block"> +hg import [OPTION]... PATCH... +</pre> +<p>Import a list of patches and commit them individually (unless +--no-commit is specified).</p> +<p>If there are outstanding changes in the working directory, import +will abort unless given the -f/--force flag.</p> +<p>You can import a patch straight from a mail message. Even patches +as attachments work (to use the body part, it must have type +text/plain or text/x-patch). From and Subject headers of email +message are used as default committer and commit message. All +text/plain body parts before first diff are added to commit +message.</p> +<p>If the imported patch was generated by <a class="reference external" href="hg.1.html#export"><tt class="docutils literal">hg export</tt></a>, user and +description from patch override values from message headers and +body. Values given on command line with -m/--message and -u/--user +override these.</p> +<p>If --exact is specified, import will set the working directory to +the parent of each patch before applying it, and will abort if the +resulting changeset has a different ID than the one recorded in +the patch. This may happen due to character set problems or other +deficiencies in the text patch format.</p> +<p>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>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> +</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">-p</span>, <span class="option">--strip</span></kbd></td> +<td>directory strip option for patch. This has the same meaning as the corresponding patch option (default: 1)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-b</span>, <span class="option">--base</span></kbd></td> +<td>base path (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</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">--exact</span></kbd></td> +<td>apply patch to the nodes from which it was generated</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">--import-branch</span></kbd></td> +</tr> +<tr><td> </td><td>use any branch information in patch (implied by --exact)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td> +<td>use text as commit message</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td> +<td>read commit message from file</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td> +<td>record the specified date as commit date</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td> +<td>record the specified user as committer</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-s</span>, <span class="option">--similarity</span></kbd></td> +</tr> +<tr><td> </td><td><p class="first">guess renamed files by similarity (0<=s<=100)</p> +<p class="last">aliases: patch</p> +</td></tr> +</tbody> +</table> +</div> +<div class="section" id="incoming"> +<h2>incoming</h2> +<pre class="literal-block"> +hg incoming [-p] [-n] [-M] [-f] [-r REV]... [--bundle FILENAME] [SOURCE] +</pre> +<p>Show new changesets found in the specified path/URL or the default +pull location. These are the changesets that would have been pulled +if a pull at the time you issued this command.</p> +<p>For remote repository, using --bundle avoids downloading the +changesets twice if the incoming is followed by a pull.</p> +<p>See pull for valid source format details.</p> +<p>Returns 0 if there are incoming changes, 1 otherwise.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td> +<td>run even if remote repository is unrelated</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-n</span>, <span class="option">--newest-first</span></kbd></td> +</tr> +<tr><td> </td><td>show newest record first</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--bundle</span></kbd></td> +<td>file to store the bundles into</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>a remote changeset intended to be added</td></tr> +<tr><td class="option-group" 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"> +<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td> +<td>a specific branch you would like to pull</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-p</span>, <span class="option">--patch</span></kbd></td> +<td>show patch</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td> +<td>use git extended diff format</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-l</span>, <span class="option">--limit</span></kbd></td> +<td>limit number of changes displayed</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-M</span>, <span class="option">--no-merges</span></kbd></td> +</tr> +<tr><td> </td><td>do not show merges</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--stat</span></kbd></td> +<td>output diffstat-style summary of changes</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-G</span>, <span class="option">--graph</span></kbd></td> +<td>show the revision DAG</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--style</span></kbd></td> +<td>display using template map file</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--template</span></kbd></td> +<td>display with template</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td> +<td>specify ssh command to use</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--remotecmd</span></kbd></td> +<td>specify hg command to run on the remote side</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--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><p class="first">recurse into subrepositories</p> +<p class="last">aliases: in</p> +</td></tr> +</tbody> +</table> +</div> +<div class="section" id="init"> +<h2>init</h2> +<pre class="literal-block"> +hg init [-e CMD] [--remotecmd CMD] [DEST] +</pre> +<p>Initialize a new repository in the given directory. If the given +directory does not exist, it will be created.</p> +<p>If no directory is given, the current directory is used.</p> +<p>It is possible to specify an <tt class="docutils literal"><span class="pre">ssh://</span></tt> URL as the destination. +See <a class="reference external" href="hg.1.html#urls"><tt class="docutils literal">hg help urls</tt></a> for more information.</p> +<p>Returns 0 on success.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td> +<td>specify ssh command to use</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--remotecmd</span></kbd></td> +<td>specify hg command to run on the remote side</td></tr> +<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> +<pre class="literal-block"> +hg locate [OPTION]... [PATTERN]... +</pre> +<p>Print files under Mercurial control in the working directory whose +names match the given patterns.</p> +<p>By default, this command searches all directories in the working +directory. To search just the current directory and its +subdirectories, use "--include .".</p> +<p>If no patterns are given to match, this command prints the names +of all files under Mercurial control in the working directory.</p> +<p>If you want to feed the output of this command into the "xargs" +command, use the -0 option to both this command and "xargs". This +will avoid the problem of "xargs" treating single filenames that +contain whitespace as multiple filenames.</p> +<p>Returns 0 if a match is found, 1 otherwise.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>search the repository as it is in REV</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-0</span>, <span class="option">--print0</span></kbd></td> +<td>end filenames with NUL, for use with xargs</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-f</span>, <span class="option">--fullpath</span></kbd></td> +<td>print complete paths from the filesystem root</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td>exclude names matching the given patterns</td></tr> +</tbody> +</table> +</div> +<div class="section" id="log"> +<h2>log</h2> +<pre class="literal-block"> +hg log [OPTION]... [FILE] +</pre> +<p>Print the revision history of the specified files or the entire +project.</p> +<p>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> +<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 deletions. To see all +changes including duplicates and deletions, 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">check if a given changeset is included is 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"> +<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td> +<td>show revisions matching date spec</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-C</span>, <span class="option">--copies</span></kbd></td> +<td>show copied files</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-k</span>, <span class="option">--keyword</span></kbd></td> +<td>do case-insensitive search for a given text</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>show the specified revision or range</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--removed</span></kbd></td> +<td>include revisions where files were removed</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-m</span>, <span class="option">--only-merges</span></kbd></td> +</tr> +<tr><td> </td><td>show only merges (DEPRECATED)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td> +<td>revisions committed by user</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--only-branch</span></kbd></td> +<td>show only changesets within the given named branch (DEPRECATED)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td> +<td>show changesets within the given named branch</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-P</span>, <span class="option">--prune</span></kbd></td> +<td>do not display revision or any of its ancestors</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--hidden</span></kbd></td> +<td>show hidden changesets (DEPRECATED)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-p</span>, <span class="option">--patch</span></kbd></td> +<td>show patch</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td> +<td>use git extended diff format</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-l</span>, <span class="option">--limit</span></kbd></td> +<td>limit number of changes displayed</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-M</span>, <span class="option">--no-merges</span></kbd></td> +</tr> +<tr><td> </td><td>do not show merges</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--stat</span></kbd></td> +<td>output diffstat-style summary of changes</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-G</span>, <span class="option">--graph</span></kbd></td> +<td>show the revision DAG</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--style</span></kbd></td> +<td>display using template map file</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--template</span></kbd></td> +<td>display with template</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td><p class="first">exclude names matching the given patterns</p> +<p class="last">aliases: history</p> +</td></tr> +</tbody> +</table> +</div> +<div class="section" id="manifest"> +<h2>manifest</h2> +<pre class="literal-block"> +hg manifest [-r REV] +</pre> +<p>Print a list of version controlled files for the given revision. +If no revision is given, the first parent of the working directory +is used, or the null revision if no revision is checked out.</p> +<p>With -v, print file permissions, symlink and executable bits. +With --debug, print file revision hashes.</p> +<p>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"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></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> +</tbody> +</table> +</div> +<div class="section" id="merge"> +<h2>merge</h2> +<pre class="literal-block"> +hg merge [-P] [-f] [[-r] REV] +</pre> +<p>The current working directory is updated with all changes made in +the requested revision since the last common predecessor revision.</p> +<p>Files that changed between either parent are marked as changed for +the next commit and a commit must be performed before any further +updates to the repository are allowed. The next commit will have +two parents.</p> +<p><tt class="docutils literal"><span class="pre">--tool</span></tt> can be used to specify the merge tool used for file +merges. It overrides the HGMERGE environment variable and your +configuration files. 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 with outstanding changes</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>revision to merge</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-P</span>, <span class="option">--preview</span></kbd></td> +<td>review revisions to merge (no merge is performed)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-t</span>, <span class="option">--tool</span></kbd></td> +<td>specify merge tool</td></tr> +</tbody> +</table> +</div> +<div class="section" id="outgoing"> +<h2>outgoing</h2> +<pre class="literal-block"> +hg outgoing [-M] [-p] [-n] [-f] [-r REV]... [DEST] +</pre> +<p>Show changesets not found in the specified destination repository +or the default push location. These are the changesets that would +be pushed if a push was requested.</p> +<p>See pull for details of valid destination formats.</p> +<p>Returns 0 if there are outgoing changes, 1 otherwise.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td> +<td>run even when the destination is unrelated</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>a changeset intended to be included in the destination</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-n</span>, <span class="option">--newest-first</span></kbd></td> +</tr> +<tr><td> </td><td>show newest record first</td></tr> +<tr><td class="option-group" 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"> +<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td> +<td>a specific branch you would like to push</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-p</span>, <span class="option">--patch</span></kbd></td> +<td>show patch</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td> +<td>use git extended diff format</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-l</span>, <span class="option">--limit</span></kbd></td> +<td>limit number of changes displayed</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-M</span>, <span class="option">--no-merges</span></kbd></td> +</tr> +<tr><td> </td><td>do not show merges</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--stat</span></kbd></td> +<td>output diffstat-style summary of changes</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-G</span>, <span class="option">--graph</span></kbd></td> +<td>show the revision DAG</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--style</span></kbd></td> +<td>display using template map file</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--template</span></kbd></td> +<td>display with template</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td> +<td>specify ssh command to use</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--remotecmd</span></kbd></td> +<td>specify hg command to run on the remote side</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--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><p class="first">recurse into subrepositories</p> +<p class="last">aliases: out</p> +</td></tr> +</tbody> +</table> +</div> +<div class="section" id="parents"> +<h2>parents</h2> +<pre class="literal-block"> +hg parents [-r REV] [FILE] +</pre> +<p>Print the working directory's parent revisions. If a revision is +given via -r/--rev, the parent of that revision will be printed. +If a file argument is given, the revision in which the file was +last changed (before the working directory revision or the +argument to --rev if given) is printed.</p> +<p>Returns 0 on success.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>show parents of the specified revision</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--style</span></kbd></td> +<td>display using template map file</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--template</span></kbd></td> +<td>display with template</td></tr> +</tbody> +</table> +</div> +<div class="section" id="paths"> +<h2>paths</h2> +<pre class="literal-block"> +hg paths [NAME] +</pre> +<p>Show definition of symbolic path name NAME. If no name is given, +show definition of all available names.</p> +<p>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> +<pre class="literal-block"> +hg phase [-p|-d|-s] [-f] [-r] REV... +</pre> +<p>With no argument, show the phase name of specified revisions.</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>Return 0 on success, 1 if no phases were changed or some could not +be 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"> +<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"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>target revision</td></tr> +</tbody> +</table> +</div> +<div class="section" id="pull"> +<h2>pull</h2> +<pre class="literal-block"> +hg pull [-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [SOURCE] +</pre> +<p>Pull changes from a remote repository to a local one.</p> +<p>This finds all changes from the repository at the specified path +or URL and adds them to a local repository (the current one unless +-R is specified). By default, this does not update the copy of the +project in the working directory.</p> +<p>Use <a class="reference external" href="hg.1.html#incoming"><tt class="docutils literal">hg incoming</tt></a> if you want to see what would have been added +by a pull at the time you issued this command. If you then decide +to add those changes to the repository, you should use <a class="reference external" href="hg.1.html#pull"><tt class="docutils literal">hg pull +<span class="pre">-r</span> X</tt></a> where <tt class="docutils literal">X</tt> is the last changeset listed by <a class="reference external" href="hg.1.html#incoming"><tt class="docutils literal">hg incoming</tt></a>.</p> +<p>If SOURCE is omitted, the 'default' path will be used. +See <a class="reference external" href="hg.1.html#urls"><tt class="docutils literal">hg help urls</tt></a> for more information.</p> +<p>Returns 0 on success, 1 if an update had unresolved files.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-u</span>, <span class="option">--update</span></kbd></td> +<td>update to new branch head if changesets were pulled</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td> +<td>run even when remote repository is unrelated</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>a remote changeset intended to be added</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-B</span>, <span class="option">--bookmark</span></kbd></td> +<td>bookmark to pull</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td> +<td>a specific branch you would like to pull</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td> +<td>specify ssh command to use</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--remotecmd</span></kbd></td> +<td>specify hg command to run on the remote side</td></tr> +<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="push"> +<h2>push</h2> +<pre class="literal-block"> +hg push [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST] +</pre> +<p>Push changesets from the local repository to the specified +destination.</p> +<p>This operation is symmetrical to pull: it is identical to a pull +in the destination repository from the current one.</p> +<p>By default, push will not allow creation of new heads at the +destination, since multiple heads would make it unclear which head +to use. In this situation, it is recommended to pull and merge +before pushing.</p> +<p>Use --new-branch if you want to allow push to create a new named +branch that is not present at the destination. This allows you to +only create a new branch without forcing other changes.</p> +<p>Use -f/--force to override the default behavior and push all +changesets on all branches.</p> +<p>If -r/--rev is used, the specified revision and all its ancestors +will be pushed to the remote repository.</p> +<p>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"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>a changeset intended to be included in the destination</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-B</span>, <span class="option">--bookmark</span></kbd></td> +<td>bookmark to push</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td> +<td>a specific branch you would like to push</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--new-branch</span></kbd></td> +<td>allow pushing a new branch</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td> +<td>specify ssh command to use</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--remotecmd</span></kbd></td> +<td>specify hg command to run on the remote side</td></tr> +<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="recover"> +<h2>recover</h2> +<pre class="literal-block"> +hg recover +</pre> +<p>Recover from an interrupted commit or pull.</p> +<p>This command tries to fix the repository status after an +interrupted operation. It should only be necessary when Mercurial +suggests it.</p> +<p>Returns 0 if successful, 1 if nothing to recover or verify fails.</p> +</div> +<div class="section" id="remove"> +<h2>remove</h2> +<pre class="literal-block"> +hg remove [OPTION]... FILE... +</pre> +<p>Schedule the indicated files for removal from the 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="47%" /> +<col width="13%" /> +<col width="13%" /> +<col width="13%" /> +<col width="13%" /> +</colgroup> +<thead valign="bottom"> +<tr><th class="head"> </th> +<th class="head"> </th> +<th class="head"> </th> +<th class="head"> </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">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td><p class="first">exclude names matching the given patterns</p> +<p class="last">aliases: rm</p> +</td></tr> +</tbody> +</table> +</div> +<div class="section" id="rename"> +<h2>rename</h2> +<pre class="literal-block"> +hg rename [OPTION]... SOURCE... DEST +</pre> +<p>Mark dest as copies of sources; mark sources for deletion. If dest +is a directory, copies are put in that directory. If dest is a +file, there can only be one source.</p> +<p>By default, this command copies the contents of files as they +exist in the working directory. If invoked with -A/--after, the +operation is recorded, but no copying is performed.</p> +<p>This command takes effect at the next commit. To undo a rename +before that, see <a class="reference external" href="hg.1.html#revert"><tt class="docutils literal">hg revert</tt></a>.</p> +<p>Returns 0 on success, 1 if errors are encountered.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-A</span>, <span class="option">--after</span></kbd></td> +<td>record a rename that has already occurred</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td> +<td>forcibly copy over an existing managed file</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td>exclude names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-n</span>, <span class="option">--dry-run</span></kbd></td> +<td><p class="first">do not perform actions, just print output</p> +<p class="last">aliases: move mv</p> +</td></tr> +</tbody> +</table> +</div> +<div class="section" id="resolve"> +<h2>resolve</h2> +<pre class="literal-block"> +hg resolve [OPTION]... [FILE]... +</pre> +<p>Merges with unresolved conflicts are often the result of +non-interactive merging using the <tt class="docutils literal">internal:merge</tt> configuration +setting, or a command-line merge tool like <tt class="docutils literal">diff3</tt>. The resolve +command is used to manage the files involved in a merge, after +<a class="reference external" href="hg.1.html#merge"><tt class="docutils literal">hg merge</tt></a> has been run, and before <a class="reference external" href="hg.1.html#commit"><tt class="docutils literal">hg commit</tt></a> is run (i.e. the +working directory must have two parents). 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"> +<kbd><span class="option">-t</span>, <span class="option">--tool</span></kbd></td> +<td>specify merge tool</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td>exclude names matching the given patterns</td></tr> +</tbody> +</table> +</div> +<div class="section" id="revert"> +<h2>revert</h2> +<pre class="literal-block"> +hg revert [OPTION]... [-r REV] [NAME]... +</pre> +<div class="note"> +<p class="first admonition-title">Note</p> +<p class="last">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"> +<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td> +<td>tipmost revision matching date</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>revert to the specified revision</td></tr> +<tr><td class="option-group" 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"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td>exclude names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-n</span>, <span class="option">--dry-run</span></kbd></td> +<td>do not perform actions, just print output</td></tr> +</tbody> +</table> +</div> +<div class="section" id="rollback"> +<h2>rollback</h2> +<pre class="literal-block"> +hg rollback +</pre> +<p>This command should be used with care. There is only one level of +rollback, and there is no way to undo a rollback. It will also +restore the dirstate at the time of the last transaction, losing +any dirstate changes since that time. This command does not alter +the working directory.</p> +<p>Transactions are used to encapsulate the effects of all commands +that create new changesets or propagate existing changesets into a +repository.</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> +<pre class="literal-block"> +hg root +</pre> +<p>Print the root directory of the current repository.</p> +<p>Returns 0 on success.</p> +</div> +<div class="section" id="serve"> +<h2>serve</h2> +<pre class="literal-block"> +hg serve [OPTION]... +</pre> +<p>Start a local HTTP repository browser and pull server. You can use +this for ad-hoc sharing and browsing of repositories. It is +recommended to use a real web server to serve a repository for +longer periods of time.</p> +<p>Please note that the server does not implement access control. +This means that, by default, anybody can read from the server and +nobody can write to it by default. Set the <tt class="docutils literal">web.allow_push</tt> +option to <tt class="docutils literal">*</tt> to allow everybody to push to the server. You +should use a real web server if you need to authenticate users.</p> +<p>By default, the server logs accesses to stdout and errors to +stderr. Use the -A/--accesslog and -E/--errorlog options to log to +files.</p> +<p>To have the server choose a free port number to listen on, specify +a port number of 0; in this case, the server will print the port +number it uses.</p> +<p>Returns 0 on success.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-A</span>, <span class="option">--accesslog</span></kbd></td> +</tr> +<tr><td> </td><td>name of access log file to write to</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-d</span>, <span class="option">--daemon</span></kbd></td> +<td>run server in background</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">--daemon-pipefds</span></kbd></td> +</tr> +<tr><td> </td><td>used internally by daemon mode</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-E</span>, <span class="option">--errorlog</span></kbd></td> +<td>name of error log file to write to</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-p</span>, <span class="option">--port</span></kbd></td> +<td>port to listen on (default: 8000)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-a</span>, <span class="option">--address</span></kbd></td> +<td>address to listen on (default: all interfaces)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--prefix</span></kbd></td> +<td>prefix path to serve from (default: server root)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-n</span>, <span class="option">--name</span></kbd></td> +<td>name to show in web pages (default: working directory)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--web-conf</span></kbd></td> +<td>name of the hgweb config file (see "hg help hgweb")</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--webdir-conf</span></kbd></td> +<td>name of the hgweb config file (DEPRECATED)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--pid-file</span></kbd></td> +<td>name of file to write process ID to</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--stdio</span></kbd></td> +<td>for remote clients</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--cmdserver</span></kbd></td> +<td>for remote clients</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-t</span>, <span class="option">--templates</span></kbd></td> +</tr> +<tr><td> </td><td>web templates to use</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--style</span></kbd></td> +<td>template style to use</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-6</span>, <span class="option">--ipv6</span></kbd></td> +<td>use IPv6 in addition to IPv4</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--certificate</span></kbd></td> +<td>SSL certificate file</td></tr> +</tbody> +</table> +</div> +<div class="section" id="showconfig"> +<h2>showconfig</h2> +<pre class="literal-block"> +hg showconfig [-u] [NAME]... +</pre> +<p>With no arguments, print names and values of all config items.</p> +<p>With one argument of the form section.name, print just the value +of that config item.</p> +<p>With multiple arguments, print names and values of all config +items with matching section names.</p> +<p>With --debug, the source (filename and line number) is printed +for each config item.</p> +<p>Returns 0 on success.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-u</span>, <span class="option">--untrusted</span></kbd></td> +</tr> +<tr><td> </td><td><p class="first">show untrusted configuration options</p> +<p class="last">aliases: debugconfig</p> +</td></tr> +</tbody> +</table> +</div> +<div class="section" id="status"> +<h2>status</h2> +<pre class="literal-block"> +hg status [OPTION]... [FILE]... +</pre> +<p>Show status of files in the repository. If names are given, only +files that match are shown. Files that are clean or ignored or +the source of a copy/move operation, are not listed unless +-c/--clean, -i/--ignored, -C/--copies or -A/--all are given. +Unless options described with "show only ..." are given, the +options -mardu are used.</p> +<p>Option -q/--quiet hides untracked (unknown and ignored) files +unless explicitly requested with -u/--unknown or -i/--ignored.</p> +<div class="note"> +<p class="first admonition-title">Note</p> +<p class="last">status may appear to disagree with diff if permissions have +changed or a merge has occurred. The standard diff format does +not report permission changes and diff only reports changes +relative to one merge parent.</p> +</div> +<p>If one revision is given, it is used as the base revision. +If two revisions are given, the differences between them are +shown. The --change option can also be used as a shortcut to list +the changed files of a revision from its first parent.</p> +<p>The codes used to show the status of files are:</p> +<pre class="literal-block"> +M = modified +A = added +R = removed +C = clean +! = missing (deleted by non-hg command, but still tracked) +? = not tracked +I = ignored + = origin of the previous file listed as A (added) +</pre> +<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 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</span></kbd></td> +<td>show difference from revision</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--change</span></kbd></td> +<td>list the changed files of a revision</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td>exclude names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-S</span>, <span class="option">--subrepos</span></kbd></td> +<td><p class="first">recurse into subrepositories</p> +<p class="last">aliases: st</p> +</td></tr> +</tbody> +</table> +</div> +<div class="section" id="summary"> +<h2>summary</h2> +<pre class="literal-block"> +hg summary [--remote] +</pre> +<p>This generates a brief summary of the working directory state, +including parents, branch, commit status, and available updates.</p> +<p>With the --remote option, this will check the default paths for +incoming and outgoing changes. This can be time-consuming.</p> +<p>Returns 0 on success.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">--remote</span></kbd></td> +<td><p class="first">check for push and pull</p> +<p class="last">aliases: sum</p> +</td></tr> +</tbody> +</table> +</div> +<div class="section" id="tag"> +<h2>tag</h2> +<pre class="literal-block"> +hg tag [-f] [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME... +</pre> +<p>Name a particular revision using <name>.</p> +<p>Tags are used to name particular revisions of the repository and are +very useful to compare different revisions, to go back to significant +earlier versions or to mark branch points as releases, etc. Changing +an existing tag is normally disallowed; use -f/--force to override.</p> +<p>If no revision is given, the parent of the working directory is +used, or tip if no revision is checked out.</p> +<p>To facilitate version control, distribution, and merging of tags, +they are stored as a file named ".hgtags" which is managed similarly +to other project files and can be hand-edited if necessary. This +also means that tagging creates a new commit. The file +".hg/localtags" is used for local tags (not shared among +repositories).</p> +<p>Tag commits are usually made at the head of a branch. If the parent +of the working directory is not a branch head, <a class="reference external" href="hg.1.html#tag"><tt class="docutils literal">hg tag</tt></a> aborts; use +-f/--force to force the tag commit to be based on a non-head +changeset.</p> +<p>See <a class="reference external" href="hg.1.html#dates"><tt class="docutils literal">hg help dates</tt></a> for a list of formats valid for -d/--date.</p> +<p>Since tag names have priority over branch names during revision +lookup, using an existing branch name as a tag name is discouraged.</p> +<p>Returns 0 on success.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td> +<td>force tag</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-l</span>, <span class="option">--local</span></kbd></td> +<td>make the tag local</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>revision to tag</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--remove</span></kbd></td> +<td>remove a tag</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td> +<td>edit commit message</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td> +<td>use <text> as commit message</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td> +<td>record the specified date as commit date</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td> +<td>record the specified user as committer</td></tr> +</tbody> +</table> +</div> +<div class="section" id="tags"> +<h2>tags</h2> +<pre class="literal-block"> +hg tags +</pre> +<p>This lists both regular and local tags. When the -v/--verbose +switch is used, a third column "local" is printed for local tags.</p> +<p>Returns 0 on success.</p> +</div> +<div class="section" id="tip"> +<h2>tip</h2> +<pre class="literal-block"> +hg tip [-p] [-g] +</pre> +<p>The tip revision (usually just called the tip) is the changeset +most recently added to the repository (and therefore the most +recently changed head).</p> +<p>If you have just made a commit, that commit will be the tip. If +you have just pulled changes from another repository, the tip of +that repository becomes the current tip. The "tip" tag is special +and cannot be renamed or assigned to a different changeset.</p> +<p>Returns 0 on success.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-p</span>, <span class="option">--patch</span></kbd></td> +<td>show patch</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td> +<td>use git extended diff format</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--style</span></kbd></td> +<td>display using template map file</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--template</span></kbd></td> +<td>display with template</td></tr> +</tbody> +</table> +</div> +<div class="section" id="unbundle"> +<h2>unbundle</h2> +<pre class="literal-block"> +hg unbundle [-u] FILE... +</pre> +<p>Apply one or more compressed changegroup files generated by the +bundle command.</p> +<p>Returns 0 on success, 1 if an update has unresolved files.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-u</span>, <span class="option">--update</span></kbd></td> +<td>update to new branch head if changesets were unbundled</td></tr> +</tbody> +</table> +</div> +<div class="section" id="update"> +<h2>update</h2> +<pre class="literal-block"> +hg update [-c] [-C] [-d DATE] [[-r] REV] +</pre> +<p>Update the repository's working directory to the specified +changeset. If no changeset is specified, update to the tip of the +current named branch and move the current 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 revison 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"> +<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td> +<td>tipmost revision matching date</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td><p class="first">revision</p> +<p class="last">aliases: up checkout co</p> +</td></tr> +</tbody> +</table> +</div> +<div class="section" id="verify"> +<h2>verify</h2> +<pre class="literal-block"> +hg verify +</pre> +<p>Verify the integrity of the current repository.</p> +<p>This will perform an extensive check of the repository's +integrity, validating the hashes and checksums of each entry in +the changelog, manifest, and tracked files, as well as the +integrity of their crosslinks and indices.</p> +<p>Returns 0 on success, 1 if errors are encountered.</p> +</div> +<div class="section" id="version"> +<h2>version</h2> +<pre class="literal-block"> +hg version +</pre> +<p>output version and copyright information</p> +</div> +</div> +<div class="section" id="date-formats"> +<span id="dates"></span><h1><a class="toc-backref" href="#contents">Date Formats</a></h1> +<p>Some commands allow the user to specify a date, e.g.:</p> +<ul class="simple"> +<li>backout, commit, import, tag: Specify the commit date.</li> +<li>log, revert, update: Select revision(s) by date.</li> +</ul> +<p>Many date formats are valid. Here are some examples:</p> +<ul class="simple"> +<li><tt class="docutils literal">Wed Dec 6 13:18:29 2006</tt> (local timezone assumed)</li> +<li><tt class="docutils literal">Dec 6 13:18 <span class="pre">-0600</span></tt> (year assumed, time offset provided)</li> +<li><tt class="docutils literal">Dec 6 13:18 UTC</tt> (UTC and GMT are aliases for +0000)</li> +<li><tt class="docutils literal">Dec 6</tt> (midnight)</li> +<li><tt class="docutils literal">13:18</tt> (today assumed)</li> +<li><tt class="docutils literal">3:39</tt> (3:39AM assumed)</li> +<li><tt class="docutils literal">3:39pm</tt> (15:39)</li> +<li><tt class="docutils literal"><span class="pre">2006-12-06</span> 13:18:29</tt> (ISO 8601 format)</li> +<li><tt class="docutils literal"><span class="pre">2006-12-6</span> 13:18</tt></li> +<li><tt class="docutils literal"><span class="pre">2006-12-6</span></tt></li> +<li><tt class="docutils literal"><span class="pre">12-6</span></tt></li> +<li><tt class="docutils literal">12/6</tt></li> +<li><tt class="docutils literal">12/6/6</tt> (Dec 6 2006)</li> +</ul> +<p>Lastly, there is Mercurial's internal format:</p> +<ul class="simple"> +<li><tt class="docutils literal">1165432709 0</tt> (Wed Dec 6 13:18:29 2006 UTC)</li> +</ul> +<p>This is the internal representation format for dates. 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>Extensions are not loaded by default for a variety of reasons: +they can increase startup overhead; they may be meant for advanced +usage only; they may provide potentially dangerous abilities (such +as letting you destroy or modify history); they might not be ready +for prime time; or they may alter some usual behaviors of stock +Mercurial. It is thus up to the user to activate extensions as +needed.</p> +<p>To enable the "foo" extension, either shipped with Mercurial or in the +Python search path, create an entry for it in your configuration file, +like this:</p> +<pre class="literal-block"> +[extensions] +foo = +</pre> +<p>You may also specify the full path to an extension:</p> +<pre class="literal-block"> +[extensions] +myfeature = ~/.hgext/myfeature.py +</pre> +<p>To explicitly disable an extension enabled in a configuration file of +broader scope, prepend its path with !:</p> +<pre class="literal-block"> +[extensions] +# disabling extension bar residing in /path/to/extension/bar.py +bar = !/path/to/extension/bar.py +# ditto, but no path was supplied for extension baz +baz = ! +</pre> +<p>disabled extensions:</p> +<blockquote> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field"><th class="field-name">acl:</th><td class="field-body">hooks for controlling repository access</td> +</tr> +<tr class="field"><th class="field-name">bugzilla:</th><td class="field-body">hooks for integrating with the Bugzilla bug tracker</td> +</tr> +<tr class="field"><th class="field-name">children:</th><td class="field-body">command to display child changesets (DEPRECATED)</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">fetch:</th><td class="field-body">pull, update and merge in one command (DEPRECATED)</td> +</tr> +<tr class="field"><th class="field-name">gpg:</th><td class="field-body">commands to sign and verify changesets</td> +</tr> +<tr class="field"><th class="field-name">graphlog:</th><td class="field-body">command to view revision graphs from a shell</td> +</tr> +<tr class="field"><th class="field-name">hgcia:</th><td class="field-body">hooks for integrating with the CIA.vc notification service</td> +</tr> +<tr class="field"><th class="field-name">hgk:</th><td class="field-body">browse the repository in a graphical way</td> +</tr> +<tr class="field"><th class="field-name">highlight:</th><td class="field-body">syntax highlighting for hgweb (requires Pygments)</td> +</tr> +<tr class="field"><th class="field-name">histedit:</th><td class="field-body">interactive history editing</td> +</tr> +<tr class="field"><th class="field-name">inotify:</th><td class="field-body">accelerate status report using Linux's inotify service</td> +</tr> +<tr class="field"><th class="field-name">interhg:</th><td class="field-body">expand expressions into changelog and summaries</td> +</tr> +<tr class="field"><th class="field-name">keyword:</th><td class="field-body">expand keywords in tracked files</td> +</tr> +<tr class="field"><th class="field-name">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">progress:</th><td class="field-body">show progress bars for some actions</td> +</tr> +<tr class="field"><th class="field-name">purge:</th><td class="field-body">command to delete untracked files from the working directory</td> +</tr> +<tr class="field"><th class="field-name">rebase:</th><td class="field-body">command to move sets of revisions to a different ancestor</td> +</tr> +<tr class="field"><th class="field-name">record:</th><td class="field-body">commands to interactively select changes for commit/qrefresh</td> +</tr> +<tr class="field"><th class="field-name">relink:</th><td class="field-body">recreates hardlinks between repository clones</td> +</tr> +<tr class="field"><th class="field-name">schemes:</th><td class="field-body">extend schemes with shortcuts to repository swarms</td> +</tr> +<tr class="field"><th class="field-name">share:</th><td class="field-body">share a common history between several working directories</td> +</tr> +<tr class="field"><th class="field-name">transplant:</th><td class="field-body">command to transplant changesets from another branch</td> +</tr> +<tr class="field"><th class="field-name">win32mbcs:</th><td class="field-body">allow the use of MBCS paths with problematic encodings</td> +</tr> +<tr class="field"><th class="field-name">win32text:</th><td class="field-body">perform automatic newline conversion</td> +</tr> +<tr class="field"><th class="field-name">zeroconf:</th><td class="field-body">discover and advertise repositories on the local network</td> +</tr> +</tbody> +</table> +</blockquote> +</div> +<div class="section" id="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">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">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 locate "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 locate "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#glog"><tt class="docutils literal">hg glog</tt></a> +(graphlog). In Mercurial, the DAG is limited by the requirement +for children to have at most two parents.</dd> +<dt>Default branch</dt> +<dd>See 'Branch, default'.</dd> +<dt>Descendant</dt> +<dd>Any changeset that can be reached by a chain of child changesets +from a given changeset. More precisely, the descendants of a +changeset can be defined by two properties: the child of a +changeset is a descendant, and the child of a descendant is a +descendant. See also: 'Ancestor'.</dd> +<dt>Diff</dt> +<dd><p class="first">(Noun) The difference between the contents and attributes of files +in two changesets or a changeset and the current working +directory. The difference is usually represented in a standard +form called a "diff" or "patch". The "git diff" format is used +when the changes include copies, renames, or changes to file +attributes, none of which can be represented/handled by classic +"diff" and "patch".</p> +<p>Example: "Did you see my correction in the diff?"</p> +<p>(Verb) Diffing two changesets is the action of creating a diff or +patch.</p> +<p class="last">Example: "If you diff with changeset X, you will see what I mean."</p> +</dd> +<dt>Directory, working</dt> +<dd>The working directory represents the state of the files tracked by +Mercurial, that will be recorded in the next commit. The working +directory initially corresponds to the snapshot at an existing +changeset, known as the parent of the working directory. See +'Parent, working directory'. The state may be modified by changes +to the files introduced manually or by a merge. The repository +metadata exists in the .hg directory inside the working directory.</dd> +<dt>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>Graph</dt> +<dd>See DAG and <a class="reference external" href="hg.1.html#graphlog"><tt class="docutils literal">hg help graphlog</tt></a>.</dd> +<dt>Head</dt> +<dd><p class="first">The term 'head' may be used to refer to both a branch head or a +repository head, depending on the context. See 'Head, branch' and +'Head, repository' for specific definitions.</p> +<p class="last">Heads are where development generally takes place and are the +usual targets for update and merge operations.</p> +</dd> +<dt>Head, branch</dt> +<dd>A changeset with no descendants on the same named branch.</dd> +<dt>Head, closed branch</dt> +<dd><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> +<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 thorougly 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 superseeded by +<tt class="docutils literal">paths</tt>.</p> +</div> +<div class="section" id="id4"> +<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">internal:dump</tt></dt> +<dd>Creates three versions of the files to merge, containing the +contents of local, other and base. These files can then be used to +perform a merge manually. If the file to be merged is named +<tt class="docutils literal">a.txt</tt>, these files will accordingly be named <tt class="docutils literal">a.txt.local</tt>, +<tt class="docutils literal">a.txt.other</tt> and <tt class="docutils literal">a.txt.base</tt> and they will be placed in the +same directory as <tt class="docutils literal">a.txt</tt>.</dd> +<dt><tt class="docutils literal">internal:fail</tt></dt> +<dd>Rather than attempting to merge files that were modified on both +branches, it marks them as unresolved. The resolve command must be +used to resolve these conflicts.</dd> +<dt><tt class="docutils literal">internal:local</tt></dt> +<dd>Uses the local version of files as the merged version.</dd> +<dt><tt class="docutils literal">internal:merge</tt></dt> +<dd>Uses the internal non-interactive simple merge algorithm for merging +files. It will fail if there are any conflicts and leave markers in +the partially merged file.</dd> +<dt><tt class="docutils literal">internal:other</tt></dt> +<dd>Uses the other version of files as the merged version.</dd> +<dt><tt class="docutils literal">internal:prompt</tt></dt> +<dd>Asks the user which of the local or the other version to keep as +the merged version.</dd> +</dl> +<p>Internal tools are always available and do not require a GUI but will by default +not handle symlinks or binary files.</p> +</div> +<div class="section" id="choosing-a-merge-tool"> +<h2>Choosing a merge tool</h2> +<p>Mercurial uses these rules when deciding which merge tool to use:</p> +<ol class="arabic simple"> +<li>If a tool has been specified with the --tool option to merge or resolve, it +is used. If it is the name of a tool in the merge-tools configuration, its +configuration is used. Otherwise the specified tool must be executable by +the shell.</li> +<li>If the <tt class="docutils literal">HGMERGE</tt> environment variable is present, its value is used and +must be executable by the shell.</li> +<li>If the filename of the file to be merged matches any of the patterns in the +merge-patterns configuration section, the first usable merge tool +corresponding to a matching pattern is used. Here, binary capabilities of the +merge tool are not considered.</li> +<li>If ui.merge is set it will be considered next. If the value is not the name +of a configured tool, the specified value is used and must be executable by +the shell. Otherwise the named tool is used if it is usable.</li> +<li>If any usable merge tools are present in the merge-tools configuration +section, the one with the highest priority is used.</li> +<li>If a program named <tt class="docutils literal">hgmerge</tt> can be found on the system, it is used - but +it will by default not be used for symlinks and binary files.</li> +<li>If the file to be merged is not binary and is not a symlink, then +<tt class="docutils literal">internal:merge</tt> is used.</li> +<li>The merge of the file fails and must be resolved before commit.</li> +</ol> +<div class="note"> +<p class="first admonition-title">Note</p> +<p class="last">After selecting a merge program, Mercurial will by default attempt +to merge the files using a simple merge algorithm first. Only if it doesn't +succeed because of conflicting changes Mercurial will actually execute the +merge program. Whether to use the simple merge algorithm first can be +controlled by the premerge setting of the merge tool. Premerge is enabled by +default unless the file is binary or a symlink.</p> +</div> +<p>See the merge-tools and ui sections of hgrc(5) for details on the +configuration of merge tools.</p> +</div> +</div> +<div class="section" id="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>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> +</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 config 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> +<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 revision +of that 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>Changesets that add a file matching pattern.</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">ancestor(single, single)</tt></dt> +<dd>Greatest common ancestor of the two changesets.</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 topologicaly 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">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>Revision contains a file matching pattern. See <a class="reference external" href="hg.1.html#patterns"><tt class="docutils literal">hg help patterns</tt></a> +for information about file patterns.</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">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 class="last">For a faster but less accurate result, consider using <tt class="docutils literal">filelog()</tt> +instead.</p> +</dd> +<dt><tt class="docutils literal">filelog(pattern)</tt></dt> +<dd><p class="first">Changesets connected to the specified filelog.</p> +<p class="last">For performance reasons, <tt class="docutils literal">filelog()</tt> does not show every changeset +that affects the requested file(s). See <a class="reference external" href="hg.1.html#log"><tt class="docutils literal">hg help log</tt></a> for details. For +a slower, more accurate result, use <tt class="docutils literal">file()</tt>.</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 copy'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">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>Changesets modifying files matched by pattern.</dd> +<dt><tt class="docutils literal">obsolete()</tt></dt> +<dd>Mutable changeset with a newer version.</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>Changesets which remove files matching pattern.</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">tag([name])</span></tt></dt> +<dd>The specified tag by name, or all tagged revisions if no name is given.</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>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(tagged())" +</pre> +</li> +</ul> +</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> +<blockquote> +<p>path/to/nested = <a class="reference external" href="https://example.com/nested/repo/path">https://example.com/nested/repo/path</a></p> +</blockquote> +<p>Git and Subversion subrepos are also supported:</p> +<blockquote> +<p>path/to/nested = [git]git://example.com/nested/repo/path +path/to/nested = [svn]https://example.com/nested/trunk/path</p> +</blockquote> +<p>where <tt class="docutils literal">path/to/nested</tt> is the checkout location relatively to the +parent Mercurial root, and <tt class="docutils literal"><span class="pre">https://example.com/nested/repo/path</span></tt> +is the source repository path. The source can also reference a +filesystem path.</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. +Git and Subversion subrepositories are currently silently +ignored.</td> +</tr> +<tr class="field"><th class="field-name">archive:</th><td class="field-body">archive does not recurse in subrepositories unless +-S/--subrepos is specified.</td> +</tr> +<tr class="field"><th class="field-name">commit:</th><td class="field-body">commit creates a consistent snapshot of the state of the +entire project and its subrepositories. 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.</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. 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">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 from the command +line, via the --template option, or select an existing +template-style (--style).</p> +<p>You can customize output for any "log-like" command: log, +outgoing, incoming, tip, parents, heads and glog.</p> +<p>Four styles are packaged with Mercurial: default (the style used +when no explicit preference is passed), compact, changelog, +and xml. +Usage:</p> +<pre class="literal-block"> +$ hg log -r1 --style changelog +</pre> +<p>A template is a piece of text, with markup to invoke variable +expansion:</p> +<pre class="literal-block"> +$ hg log -r1 --template "{node}\n" +b56ce7b07c52de7d5fd79fb89701ea538af65746 +</pre> +<p>Strings in curly braces are called keywords. The availability of +keywords depends on the exact context of the templater. These +keywords are usually available for templating a log-like command:</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field"><th class="field-name">author:</th><td class="field-body">String. The unmodified author of the changeset.</td> +</tr> +<tr class="field"><th class="field-name">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.</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">branches:</th><td class="field-body">List of strings. The name of the branch on which the +changeset was committed. Will be empty if the branch name was +default.</td> +</tr> +<tr class="field"><th class="field-name">children:</th><td class="field-body">List of strings. The children of the changeset.</td> +</tr> +<tr class="field"><th class="field-name">date:</th><td class="field-body">Date information. The date when the changeset was committed.</td> +</tr> +<tr class="field"><th class="field-name">desc:</th><td class="field-body">String. The text of the changeset description.</td> +</tr> +<tr class="field"><th class="field-name">diffstat:</th><td class="field-body">String. Statistics of changes with the following format: +"modified files: +added/-removed lines"</td> +</tr> +<tr class="field"><th class="field-name">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">String. Most recent global tag in the ancestors of this +changeset.</td> +</tr> +<tr class="field"><th class="field-name" colspan="2">latesttagdistance:</th></tr> +<tr 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">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">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">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.</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">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">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">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 line except the +first starting with a tab character.</td> +</tr> +<tr class="field"><th class="field-name">urlescape:</th><td class="field-body">Any text. Escapes all "special" characters. For example, +"foo bar" becomes "foo%20bar".</td> +</tr> +<tr class="field"><th class="field-name">user:</th><td class="field-body">Any text. Returns a short representation of a user name or email +address.</td> +</tr> +</tbody> +</table> +</div> +<div class="section" id="url-paths"> +<span id="urls"></span><h1><a class="toc-backref" href="#contents">URL Paths</a></h1> +<p>Valid URLs are of the form:</p> +<pre class="literal-block"> +local/filesystem/path[#revision] +file://local/filesystem/path[#revision] +http://[user[:pass]@]host[:port]/[path][#revision] +https://[user[:pass]@]host[:port]/[path][#revision] +ssh://[user@]host[:port]/[path][#revision] +</pre> +<p>Paths in the local filesystem can either point to Mercurial +repositories or to bundle files (as created by <a class="reference external" href="hg.1.html#bundle"><tt class="docutils literal">hg bundle</tt></a> or :hg:` +incoming --bundle`). See also <a class="reference external" href="hg.1.html#paths"><tt class="docutils literal">hg help paths</tt></a>.</p> +<p>An optional identifier after # indicates a particular branch, tag, or +changeset to use from the remote repository. See also <a class="reference external" href="hg.1.html#revisions"><tt class="docutils literal">hg help +revisions</tt></a>.</p> +<p>Some features, such as pushing to <a class="reference external" href="http://">http://</a> and <a class="reference external" href="https://">https://</a> URLs are only +possible if the feature is explicitly enabled on the remote Mercurial +server.</p> +<p>Note that the security of HTTPS URLs depends on proper configuration of +web.cacerts.</p> +<p>Some notes about using SSH with Mercurial:</p> +<ul> +<li><p class="first">SSH requires an accessible shell account on the destination machine +and a copy of hg in the remote path or specified with as remotecmd.</p> +</li> +<li><p class="first">path is relative to the remote user's home directory by default. Use +an extra slash at the start of a path to specify an absolute path:</p> +<pre class="literal-block"> +ssh://example.com//tmp/repository +</pre> +</li> +<li><p class="first">Mercurial doesn't use its own compression via SSH; the right thing +to do is to configure it in your ~/.ssh/config, e.g.:</p> +<pre class="literal-block"> +Host *.mylocalnetwork.example.com + Compression no +Host * + Compression yes +</pre> +<p>Alternatively specify "ssh -C" as your ssh command in your +configuration file or with the --ssh command line option.</p> +</li> +</ul> +<p>These URLs can all be stored in your configuration file with path +aliases under the [paths] section like so:</p> +<pre class="literal-block"> +[paths] +alias1 = URL1 +alias2 = URL2 +... +</pre> +<p>You can then use the alias for any command that uses a URL (for +example <a class="reference external" href="hg.1.html#pull"><tt class="docutils literal">hg pull alias1</tt></a> will be treated as <a class="reference external" href="hg.1.html#pull"><tt class="docutils literal">hg pull URL1</tt></a>).</p> +<p>Two path aliases are special because they are used as defaults when +you do not provide the URL to a command:</p> +<dl class="docutils"> +<dt>default:</dt> +<dd>When you create a repository with hg clone, the clone command saves +the location of the source repository as the new repository's +'default' path. This is then used when you omit path from push- and +pull-like commands (including incoming and outgoing).</dd> +<dt>default-push:</dt> +<dd>The push command will look for a path named 'default-push', and +prefer it over 'default' if both are defined.</dd> +</dl> +</div> +<div class="section" id="id5"> +<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="id6"> +<ul class="simple"> +<li><a class="reference internal" href="#acl" id="id68">acl</a></li> +<li><a class="reference internal" href="#bugzilla" id="id69">bugzilla</a></li> +<li><a class="reference internal" href="#children" id="id70">children</a></li> +<li><a class="reference internal" href="#churn" id="id71">churn</a></li> +<li><a class="reference internal" href="#color" id="id72">color</a></li> +<li><a class="reference internal" href="#convert" id="id73">convert</a></li> +<li><a class="reference internal" href="#eol" id="id74">eol</a></li> +<li><a class="reference internal" href="#extdiff" id="id75">extdiff</a></li> +<li><a class="reference internal" href="#factotum" id="id76">factotum</a></li> +<li><a class="reference internal" href="#fetch" id="id77">fetch</a></li> +<li><a class="reference internal" href="#gpg" id="id78">gpg</a></li> +<li><a class="reference internal" href="#graphlog" id="id79">graphlog</a></li> +<li><a class="reference internal" href="#hgcia" id="id80">hgcia</a></li> +<li><a class="reference internal" href="#hgk" id="id81">hgk</a></li> +<li><a class="reference internal" href="#highlight" id="id82">highlight</a></li> +<li><a class="reference internal" href="#histedit" id="id83">histedit</a></li> +<li><a class="reference internal" href="#inotify" id="id84">inotify</a></li> +<li><a class="reference internal" href="#interhg" id="id85">interhg</a></li> +<li><a class="reference internal" href="#keyword" id="id86">keyword</a></li> +<li><a class="reference internal" href="#largefiles" id="id87">largefiles</a></li> +<li><a class="reference internal" href="#mq" id="id88">mq</a></li> +<li><a class="reference internal" href="#notify" id="id89">notify</a></li> +<li><a class="reference internal" href="#pager" id="id90">pager</a></li> +<li><a class="reference internal" href="#patchbomb" id="id91">patchbomb</a></li> +<li><a class="reference internal" href="#progress" id="id92">progress</a></li> +<li><a class="reference internal" href="#purge" id="id93">purge</a></li> +<li><a class="reference internal" href="#rebase" id="id94">rebase</a></li> +<li><a class="reference internal" href="#record" id="id95">record</a></li> +<li><a class="reference internal" href="#relink" id="id96">relink</a></li> +<li><a class="reference internal" href="#schemes" id="id97">schemes</a></li> +<li><a class="reference internal" href="#share" id="id98">share</a></li> +<li><a class="reference internal" href="#transplant" id="id99">transplant</a></li> +<li><a class="reference internal" href="#win32mbcs" id="id100">win32mbcs</a></li> +<li><a class="reference internal" href="#win32text" id="id101">win32text</a></li> +<li><a class="reference internal" href="#zeroconf" id="id102">zeroconf</a></li> +</ul> +</div> +<div class="section" id="acl"> +<h2><a class="toc-backref" href="#id68">acl</a></h2> +<p>hooks for controlling repository access</p> +<p>This hook makes it possible to allow or deny write access to given +branches and paths of a repository when receiving incoming changesets +via pretxnchangegroup and pretxncommit.</p> +<p>The authorization is matched based on the local user name on the +system where the hook runs, and not the committer of the original +changeset (since the latter is merely informative).</p> +<p>The acl hook is best used along with a restricted shell like hgsh, +preventing authenticating users from doing anything other than pushing +or pulling. The hook is not safe to use if users have interactive +shell access, as they can then disable the hook. Nor is it safe if +remote users share an account, because then there is no way to +distinguish them.</p> +<p>The order in which access checks are performed is:</p> +<ol class="arabic simple"> +<li>Deny list for branches (section <tt class="docutils literal">acl.deny.branches</tt>)</li> +<li>Allow list for branches (section <tt class="docutils literal">acl.allow.branches</tt>)</li> +<li>Deny list for paths (section <tt class="docutils literal">acl.deny</tt>)</li> +<li>Allow list for paths (section <tt class="docutils literal">acl.allow</tt>)</li> +</ol> +<p>The allow and deny sections take key-value pairs.</p> +<div class="section" id="branch-based-access-control"> +<h3>Branch-based Access Control</h3> +<p>Use the <tt class="docutils literal">acl.deny.branches</tt> and <tt class="docutils literal">acl.allow.branches</tt> sections to +have branch-based access control. Keys in these sections can be +either:</p> +<ul class="simple"> +<li>a branch name, or</li> +<li>an asterisk, to match any branch;</li> +</ul> +<p>The corresponding values can be either:</p> +<ul class="simple"> +<li>a comma-separated list containing users and groups, or</li> +<li>an asterisk, to match anyone;</li> +</ul> +<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="bugzilla"> +<h2><a class="toc-backref" href="#id69">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 recognised 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">This access type to use. Values recognised 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 +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="children"> +<h2><a class="toc-backref" href="#id70">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="id7"> +<h3>Commands</h3> +<div class="section" id="id8"> +<h4>children</h4> +<pre class="literal-block"> +hg children [-r REV] [FILE] +</pre> +<p>Print the children of the working directory's revisions. If a +revision is given via -r/--rev, the children of that revision will +be printed. If a file argument is given, revision in which the +file was last changed (after the working directory revision or the +argument to --rev if given) is printed.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>show children of the specified revision</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--style</span></kbd></td> +<td>display using template map file</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--template</span></kbd></td> +<td>display with template</td></tr> +</tbody> +</table> +</div> +</div> +</div> +<div class="section" id="churn"> +<h2><a class="toc-backref" href="#id71">churn</a></h2> +<p>command to display statistics about repository history</p> +<div class="section" id="id9"> +<h3>Commands</h3> +<div class="section" id="id10"> +<h4>churn</h4> +<pre class="literal-block"> +hg churn [-d DATE] [-r REV] [--aliases FILE] [FILE] +</pre> +<p>This command will display a histogram representing the number +of changed lines or revisions, grouped according to the given +template. The default template will group changes by author. +The --dateformat option may be used to group the results by +date instead.</p> +<p>Statistics are based on the number of changed lines, or +alternatively the number of matching revisions if the +--changesets option is specified.</p> +<p>Examples:</p> +<pre class="literal-block"> +# display count of changed lines for every committer +hg churn -t '{author|email}' + +# display daily activity graph +hg churn -f '%H' -s -c + +# display activity of developers by month +hg churn -f '%Y-%m' -s -c + +# display count of lines changed in every year +hg churn -f '%Y' -s +</pre> +<p>It is possible to map alternate email addresses to a main address +by providing a file using the following format:</p> +<pre class="literal-block"> +<alias email> = <actual email> +</pre> +<p>Such a file may be specified with the --aliases option, otherwise +a .hgchurn file will be looked for in the working directory root.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>count rate for the specified revision or range</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td> +<td>count rate for revisions matching date spec</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-t</span>, <span class="option">--template</span></kbd></td> +<td>template to group changesets (default: {author|email})</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-f</span>, <span class="option">--dateformat</span></kbd></td> +</tr> +<tr><td> </td><td>strftime-compatible format for grouping by date</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-c</span>, <span class="option">--changesets</span></kbd></td> +</tr> +<tr><td> </td><td>count rate by number of changesets</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-s</span>, <span class="option">--sort</span></kbd></td> +<td>sort by key (default: sort by count)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--diffstat</span></kbd></td> +<td>display added/removed lines separately</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--aliases</span></kbd></td> +<td>file with email aliases</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td>exclude names matching the given patterns</td></tr> +</tbody> +</table> +</div> +</div> +</div> +<div class="section" id="color"> +<h2><a class="toc-backref" href="#id72">color</a></h2> +<p>colorize output from some commands</p> +<p>This extension modifies the status and resolve commands to add color +to their output to reflect file status, the qseries command to add +color to reflect patch status (applied, unapplied, missing), and to +diff-related commands to highlight additions, removals, diff headers, +and trailing whitespace.</p> +<p>Other effects in addition to color, like bold and underlined text, are +also available. 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>Default effects may be overridden from your configuration file:</p> +<pre class="literal-block"> +[color] +status.modified = blue bold underline red_background +status.added = green bold +status.removed = red bold blue_background +status.deleted = cyan bold underline +status.unknown = magenta bold underline +status.ignored = black bold + +# 'none' turns off all effects +status.clean = none +status.copied = none + +qseries.applied = blue bold underline +qseries.unapplied = black bold +qseries.missing = red bold + +diff.diffline = bold +diff.extended = cyan bold +diff.file_a = red bold +diff.file_b = green bold +diff.hunk = magenta +diff.deleted = red +diff.inserted = green +diff.changed = white +diff.trailingwhitespace = bold red_background + +resolve.unresolved = red bold +resolve.resolved = green bold + +bookmarks.current = green + +branches.active = none +branches.closed = black bold +branches.current = green +branches.inactive = none + +tags.normal = green +tags.local = black bold +</pre> +<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> +<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>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> +<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> +</div> +<div class="section" id="convert"> +<h2><a class="toc-backref" href="#id73">convert</a></h2> +<p>import revisions from foreign VCS repositories into Mercurial</p> +<div class="section" id="id11"> +<h3>Commands</h3> +<div class="section" id="id12"> +<h4>convert</h4> +<pre class="literal-block"> +hg convert [OPTION]... SOURCE [DEST [REVMAP]] +</pre> +<p>Accepted source formats [identifiers]:</p> +<ul class="simple"> +<li>Mercurial [hg]</li> +<li>CVS [cvs]</li> +<li>Darcs [darcs]</li> +<li>git [git]</li> +<li>Subversion [svn]</li> +<li>Monotone [mtn]</li> +<li>GNU Arch [gnuarch]</li> +<li>Bazaar [bzr]</li> +<li>Perforce [p4]</li> +</ul> +<p>Accepted destination formats [identifiers]:</p> +<ul class="simple"> +<li>Mercurial [hg]</li> +<li>Subversion [svn] (history on branches is not preserved)</li> +</ul> +<p>If no revision is given, all revisions will be converted. +Otherwise, convert will only import up to the named revision +(given in a format understood by the source).</p> +<p>If no destination directory name is specified, it defaults to the +basename of the source with <tt class="docutils literal"><span class="pre">-hg</span></tt> appended. If the destination +repository doesn't exist, it will be created.</p> +<p>By default, all sources except Mercurial will use --branchsort. +Mercurial uses --sourcesort to preserve original revision numbers +order. Sort modes have the following effects:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">--branchsort</span></kbd></td> +<td>convert from parent to child revision when possible, +which means branches are usually converted one after +the other. It generates more compact repositories.</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--datesort</span></kbd></td> +<td>sort revisions by date. Converted repositories have +good-looking changelogs but are often an order of +magnitude larger than the same ones generated by +--branchsort.</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--sourcesort</span></kbd></td> +<td>try to preserve source revisions order, only +supported by Mercurial sources.</td></tr> +</tbody> +</table> +<p>If <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 (eg: CVS). One line per +author mapping and the line format is:</p> +<pre class="literal-block"> +source author = destination author +</pre> +<p>Empty lines and lines starting with a <tt class="docutils literal">#</tt> are ignored.</p> +<p>The filemap is a file that allows filtering and remapping of files +and directories. Each line can contain one of the following +directives:</p> +<pre class="literal-block"> +include path/to/file-or-dir + +exclude path/to/file-or-dir + +rename path/to/source path/to/destination +</pre> +<p>Comment lines start with <tt class="docutils literal">#</tt>. A specified path matches if it +equals the full relative name of a file or one of its parent +directories. The <tt class="docutils literal">include</tt> or <tt class="docutils literal">exclude</tt> directive with the +longest matching path applies, so line order does not matter.</p> +<p>The <tt class="docutils literal">include</tt> directive causes a file, or all files under a +directory, to be included in the destination repository, and the +exclusion of all other files and directories not explicitly +included. The <tt class="docutils literal">exclude</tt> directive causes files or directories to +be omitted. The <tt class="docutils literal">rename</tt> directive renames a file or directory if +it is converted. To rename from a subdirectory into the root of +the repository, use <tt class="docutils literal">.</tt> as the path to rename to.</p> +<p>The splicemap is a file that allows insertion of synthetic +history, letting you specify the parents of a revision. This is +useful if you want to e.g. give a Subversion merge two parents, or +graft two disconnected series of history together. Each entry +contains a key, followed by a space, followed by one or two +comma-separated values:</p> +<pre class="literal-block"> +key parent1, parent2 +</pre> +<p>The key is the revision ID in the source +revision control system whose parents should be modified (same +format as a key in .hg/shamap). The values are the revision IDs +(in either the source or destination revision control system) that +should be used as the new parents for that node. For example, if +you have merged "release-1.0" into "trunk", then you should +specify the revision on "trunk" as the first parent and the one on +the "release-1.0" branch as the second.</p> +<p>The branchmap is a file that allows you to rename a branch when it is +being brought in from whatever external repository. When used in +conjunction with a splicemap, it allows for a powerful combination +to help fix even the most badly mismanaged repositories and turn them +into nicely structured Mercurial repositories. The branchmap contains +lines of the form:</p> +<pre class="literal-block"> +original_branch_name new_branch_name +</pre> +<p>where "original_branch_name" is the name of the branch in the +source repository, and "new_branch_name" is the name of the branch +is the destination repository. No whitespace is allowed in the +branch names. This can be used to (for instance) move code in one +repository from "default" to a named branch.</p> +<div class="section" id="mercurial-source"> +<h5>Mercurial Source</h5> +<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">convert start revision and its descendants. +It takes a hg revision identifier and defaults to 0.</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">hook.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">hook.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> +</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="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>It is possible to limit the amount of source history to be +converted by specifying an initial Perforce revision:</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.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 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> +</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"> +<kbd><span class="option">--authors</span></kbd></td> +<td>username mapping filename (DEPRECATED, use --authormap instead)</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-s</span>, <span class="option">--source-type</span></kbd></td> +</tr> +<tr><td> </td><td>source repository type</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-d</span>, <span class="option">--dest-type</span></kbd></td> +</tr> +<tr><td> </td><td>destination repository type</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>import up to target revision REV</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-A</span>, <span class="option">--authormap</span></kbd></td> +</tr> +<tr><td> </td><td>remap usernames using this file</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--filemap</span></kbd></td> +<td>remap file names using contents of file</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--splicemap</span></kbd></td> +<td>splice synthesized history into place</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--branchmap</span></kbd></td> +<td>change branch names while converting</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--branchsort</span></kbd></td> +<td>try to sort changesets by branches</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--datesort</span></kbd></td> +<td>try to sort changesets by date</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--sourcesort</span></kbd></td> +<td>preserve source changesets order</td></tr> +</tbody> +</table> +</div> +</div> +</div> +</div> +<div class="section" id="eol"> +<h2><a class="toc-backref" href="#id74">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 copy. The +<tt class="docutils literal">.hgeol</tt> file use the same syntax as all other Mercurial +configuration files. It uses two sections, <tt class="docutils literal">[patterns]</tt> and +<tt class="docutils literal">[repository]</tt>.</p> +<p>The <tt class="docutils literal">[patterns]</tt> section specifies how line endings should be +converted between the working copy and the repository. The format is +specified by a file pattern. The first match is used, so put more +specific patterns first. The available line endings are <tt class="docutils literal">LF</tt>, +<tt class="docutils literal">CRLF</tt>, and <tt class="docutils literal">BIN</tt>.</p> +<p>Files with the declared format of <tt class="docutils literal">CRLF</tt> or <tt class="docutils literal">LF</tt> are always +checked out and stored in the repository in that format and files +declared to be binary (<tt class="docutils literal">BIN</tt>) are left unchanged. Additionally, +<tt class="docutils literal">native</tt> is an alias for checking out in the platform's default line +ending: <tt class="docutils literal">LF</tt> on Unix (including Mac OS X) and <tt class="docutils literal">CRLF</tt> on +Windows. Note that <tt class="docutils literal">BIN</tt> (do nothing to line endings) is Mercurial's +default behaviour; it is only needed if you need to override a later, +more general pattern.</p> +<p>The optional <tt class="docutils literal">[repository]</tt> section specifies the line endings to +use for files stored in the repository. It has a single setting, +<tt class="docutils literal">native</tt>, which determines the storage line endings for files +declared as <tt class="docutils literal">native</tt> in the <tt class="docutils literal">[patterns]</tt> section. It can be set to +<tt class="docutils literal">LF</tt> or <tt class="docutils literal">CRLF</tt>. The default is <tt class="docutils literal">LF</tt>. For example, this means +that on Windows, files configured as <tt class="docutils literal">native</tt> (<tt class="docutils literal">CRLF</tt> by default) +will be converted to <tt class="docutils literal">LF</tt> when stored in the repository. Files +declared as <tt class="docutils literal">LF</tt>, <tt class="docutils literal">CRLF</tt>, or <tt class="docutils literal">BIN</tt> in the <tt class="docutils literal">[patterns]</tt> section +are always stored as-is in the repository.</p> +<p>Example versioned <tt class="docutils literal">.hgeol</tt> file:</p> +<pre class="literal-block"> +[patterns] +**.py = native +**.vcproj = CRLF +**.txt = native +Makefile = LF +**.jpg = BIN + +[repository] +native = LF +</pre> +<div class="note"> +<p class="first admonition-title">Note</p> +<p class="last">The rules will first apply when files are touched in the working +copy, e.g. by updating to null and back to tip to touch all files.</p> +</div> +<p>The extension uses an optional <tt class="docutils literal">[eol]</tt> section 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="#id75">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 vdiff, runs kdiff3 +vdiff = kdiff3 + +# add new command called meld, runs meld (no need to name twice) +meld = + +# add new command called vimdiff, runs gvimdiff with DirDiff plugin +# (see http://www.vim.org/scripts/script.php?script_id=102) Non +# English user, be sure to put "let g:DirDiffDynamicDiffText = 1" in +# your .vimrc +vimdiff = gvim -f "+next" \ + "+execute 'DirDiff' 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="id13"> +<h3>Commands</h3> +<div class="section" id="id14"> +<h4>extdiff</h4> +<pre class="literal-block"> +hg extdiff [OPT]... [FILE]... +</pre> +<p>Show differences between revisions for the specified files, using +an external program. The default program used is diff, with +default options "-Npru".</p> +<p>To select a different program, use the -p/--program option. The +program will be passed the names of two directories to compare. To +pass additional options to the program, use -o/--option. These +will be passed before the names of the directories to compare.</p> +<p>When two revision arguments are given, then changes are shown +between those revisions. If only one revision is specified then +that revision is compared to the working directory, and, when no +revisions are specified, the working directory files are compared +to its parent.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-p</span>, <span class="option">--program</span></kbd></td> +<td>comparison program to run</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-o</span>, <span class="option">--option</span></kbd></td> +<td>pass option to comparison program</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>revision</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-c</span>, <span class="option">--change</span></kbd></td> +<td>change made by revision</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td>exclude names matching the given patterns</td></tr> +</tbody> +</table> +</div> +</div> +</div> +<div class="section" id="factotum"> +<h2><a class="toc-backref" href="#id76">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="#id77">fetch</a></h2> +<p>pull, update and merge in one command (DEPRECATED)</p> +<div class="section" id="id15"> +<h3>Commands</h3> +<div class="section" id="id16"> +<h4>fetch</h4> +<pre class="literal-block"> +hg fetch [SOURCE] +</pre> +<p>This finds all changes from the repository at the specified path +or URL and adds them to the local repository.</p> +<p>If the pulled changes add a new branch head, the head is +automatically merged, and the result of the merge is committed. +Otherwise, the working directory is updated to include the new +changes.</p> +<p>When a merge 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"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>a specific revision you would like to pull</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td> +<td>edit commit message</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--force-editor</span></kbd></td> +<td>edit commit message (DEPRECATED)</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">--switch-parent</span></kbd></td> +</tr> +<tr><td> </td><td>switch parents when merging</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td> +<td>use text as commit message</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td> +<td>read commit message from file</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td> +<td>record the specified date as commit date</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td> +<td>record the specified user as committer</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td> +<td>specify ssh command to use</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--remotecmd</span></kbd></td> +<td>specify hg command to run on the remote side</td></tr> +<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> +</div> +<div class="section" id="gpg"> +<h2><a class="toc-backref" href="#id78">gpg</a></h2> +<p>commands to sign and verify changesets</p> +<div class="section" id="id17"> +<h3>Commands</h3> +<div class="section" id="sigcheck"> +<h4>sigcheck</h4> +<pre class="literal-block"> +hg sigcheck REV +</pre> +<p>verify all the signatures there may be for a particular revision</p> +</div> +<div class="section" id="sign"> +<h4>sign</h4> +<pre class="literal-block"> +hg sign [OPTION]... [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>See <a class="reference external" href="hg.1.html#dates"><tt class="docutils literal">hg help dates</tt></a> for a list of formats valid for -d/--date.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-l</span>, <span class="option">--local</span></kbd></td> +<td>make the signature local</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td> +<td>sign even if the sigfile is modified</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--no-commit</span></kbd></td> +<td>do not commit the sigfile after signing</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-k</span>, <span class="option">--key</span></kbd></td> +<td>the key id to sign with</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td> +<td>commit message</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td> +<td>record the specified date as commit date</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td> +<td>record the specified user as committer</td></tr> +</tbody> +</table> +</div> +<div class="section" id="sigs"> +<h4>sigs</h4> +<pre class="literal-block"> +hg sigs +</pre> +<p>list signed changesets</p> +</div> +</div> +</div> +<div class="section" id="graphlog"> +<h2><a class="toc-backref" href="#id79">graphlog</a></h2> +<p>command to view revision graphs from a shell</p> +<p>This extension adds a --graph option to the incoming, outgoing and log +commands. When this options is given, an ASCII representation of the +revision graph is also shown.</p> +<div class="section" id="id18"> +<h3>Commands</h3> +<div class="section" id="glog"> +<h4>glog</h4> +<pre class="literal-block"> +hg glog [OPTION]... [FILE] +</pre> +<p>Print a revision history alongside a revision graph drawn with +ASCII characters.</p> +<p>Nodes printed as an @ character are parents of the working +directory.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-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"> +<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td> +<td>show revisions matching date spec</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-C</span>, <span class="option">--copies</span></kbd></td> +<td>show copied files</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-k</span>, <span class="option">--keyword</span></kbd></td> +<td>do case-insensitive search for a given text</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>show the specified revision or range</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--removed</span></kbd></td> +<td>include revisions where files were removed</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-m</span>, <span class="option">--only-merges</span></kbd></td> +</tr> +<tr><td> </td><td>show only merges (DEPRECATED)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td> +<td>revisions committed by user</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--only-branch</span></kbd></td> +<td>show only changesets within the given named branch (DEPRECATED)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td> +<td>show changesets within the given named branch</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-P</span>, <span class="option">--prune</span></kbd></td> +<td>do not display revision or any of its ancestors</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--hidden</span></kbd></td> +<td>show hidden changesets (DEPRECATED)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-p</span>, <span class="option">--patch</span></kbd></td> +<td>show patch</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td> +<td>use git extended diff format</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-l</span>, <span class="option">--limit</span></kbd></td> +<td>limit number of changes displayed</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-M</span>, <span class="option">--no-merges</span></kbd></td> +</tr> +<tr><td> </td><td>do not show merges</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--stat</span></kbd></td> +<td>output diffstat-style summary of changes</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-G</span>, <span class="option">--graph</span></kbd></td> +<td>show the revision DAG</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--style</span></kbd></td> +<td>display using template map file</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--template</span></kbd></td> +<td>display with template</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td>exclude names matching the given patterns</td></tr> +</tbody> +</table> +</div> +</div> +</div> +<div class="section" id="hgcia"> +<h2><a class="toc-backref" href="#id80">hgcia</a></h2> +<p>hooks for integrating with the CIA.vc notification service</p> +<p>This is meant to be run as a changegroup or incoming hook. To +configure it, set the following options in your hgrc:</p> +<pre class="literal-block"> +[cia] +# your registered CIA user name +user = foo +# the name of the project in CIA +project = foo +# the module (subproject) (optional) +#module = foo +# Append a diffstat to the log message (optional) +#diffstat = False +# Template to use for log messages (optional) +#template = {desc}\n{baseurl}{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, eg +# mailto:cia@cia.vc +# Make sure to set email.from if you do this. +#url = http://cia.vc/ +# print message instead of sending it (optional) +#test = False +# 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="#id81">hgk</a></h2> +<p>browse the repository in a graphical way</p> +<p>The hgk extension allows browsing the history of a repository in a +graphical way. It requires Tcl/Tk version 8.4 or later. (Tcl/Tk is not +distributed with Mercurial.)</p> +<p>hgk consists of two parts: a Tcl script that does the displaying and +querying of information, and an extension to Mercurial named hgk.py, +which provides hooks for hgk to get information. hgk can be found in +the contrib directory, and the extension is shipped in the hgext +repository, and needs to be enabled.</p> +<p>The <a class="reference external" href="hg.1.html#view"><tt class="docutils literal">hg view</tt></a> command will launch the hgk Tcl script. For this command +to work, hgk must be in your search path. Alternately, you can specify +the path to hgk in your configuration file:</p> +<pre class="literal-block"> +[hgk] +path=/location/of/hgk +</pre> +<p>hgk can make use of the extdiff extension to visualize revisions. +Assuming you had already configured extdiff vdiff command, just add:</p> +<pre class="literal-block"> +[hgk] +vdiff=vdiff +</pre> +<p>Revisions context menu will now display additional entries to fire +vdiff on hovered and selected revisions.</p> +<div class="section" id="id19"> +<h3>Commands</h3> +<div class="section" id="view"> +<h4>view</h4> +<pre class="literal-block"> +hg view [-l LIMIT] [REVRANGE] +</pre> +<p>start interactive history viewer</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-l</span>, <span class="option">--limit</span></kbd></td> +<td>limit number of changes displayed</td></tr> +</tbody> +</table> +</div> +</div> +</div> +<div class="section" id="highlight"> +<h2><a class="toc-backref" href="#id82">highlight</a></h2> +<p>syntax highlighting for hgweb (requires Pygments)</p> +<p>It depends on the Pygments syntax highlighting library: +<a class="reference external" href="http://pygments.org/">http://pygments.org/</a></p> +<p>There is a single configuration option:</p> +<pre class="literal-block"> +[web] +pygments_style = <style> +</pre> +<p>The default is 'colorful'.</p> +</div> +<div class="section" id="histedit"> +<h2><a class="toc-backref" href="#id83">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 633536316234 and 7c2fd3b9020c +# +# Commands: +# p, pick = use commit +# e, edit = use commit, but stop for amending +# f, fold = use commit, but fold into previous commit +# 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 633536316234 and 7c2fd3b9020c +# +# Commands: +# p, pick = use commit +# e, edit = use commit, but stop for amending +# f, fold = use commit, but fold into previous commit +# 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 example repository above and add three 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> +<div class="section" id="id20"> +<h3>Commands</h3> +<div class="section" id="id21"> +<h4>histedit</h4> +<pre class="literal-block"> +hg histedit [PARENT] +</pre> +<p>interactively edit changeset history</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">--commands</span></kbd></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">-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"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>first revision to be edited</td></tr> +</tbody> +</table> +</div> +</div> +</div> +<div class="section" id="inotify"> +<h2><a class="toc-backref" href="#id84">inotify</a></h2> +<p>accelerate status report using Linux's inotify service</p> +<div class="section" id="id22"> +<h3>Commands</h3> +<div class="section" id="inserve"> +<h4>inserve</h4> +<pre class="literal-block"> +hg inserve [OPTION]... +</pre> +<p>start an inotify server for this repository</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-d</span>, <span class="option">--daemon</span></kbd></td> +<td>run server in background</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">--daemon-pipefds</span></kbd></td> +</tr> +<tr><td> </td><td>used internally by daemon mode</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-t</span>, <span class="option">--idle-timeout</span></kbd></td> +</tr> +<tr><td> </td><td>minutes to sit idle before exiting</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--pid-file</span></kbd></td> +<td>name of file to write process ID to</td></tr> +</tbody> +</table> +</div> +</div> +</div> +<div class="section" id="interhg"> +<h2><a class="toc-backref" href="#id85">interhg</a></h2> +<p>expand expressions into changelog and summaries</p> +<p>This extension allows the use of a special syntax in summaries, which +will be automatically expanded into links or any other arbitrary +expression, much like InterWiki does.</p> +<p>A few example patterns (link to bug tracking, etc.) that may be used +in your hgrc:</p> +<pre class="literal-block"> +[interhg] +issues = s!issue(\d+)!<a href="http://bts/issue\1">issue\1</a>! +bugzilla = s!((?:bug|b=|(?=#?\d{4,}))(?:\s*#?)(\d+))!<a..=\2">\1</a>!i +boldify = s!(^|\s)#(\d+)\b! <b>#\2</b>! +</pre> +</div> +<div class="section" id="keyword"> +<h2><a class="toc-backref" href="#id86">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="id23"> +<h3>Commands</h3> +<div class="section" id="kwdemo"> +<h4>kwdemo</h4> +<pre class="literal-block"> +hg kwdemo [-d] [-f RCFILE] [TEMPLATEMAP]... +</pre> +<p>Show current, custom, or default keyword template maps and their +expansions.</p> +<p>Extend the current configuration by specifying maps as arguments +and using -f/--rcfile to source an external hgrc file.</p> +<p>Use -d/--default to disable current configuration.</p> +<p>See <a class="reference external" href="hg.1.html#templates"><tt class="docutils literal">hg help templates</tt></a> for information on templates and filters.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-d</span>, <span class="option">--default</span></kbd></td> +<td>show default keyword template maps</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-f</span>, <span class="option">--rcfile</span></kbd></td> +<td>read maps from rcfile</td></tr> +</tbody> +</table> +</div> +<div class="section" id="kwexpand"> +<h4>kwexpand</h4> +<pre class="literal-block"> +hg kwexpand [OPTION]... [FILE]... +</pre> +<p>Run after (re)enabling keyword expansion.</p> +<p>kwexpand refuses to run if given files contain local changes.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td>exclude names matching the given patterns</td></tr> +</tbody> +</table> +</div> +<div class="section" id="kwfiles"> +<h4>kwfiles</h4> +<pre class="literal-block"> +hg kwfiles [OPTION]... [FILE]... +</pre> +<p>List which files in the working directory are matched by the +[keyword] configuration patterns.</p> +<p>Useful to prevent inadvertent keyword expansion and to speed up +execution by including only files that are actual candidates for +expansion.</p> +<p>See <a class="reference external" href="hg.1.html#keyword"><tt class="docutils literal">hg help keyword</tt></a> on how to construct patterns both for +inclusion and exclusion of files.</p> +<p>With -A/--all and -v/--verbose the codes used to show the status +of files are:</p> +<pre class="literal-block"> +K = keyword expansion candidate +k = keyword expansion candidate (not tracked) +I = ignored +i = ignored (not tracked) +</pre> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-A</span>, <span class="option">--all</span></kbd></td> +<td>show keyword status flags of all files</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-i</span>, <span class="option">--ignore</span></kbd></td> +<td>show files excluded from expansion</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-u</span>, <span class="option">--unknown</span></kbd></td> +<td>only show unknown (not tracked) files</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td>exclude names matching the given patterns</td></tr> +</tbody> +</table> +</div> +<div class="section" id="kwshrink"> +<h4>kwshrink</h4> +<pre class="literal-block"> +hg kwshrink [OPTION]... [FILE]... +</pre> +<p>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"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td>exclude names matching the given patterns</td></tr> +</tbody> +</table> +</div> +</div> +</div> +<div class="section" id="largefiles"> +<h2><a class="toc-backref" href="#id87">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, Mercurial behaves as normal. 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). This means +that network access may be required to update to changesets you have +not previously updated to.</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="id24"> +<h3>Commands</h3> +<div class="section" id="lfconvert"> +<h4>lfconvert</h4> +<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"> +<kbd><span class="option">-s</span>, <span class="option">--size</span></kbd></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> +</div> +<div class="section" id="mq"> +<h2><a class="toc-backref" href="#id88">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> +<div class="section" id="id25"> +<h3>Commands</h3> +<div class="section" id="qapplied"> +<h4>qapplied</h4> +<pre class="literal-block"> +hg qapplied [-1] [-s] [PATCH] +</pre> +<p>Returns 0 on success.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-1</span>, <span class="option">--last</span></kbd></td> +<td>show only the 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> +<pre class="literal-block"> +hg qclone [OPTION]... SOURCE [DEST] +</pre> +<p>If source is local, destination will have no patches applied. If +source is remote, this command can not check if patches are +applied in source, so cannot guarantee that patches are not +applied in destination. If you clone remote repository, be sure +before that it has no patches applied.</p> +<p>Source patch repository is looked for in <src>/.hg/patches by +default. Use -p <url> to change.</p> +<p>The patch directory must be a nested Mercurial repository, as +would be created by <a class="reference external" href="hg.1.html#init"><tt class="docutils literal">hg init <span class="pre">--mq</span></tt></a>.</p> +<p>Return 0 on success.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">--pull</span></kbd></td> +<td>use pull protocol to copy metadata</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-U</span>, <span class="option">--noupdate</span></kbd></td> +<td>do not update the new working directories</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--uncompressed</span></kbd></td> +<td>use uncompressed transfer (fast over LAN)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-p</span>, <span class="option">--patches</span></kbd></td> +<td>location of source patch repository</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td> +<td>specify ssh command to use</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--remotecmd</span></kbd></td> +<td>specify hg command to run on the remote side</td></tr> +<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> +<pre class="literal-block"> +hg qcommit [OPTION]... [FILE]... +</pre> +<p>This command is deprecated; use <a class="reference external" href="hg.1.html#commit"><tt class="docutils literal">hg commit <span class="pre">--mq</span></tt></a> instead.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-A</span>, <span class="option">--addremove</span></kbd></td> +</tr> +<tr><td> </td><td>mark new/missing files as added/removed before committing</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--close-branch</span></kbd></td> +<td>mark a branch as closed, hiding it from the branch list</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--amend</span></kbd></td> +<td>amend the parent of the working dir</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td>exclude names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td> +<td>use text as commit message</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td> +<td>read commit message from file</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td> +<td>record the specified date as commit date</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td> +<td>record the specified user as committer</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-S</span>, <span class="option">--subrepos</span></kbd></td> +<td><p class="first">recurse into subrepositories</p> +<p class="last">aliases: qci</p> +</td></tr> +</tbody> +</table> +</div> +<div class="section" id="qdelete"> +<h4>qdelete</h4> +<pre class="literal-block"> +hg qdelete [-k] [PATCH]... +</pre> +<p>The patches must not be applied, and at least one patch is required. 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"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td><p class="first">stop managing a revision (DEPRECATED)</p> +<p class="last">aliases: qremove qrm</p> +</td></tr> +</tbody> +</table> +</div> +<div class="section" id="qdiff"> +<h4>qdiff</h4> +<pre class="literal-block"> +hg qdiff [OPTION]... [FILE]... +</pre> +<p>Shows a diff which includes the current patch as well as any +changes which have been made in the working directory since the +last refresh (thus showing what the current patch would become +after a qrefresh).</p> +<p>Use <a class="reference external" href="hg.1.html#diff"><tt class="docutils literal">hg diff</tt></a> if you only want to see the changes made since the +last qrefresh, or <a class="reference external" href="hg.1.html#export"><tt class="docutils literal">hg export qtip</tt></a> if you want to see changes +made by the current patch without including changes made since the +qrefresh.</p> +<p>Returns 0 on success.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-a</span>, <span class="option">--text</span></kbd></td> +<td>treat all files as text</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td> +<td>use git extended diff format</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--nodates</span></kbd></td> +<td>omit dates from diff headers</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-p</span>, <span class="option">--show-function</span></kbd></td> +</tr> +<tr><td> </td><td>show which function each change is in</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--reverse</span></kbd></td> +<td>produce a diff that undoes the changes</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-w</span>, <span class="option">--ignore-all-space</span></kbd></td> +</tr> +<tr><td> </td><td>ignore white space when comparing lines</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-b</span>, <span class="option">--ignore-space-change</span></kbd></td> +</tr> +<tr><td> </td><td>ignore changes in the amount of white space</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-B</span>, <span class="option">--ignore-blank-lines</span></kbd></td> +</tr> +<tr><td> </td><td>ignore changes whose lines are all blank</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-U</span>, <span class="option">--unified</span></kbd></td> +<td>number of lines of context to show</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--stat</span></kbd></td> +<td>output diffstat-style summary of changes</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td>exclude names matching the given patterns</td></tr> +</tbody> +</table> +</div> +<div class="section" id="qfinish"> +<h4>qfinish</h4> +<pre class="literal-block"> +hg qfinish [-a] [REV]... +</pre> +<p>Finishes the specified revisions (corresponding to applied +patches) by moving them out of mq control into regular repository +history.</p> +<p>Accepts a revision range or the -a/--applied option. If --applied +is specified, all applied mq revisions are removed from mq +control. Otherwise, the given revisions must be at the base of the +stack of applied patches.</p> +<p>This can be especially useful if your changes have been applied to +an upstream repository, or if you are about to push your changes +to upstream.</p> +<p>Returns 0 on success.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-a</span>, <span class="option">--applied</span></kbd></td> +<td>finish all applied changesets</td></tr> +</tbody> +</table> +</div> +<div class="section" id="qfold"> +<h4>qfold</h4> +<pre class="literal-block"> +hg qfold [-e] [-k] [-m TEXT] [-l FILE] PATCH... +</pre> +<p>Patches must not yet be applied. Each patch will be successively +applied to the current patch in the order given. If all the +patches apply successfully, the current patch will be refreshed +with the new cumulative patch, and the folded patches will be +deleted. With -k/--keep, the folded patch files will not be +removed afterwards.</p> +<p>The header for each folded patch will be concatenated with the +current patch header, separated by a line of <tt class="docutils literal">* * *</tt>.</p> +<p>Returns 0 on success.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td> +<td>edit patch header</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-k</span>, <span class="option">--keep</span></kbd></td> +<td>keep folded patch files</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td> +<td>use text as commit message</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td> +<td>read commit message from file</td></tr> +</tbody> +</table> +</div> +<div class="section" id="qgoto"> +<h4>qgoto</h4> +<pre class="literal-block"> +hg qgoto [OPTION]... PATCH +</pre> +<p>Returns 0 on success.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">--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> +<pre class="literal-block"> +hg qguard [-l] [-n] [PATCH] [-- [+GUARD]... [-GUARD]...] +</pre> +<p>Guards control whether a patch can be pushed. A patch with no +guards is always pushed. A patch with a positive guard ("+foo") is +pushed only if the <a class="reference external" href="hg.1.html#qselect"><tt class="docutils literal">hg qselect</tt></a> command has activated it. A patch with +a negative guard ("-foo") is never pushed if the <a class="reference external" href="hg.1.html#qselect"><tt class="docutils literal">hg qselect</tt></a> command +has activated it.</p> +<p>With no arguments, print the currently active guards. +With arguments, set guards for the named patch.</p> +<div class="note"> +<p class="first admonition-title">Note</p> +<p class="last">Specifying negative guards now requires '--'.</p> +</div> +<p>To set guards on another patch:</p> +<pre class="literal-block"> +hg qguard other.patch -- +2.6.17 -stable +</pre> +<p>Returns 0 on success.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-l</span>, <span class="option">--list</span></kbd></td> +<td>list all patches and guards</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-n</span>, <span class="option">--none</span></kbd></td> +<td>drop all guards</td></tr> +</tbody> +</table> +</div> +<div class="section" id="qheader"> +<h4>qheader</h4> +<pre class="literal-block"> +hg qheader [PATCH] +</pre> +<p>Returns 0 on success.</p> +</div> +<div class="section" id="qimport"> +<h4>qimport</h4> +<pre class="literal-block"> +hg qimport [-e] [-n NAME] [-f] [-g] [-P] [-r REV]... [FILE]... +</pre> +<p>The patch is inserted into the series after the last applied +patch. If no patches have been applied, qimport prepends the patch +to the series.</p> +<p>The patch will have the same name as its source file unless you +give it a new one with -n/--name.</p> +<p>You can register an existing patch inside the patch directory with +the -e/--existing flag.</p> +<p>With -f/--force, an existing patch of the same name will be +overwritten.</p> +<p>An existing changeset may be placed under mq control with -r/--rev +(e.g. qimport --rev tip -n patch will place tip under mq control). +With -g/--git, patches imported with --rev will use the git diff +format. See the diffs help topic for information on why this is +important for preserving rename/copy information and permission +changes. 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"> +<kbd><span class="option">-n</span>, <span class="option">--name</span></kbd></td> +<td>name of patch file</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td> +<td>overwrite existing files</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>place existing revisions under mq control</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td> +<td>use git extended diff format</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-P</span>, <span class="option">--push</span></kbd></td> +<td>qpush after importing</td></tr> +</tbody> +</table> +</div> +<div class="section" id="qinit"> +<h4>qinit</h4> +<pre class="literal-block"> +hg qinit [-c] +</pre> +<p>The queue repository is unversioned by default. If +-c/--create-repo is specified, qinit will create a separate nested +repository for patches (qinit -c may also be run later to convert +an unversioned patch repository into a versioned one). You can use +qcommit to commit changes to this queue repository.</p> +<p>This command is deprecated. Without -c, it's implied by other relevant +commands. With -c, use <a class="reference external" href="hg.1.html#init"><tt class="docutils literal">hg init <span class="pre">--mq</span></tt></a> instead.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-c</span>, <span class="option">--create-repo</span></kbd></td> +</tr> +<tr><td> </td><td>create queue repository</td></tr> +</tbody> +</table> +</div> +<div class="section" id="qnew"> +<h4>qnew</h4> +<pre class="literal-block"> +hg qnew [-e] [-m TEXT] [-l FILE] PATCH [FILE]... +</pre> +<p>qnew creates a new patch on top of the currently-applied patch (if +any). The patch will be initialized with any outstanding changes +in the working directory. You may also use -I/--include, +-X/--exclude, and/or a list of files after the patch name to add +only changes to matching files to the new patch, leaving the rest +as uncommitted modifications.</p> +<p>-u/--user and -d/--date can be used to set the (given) user and +date, respectively. -U/--currentuser and -D/--currentdate set user +to current user and date to current date.</p> +<p>-e/--edit, -m/--message or -l/--logfile set the patch header as +well as the commit message. If none is specified, the header is +empty and the commit message is '[mq]: PATCH'.</p> +<p>Use the -g/--git option to keep the patch in the git extended diff +format. Read the diffs help topic for more information on why this +is important for preserving permission changes and copy/rename +information.</p> +<p>Returns 0 on successful creation of a new patch.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td> +<td>edit commit message</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td> +<td>import uncommitted changes (DEPRECATED)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td> +<td>use git extended diff format</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-U</span>, <span class="option">--currentuser</span></kbd></td> +</tr> +<tr><td> </td><td>add "From: <current user>" to patch</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td> +<td>add "From: <USER>" to patch</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-D</span>, <span class="option">--currentdate</span></kbd></td> +</tr> +<tr><td> </td><td>add "Date: <current date>" to patch</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td> +<td>add "Date: <DATE>" to patch</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td>exclude names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td> +<td>use text as commit message</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td> +<td>read commit message from file</td></tr> +</tbody> +</table> +</div> +<div class="section" id="qnext"> +<h4>qnext</h4> +<pre class="literal-block"> +hg qnext [-s] +</pre> +<p>Returns 0 on success.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-s</span>, <span class="option">--summary</span></kbd></td> +<td>print first line of patch header</td></tr> +</tbody> +</table> +</div> +<div class="section" id="qpop"> +<h4>qpop</h4> +<pre class="literal-block"> +hg qpop [-a] [-f] [PATCH | INDEX] +</pre> +<p>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"> +<kbd><span class="option">-n</span>, <span class="option">--name</span></kbd></td> +<td>queue name to pop (DEPRECATED)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--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> +<pre class="literal-block"> +hg qprev [-s] +</pre> +<p>Returns 0 on success.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-s</span>, <span class="option">--summary</span></kbd></td> +<td>print first line of patch header</td></tr> +</tbody> +</table> +</div> +<div class="section" id="qpush"> +<h4>qpush</h4> +<pre class="literal-block"> +hg qpush [-f] [-l] [-a] [--move] [PATCH | INDEX] +</pre> +<p>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"> +<kbd><span class="option">-n</span>, <span class="option">--name</span></kbd></td> +<td>merge queue name (DEPRECATED)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--move</span></kbd></td> +<td>reorder patch series and apply only the patch</td></tr> +<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> +<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> +<pre class="literal-block"> +hg qrefresh [-I] [-X] [-e] [-m TEXT] [-l FILE] [-s] [FILE]... +</pre> +<p>If any file patterns are provided, the refreshed patch will +contain only the modifications that match those patterns; the +remaining modifications will remain in the working directory.</p> +<p>If -s/--short is specified, files currently included in the patch +will be refreshed just like matched files and remain in the patch.</p> +<p>If -e/--edit is specified, Mercurial will start your configured editor for +you to enter a message. In case qrefresh fails, you will find a backup of +your message in <tt class="docutils literal"><span class="pre">.hg/last-message.txt</span></tt>.</p> +<p>hg add/remove/copy/rename work as usual, though you might want to +use git-style patches (-g/--git or [diff] git=1) to track copies +and renames. See the diffs help topic for more information on the +git diff format.</p> +<p>Returns 0 on success.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td> +<td>edit commit message</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td> +<td>use git extended diff format</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-s</span>, <span class="option">--short</span></kbd></td> +<td>refresh only files already in the patch and specified files</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-U</span>, <span class="option">--currentuser</span></kbd></td> +</tr> +<tr><td> </td><td>add/update author field in patch with current user</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td> +<td>add/update author field in patch with given user</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-D</span>, <span class="option">--currentdate</span></kbd></td> +</tr> +<tr><td> </td><td>add/update date field in patch with current date</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td> +<td>add/update date field in patch with given date</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td>exclude names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td> +<td>use text as commit message</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td> +<td>read commit message from file</td></tr> +</tbody> +</table> +</div> +<div class="section" id="qrename"> +<h4>qrename</h4> +<pre class="literal-block"> +hg qrename PATCH1 [PATCH2] +</pre> +<p>With one argument, renames the current patch to PATCH1. +With two arguments, renames PATCH1 to PATCH2.</p> +<p>Returns 0 on success.</p> +<blockquote> +aliases: qmv</blockquote> +</div> +<div class="section" id="qrestore"> +<h4>qrestore</h4> +<pre class="literal-block"> +hg qrestore [-d] [-u] REV +</pre> +<p>This command is deprecated, use <a class="reference external" href="hg.1.html#rebase"><tt class="docutils literal">hg rebase</tt></a> instead.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-d</span>, <span class="option">--delete</span></kbd></td> +<td>delete save entry</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-u</span>, <span class="option">--update</span></kbd></td> +<td>update queue working directory</td></tr> +</tbody> +</table> +</div> +<div class="section" id="qsave"> +<h4>qsave</h4> +<pre class="literal-block"> +hg qsave [-m TEXT] [-l FILE] [-c] [-n NAME] [-e] [-f] +</pre> +<p>This command is deprecated, use <a class="reference external" href="hg.1.html#rebase"><tt class="docutils literal">hg rebase</tt></a> instead.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-c</span>, <span class="option">--copy</span></kbd></td> +<td>copy patch directory</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-n</span>, <span class="option">--name</span></kbd></td> +<td>copy directory name</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-e</span>, <span class="option">--empty</span></kbd></td> +<td>clear queue status file</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td> +<td>force copy</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td> +<td>use text as commit message</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td> +<td>read commit message from file</td></tr> +</tbody> +</table> +</div> +<div class="section" id="qselect"> +<h4>qselect</h4> +<pre class="literal-block"> +hg qselect [OPTION]... [GUARD]... +</pre> +<p>Use the <a class="reference external" href="hg.1.html#qguard"><tt class="docutils literal">hg qguard</tt></a> command to set or print guards on patch, then use +qselect to tell mq which guards to use. A patch will be pushed if +it has no guards or any positive guards match the currently +selected guard, but will not be pushed if any negative guards +match the current guard. For example:</p> +<pre class="literal-block"> +qguard foo.patch -- -stable (negative guard) +qguard bar.patch +stable (positive guard) +qselect stable +</pre> +<p>This activates the "stable" guard. mq will skip foo.patch (because +it has a negative match) but push bar.patch (because it has a +positive match).</p> +<p>With no arguments, prints the currently active guards. +With one argument, sets the active guard.</p> +<p>Use -n/--none to deactivate guards (no other arguments needed). +When no guards are active, patches with positive guards are +skipped and patches with negative guards are pushed.</p> +<p>qselect can change the guards on applied patches. It does not pop +guarded patches by default. Use --pop to pop back to the last +applied patch that is not guarded. Use --reapply (which implies +--pop) to push back to the current patch afterwards, but skip +guarded patches.</p> +<p>Use -s/--series to print a list of all guards in the series file +(no other arguments needed). Use -v for more information.</p> +<p>Returns 0 on success.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-n</span>, <span class="option">--none</span></kbd></td> +<td>disable all guards</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-s</span>, <span class="option">--series</span></kbd></td> +<td>list all guards in series file</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--pop</span></kbd></td> +<td>pop to before first guarded applied patch</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--reapply</span></kbd></td> +<td>pop, then reapply patches</td></tr> +</tbody> +</table> +</div> +<div class="section" id="qseries"> +<h4>qseries</h4> +<pre class="literal-block"> +hg qseries [-ms] +</pre> +<p>Returns 0 on success.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-m</span>, <span class="option">--missing</span></kbd></td> +<td>print patches not in series</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-s</span>, <span class="option">--summary</span></kbd></td> +<td>print first line of patch header</td></tr> +</tbody> +</table> +</div> +<div class="section" id="qtop"> +<h4>qtop</h4> +<pre class="literal-block"> +hg qtop [-s] +</pre> +<p>Returns 0 on success.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-s</span>, <span class="option">--summary</span></kbd></td> +<td>print first line of patch header</td></tr> +</tbody> +</table> +</div> +<div class="section" id="qunapplied"> +<h4>qunapplied</h4> +<pre class="literal-block"> +hg qunapplied [-1] [-s] [PATCH] +</pre> +<p>Returns 0 on success.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-1</span>, <span class="option">--first</span></kbd></td> +<td>show only the first patch</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-s</span>, <span class="option">--summary</span></kbd></td> +<td>print first line of patch header</td></tr> +</tbody> +</table> +</div> +<div class="section" id="strip"> +<h4>strip</h4> +<pre class="literal-block"> +hg strip [-k] [-f] [-n] [-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"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></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">-b</span>, <span class="option">--backup</span></kbd></td> +<td>bundle only changesets with local revision number greater than REV which are not descendants of REV (DEPRECATED)</td></tr> +<tr><td class="option-group"> +<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 copy during strip</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-B</span>, <span class="option">--bookmark</span></kbd></td> +<td>remove revs only reachable from given bookmark</td></tr> +</tbody> +</table> +</div> +</div> +</div> +<div class="section" id="notify"> +<h2><a class="toc-backref" href="#id89">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 glob +# patterns +user@host = pattern + +[reposubs] +# key is glob pattern, value is a comma-separated list of subscriber +# emails +pattern = user@host +</pre> +<p>Glob patterns are matched against absolute path to repository +root.</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="#id90">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>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="#id91">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> +<div class="section" id="id26"> +<h3>Commands</h3> +<div class="section" id="email"> +<h4>email</h4> +<pre class="literal-block"> +hg email [OPTION]... [DEST]... +</pre> +<p>By default, diffs are sent in the format generated by +<a class="reference external" href="hg.1.html#export"><tt class="docutils literal">hg export</tt></a>, one per message. The series starts with a "[PATCH 0 +of N]" introduction, which describes the series as a whole.</p> +<p>Each patch email has a Subject line of "[PATCH M of N] ...", using +the first line of the changeset description as the subject text. +The message contains two or three parts. First, the changeset +description.</p> +<p>With the -d/--diffstat option, if the diffstat program is +installed, the result of running diffstat on the patch is inserted.</p> +<p>Finally, the patch itself, as generated by <a class="reference external" href="hg.1.html#export"><tt class="docutils literal">hg export</tt></a>.</p> +<p>With the -d/--diffstat or -c/--confirm options, you will be presented +with a final summary of all messages and asked for confirmation before +the messages are sent.</p> +<p>By default the patch is included as text in the email body for +easy reviewing. Using the -a/--attach option will instead create +an attachment for the patch. With -i/--inline an inline attachment +will be created. 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>Examples:</p> +<pre class="literal-block"> +hg email -r 3000 # send patch 3000 only +hg email -r 3000 -r 3001 # send patches 3000 and 3001 +hg email -r 3000:3005 # send patches 3000 through 3005 +hg email 3000 # send patch 3000 (deprecated) + +hg email -o # send all patches not in default +hg email -o DEST # send all patches not in DEST +hg email -o -r 3000 # send all ancestors of 3000 not in default +hg email -o -r 3000 DEST # send all ancestors of 3000 not in DEST + +hg email -b # send bundle of all patches not in default +hg email -b DEST # send bundle of all patches not in DEST +hg email -b -r 3000 # bundle of all ancestors of 3000 not in default +hg email -b -r 3000 DEST # bundle of all ancestors of 3000 not in DEST + +hg email -o -m mbox && # generate an mbox file... + mutt -R -f mbox # ... and view it with mutt +hg email -o -m mbox && # generate an mbox file ... + formail -s sendmail \ # ... and use formail to send from the mbox + -bm -t < mbox # ... using sendmail +</pre> +<p>Before using this command, you will need to enable email in your +hgrc. See the [email] section in hgrc(5) for details.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td> +<td>use git extended diff format</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--plain</span></kbd></td> +<td>omit hg patch header</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-o</span>, <span class="option">--outgoing</span></kbd></td> +<td>send changes not found in the target repository</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-b</span>, <span class="option">--bundle</span></kbd></td> +<td>send changes not in target as a binary bundle</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--bundlename</span></kbd></td> +<td>name of the bundle attachment file (default: bundle)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>a revision to send</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--force</span></kbd></td> +<td>run even when remote repository is unrelated (with -b/--bundle)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--base</span></kbd></td> +<td>a base changeset to specify instead of a destination (with -b/--bundle)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--intro</span></kbd></td> +<td>send an introduction email for a single patch</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--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"> +<kbd><span class="option">--bcc</span></kbd></td> +<td>email addresses of blind carbon copy recipients</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-c</span>, <span class="option">--cc</span></kbd></td> +<td>email addresses of copy recipients</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--confirm</span></kbd></td> +<td>ask for confirmation before sending</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-d</span>, <span class="option">--diffstat</span></kbd></td> +<td>add diffstat output to messages</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--date</span></kbd></td> +<td>use the given date as the sending date</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--desc</span></kbd></td> +<td>use the given file as the series description</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-f</span>, <span class="option">--from</span></kbd></td> +<td>email address of sender</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-n</span>, <span class="option">--test</span></kbd></td> +<td>print messages that would be sent</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-m</span>, <span class="option">--mbox</span></kbd></td> +<td>write messages to mbox file instead of sending them</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--reply-to</span></kbd></td> +<td>email addresses replies should be sent to</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-s</span>, <span class="option">--subject</span></kbd></td> +<td>subject of first message (intro or single patch)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--in-reply-to</span></kbd></td> +<td>message identifier to reply to</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--flag</span></kbd></td> +<td>flags to add in subject prefixes</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-t</span>, <span class="option">--to</span></kbd></td> +<td>email addresses of recipients</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td> +<td>specify ssh command to use</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--remotecmd</span></kbd></td> +<td>specify hg command to run on the remote side</td></tr> +<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> +</div> +<div class="section" id="progress"> +<h2><a class="toc-backref" href="#id92">progress</a></h2> +<p>show progress bars for some actions</p> +<p>This extension uses the progress information logged by hg commands +to draw progress bars that are as informative as possible. Some progress +bars only offer indeterminate information, while others have a definite +end point.</p> +<p>The following settings are available:</p> +<pre class="literal-block"> +[progress] +delay = 3 # number of seconds (float) before showing the progress bar +changedelay = 1 # changedelay: minimum delay before showing a new topic. + # If set to less than 3 * refresh, that value will + # be used instead. +refresh = 0.1 # time in seconds between refreshes of the progress bar +format = topic bar number estimate # format of the progress bar +width = <none> # if set, the maximum width of the progress information + # (that is, min(width, term width) will be used) +clear-complete = True # clear the progress bar after it's done +disable = False # if true, don't show a progress bar +assume-tty = False # if true, ALWAYS show a progress bar, unless + # disable is given +</pre> +<p>Valid entries for the format field are topic, bar, number, unit, +estimate, speed, and item. item defaults to the last 20 characters of +the item, but this can be changed by adding either <tt class="docutils literal"><span class="pre">-<num></span></tt> which +would take the last num characters, or <tt class="docutils literal">+<num></tt> for the first num +characters.</p> +</div> +<div class="section" id="purge"> +<h2><a class="toc-backref" href="#id93">purge</a></h2> +<p>command to delete untracked files from the working directory</p> +<div class="section" id="id27"> +<h3>Commands</h3> +<div class="section" id="id28"> +<h4>purge</h4> +<pre class="literal-block"> +hg purge [OPTION]... [DIR]... +</pre> +<p>Delete files not known to Mercurial. This is useful to test local +and uncommitted changes in an otherwise-clean source tree.</p> +<p>This means that purge will delete:</p> +<ul class="simple"> +<li>Unknown files: files marked with "?" by <a class="reference external" href="hg.1.html#status"><tt class="docutils literal">hg status</tt></a></li> +<li>Empty directories: in fact Mercurial ignores directories unless +they contain files under source control management</li> +</ul> +<p>But it will leave untouched:</p> +<ul class="simple"> +<li>Modified and unmodified tracked files</li> +<li>Ignored files (unless --all is specified)</li> +<li>New files added to the repository (with <a class="reference external" href="hg.1.html#add"><tt class="docutils literal">hg add</tt></a>)</li> +</ul> +<p>If directories are given on the command line, only files in these +directories are considered.</p> +<p>Be careful with purge, as you could irreversibly delete some files +you forgot to add to the repository. If you only want to print the +list of files that this program would delete, use the --print +option.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-a</span>, <span class="option">--abort-on-err</span></kbd></td> +</tr> +<tr><td> </td><td>abort if an error occurs</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--all</span></kbd></td> +<td>purge ignored files too</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-p</span>, <span class="option">--print</span></kbd></td> +<td>print filenames instead of deleting them</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-0</span>, <span class="option">--print0</span></kbd></td> +<td>end filenames with NUL, for use with xargs (implies -p/--print)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td><p class="first">exclude names matching the given patterns</p> +<p class="last">aliases: clean</p> +</td></tr> +</tbody> +</table> +</div> +</div> +</div> +<div class="section" id="rebase"> +<h2><a class="toc-backref" href="#id94">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="id29"> +<h3>Commands</h3> +<div class="section" id="id30"> +<h4>rebase</h4> +<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>If you don't specify a destination changeset (<tt class="docutils literal"><span class="pre">-d/--dest</span></tt>), +rebase uses the tipmost head of the current named branch as the +destination. (The destination changeset is not modified by +rebasing, but new changesets are added as its descendants.)</p> +<p>You can specify which changesets to rebase in two ways: as a +"source" changeset or as a "base" changeset. Both are shorthand +for a topologically related set of changesets (the "source +branch"). If you specify source (<tt class="docutils literal"><span class="pre">-s/--source</span></tt>), rebase will +rebase that changeset and all of its descendants onto dest. If you +specify base (<tt class="docutils literal"><span class="pre">-b/--base</span></tt>), rebase will select ancestors of base +back to but not including the common ancestor with dest. Thus, +<tt class="docutils literal"><span class="pre">-b</span></tt> is less precise but more convenient than <tt class="docutils literal"><span class="pre">-s</span></tt>: you can +specify any changeset in the source branch, and rebase will select +the whole branch. If you specify neither <tt class="docutils literal"><span class="pre">-s</span></tt> nor <tt class="docutils literal"><span class="pre">-b</span></tt>, rebase +uses the parent of the working directory as the base.</p> +<p>By default, rebase recreates the changesets in the source branch +as descendants of dest and then destroys the originals. Use +<tt class="docutils literal"><span class="pre">--keep</span></tt> to preserve the original source changesets. Some +changesets in the source branch (e.g. merges from the destination +branch) may be dropped if they no longer contribute any change.</p> +<p>One result of the rules for selecting the destination changeset +and source branch is that, unlike <tt class="docutils literal">merge</tt>, rebase will do +nothing if you are at the latest (tipmost) head of a named branch +with two heads. You need to explicitly specify source and/or +destination (or <tt class="docutils literal">update</tt> to the other head, if it's the head of +the intended source branch).</p> +<p>If a rebase is interrupted to manually resolve a merge, it can be +continued with --continue/-c or aborted with --abort/-a.</p> +<p>Returns 0 on success, 1 if nothing to rebase.</p> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-s</span>, <span class="option">--source</span></kbd></td> +<td>rebase from the specified changeset</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-b</span>, <span class="option">--base</span></kbd></td> +<td>rebase from the base of the specified changeset (up to greatest common ancestor of base and dest)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td> +<td>rebase these revisions</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-d</span>, <span class="option">--dest</span></kbd></td> +<td>rebase onto the specified changeset</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--collapse</span></kbd></td> +<td>collapse the rebased changesets</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></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"> +<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td> +<td>read collapse commit message from file</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--keep</span></kbd></td> +<td>keep original changesets</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--keepbranches</span></kbd></td> +<td>keep original branch names</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-D</span>, <span class="option">--detach</span></kbd></td> +<td>(DEPRECATED)</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-t</span>, <span class="option">--tool</span></kbd></td> +<td>specify merge tool</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-c</span>, <span class="option">--continue</span></kbd></td> +<td>continue an interrupted rebase</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-a</span>, <span class="option">--abort</span></kbd></td> +<td>abort an interrupted rebase</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--style</span></kbd></td> +<td>display using template map file</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--template</span></kbd></td> +<td>display with template</td></tr> +</tbody> +</table> +</div> +</div> +</div> +<div class="section" id="record"> +<h2><a class="toc-backref" href="#id95">record</a></h2> +<p>commands to interactively select changes for commit/qrefresh</p> +<div class="section" id="id31"> +<h3>Commands</h3> +<div class="section" id="qrecord"> +<h4>qrecord</h4> +<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="id32"> +<h4>record</h4> +<pre class="literal-block"> +hg record [OPTION]... [FILE]... +</pre> +<p>If a list of files is omitted, all changes reported by <a class="reference external" href="hg.1.html#status"><tt class="docutils literal">hg status</tt></a> +will be candidates for recording.</p> +<p>See <a class="reference external" href="hg.1.html#dates"><tt class="docutils literal">hg help dates</tt></a> for a list of formats valid for -d/--date.</p> +<p>You will be prompted for whether to record changes to each +modified file, and for files with multiple changes, for each +change to use. For each query, the following responses are +possible:</p> +<pre class="literal-block"> +y - record this change +n - skip this change +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 as closed, hiding it from the branch list</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--amend</span></kbd></td> +<td>amend the parent of the working dir</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td> +<td>include names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td> +<td>exclude names matching the given patterns</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td> +<td>use text as commit message</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td> +<td>read commit message from file</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td> +<td>record the specified date as commit date</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td> +<td>record the specified user as committer</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-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> +</div> +</div> +</div> +<div class="section" id="relink"> +<h2><a class="toc-backref" href="#id96">relink</a></h2> +<p>recreates hardlinks between repository clones</p> +<div class="section" id="id33"> +<h3>Commands</h3> +<div class="section" id="id34"> +<h4>relink</h4> +<pre class="literal-block"> +hg relink [ORIGIN] +</pre> +<p>When repositories are cloned locally, their data files will be +hardlinked so that they only use the space of a single repository.</p> +<p>Unfortunately, subsequent pulls into either repository will break +hardlinks for any files touched by the new changesets, even if +both repositories end up pulling the same changes.</p> +<p>Similarly, passing --rev to "hg clone" will fail to use any +hardlinks, falling back to a complete copy of the source +repository.</p> +<p>This command lets you recreate those hardlinks and reclaim that +wasted space.</p> +<p>This repository will be relinked to share space with ORIGIN, which +must be on the same local disk. If ORIGIN is omitted, looks for +"default-relink", then "default", in [paths].</p> +<p>Do not attempt any read operations on this repository while the +command is running. (Both repositories will be locked against +writes.)</p> +</div> +</div> +</div> +<div class="section" id="schemes"> +<h2><a class="toc-backref" href="#id97">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="#id98">share</a></h2> +<p>share a common history between several working directories</p> +<div class="section" id="id35"> +<h3>Commands</h3> +<div class="section" id="id36"> +<h4>share</h4> +<pre class="literal-block"> +hg share [-U] SOURCE [DEST] +</pre> +<p>Initialize a new repository and working directory that shares its +history with another repository.</p> +<div class="note"> +<p class="first admonition-title">Note</p> +<p class="last">using rollback or extensions that destroy/modify history (mq, +rebase, etc.) can cause considerable confusion with shared +clones. In particular, if two shared clones are both updated to +the same changeset, and one of them destroys that changeset +with rollback, the other clone will suddenly stop working: all +operations will fail with "abort: working directory has unknown +parent". The only known workaround is to use debugsetparents on +the broken clone to reset it to a changeset that still exists +(e.g. tip).</p> +</div> +<p>Options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-U</span>, <span class="option">--noupdate</span></kbd></td> +<td>do not create a working copy</td></tr> +</tbody> +</table> +</div> +<div class="section" id="unshare"> +<h4>unshare</h4> +<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="transplant"> +<h2><a class="toc-backref" href="#id99">transplant</a></h2> +<p>command to transplant changesets from another branch</p> +<p>This extension allows you to transplant patches from another branch.</p> +<p>Transplanted patches are recorded in .hg/transplant/transplants, as a +map from a changeset hash to its hash in the source repository.</p> +<div class="section" id="id37"> +<h3>Commands</h3> +<div class="section" id="id38"> +<h4>transplant</h4> +<pre class="literal-block"> +hg transplant [-s REPO] [-b BRANCH [-a]] [-p REV] [-m REV] [REV]... +</pre> +<p>Selected changesets will be applied on top of the current working +directory with the log of the original changeset. The changesets +are copied and will thus appear twice in the history. Use the +rebase extension instead if you want to move a whole branch of +unpublished changesets.</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>If --source/-s is specified, selects changesets from the named +repository. If --branch/-b is specified, selects changesets from +the branch holding the named revision, up to that revision. If +--all/-a is specified, all changesets on the branch will be +transplanted, otherwise you will be prompted to select the +changesets you want.</p> +<p><a class="reference external" href="hg.1.html#transplant"><tt class="docutils literal">hg transplant <span class="pre">--branch</span> REV <span class="pre">--all</span></tt></a> will transplant the +selected branch (up to the named revision) onto your current +working directory.</p> +<p>You can optionally mark selected transplanted changesets as merge +changesets. You will not be prompted to transplant any ancestors +of a merged transplant, and you can merge descendants of them +normally instead of transplanting them.</p> +<p>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"> +<kbd><span class="option">-s</span>, <span class="option">--source</span></kbd></td> +<td>pull patches from REPO</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td> +<td>pull patches from branch BRANCH</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-a</span>, <span class="option">--all</span></kbd></td> +<td>pull all changesets up to BRANCH</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-p</span>, <span class="option">--prune</span></kbd></td> +<td>skip over REV</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-m</span>, <span class="option">--merge</span></kbd></td> +<td>merge at REV</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--parent</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 repair</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--filter</span></kbd></td> +<td>filter changesets through command</td></tr> +</tbody> +</table> +</div> +</div> +</div> +<div class="section" id="win32mbcs"> +<h2><a class="toc-backref" href="#id100">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="#id101">win32text</a></h2> +<p>perform automatic newline conversion</p> +<blockquote> +<p>Deprecation: The win32text extension requires each user to configure +the extension again and again for each clone since the configuration +is not copied when cloning.</p> +<p>We have therefore made the <tt class="docutils literal">eol</tt> as an alternative. The <tt class="docutils literal">eol</tt> +uses a version controlled file for its configuration and each clone +will therefore use the right settings from the start.</p> +</blockquote> +<p>To perform automatic newline conversion, use:</p> +<pre class="literal-block"> +[extensions] +win32text = +[encode] +** = cleverencode: +# or ** = macencode: + +[decode] +** = cleverdecode: +# or ** = macdecode: +</pre> +<p>If not doing conversion, to make sure you do not commit CRLF/CR by accident:</p> +<pre class="literal-block"> +[hooks] +pretxncommit.crlf = python:hgext.win32text.forbidcrlf +# or pretxncommit.cr = python:hgext.win32text.forbidcr +</pre> +<p>To do the same check on a server to prevent CRLF/CR from being +pushed or pulled:</p> +<pre class="literal-block"> +[hooks] +pretxnchangegroup.crlf = python:hgext.win32text.forbidcrlf +# or pretxnchangegroup.cr = python:hgext.win32text.forbidcr +</pre> +</div> +<div class="section" id="zeroconf"> +<h2><a class="toc-backref" href="#id102">zeroconf</a></h2> +<p>discover and advertise repositories on the local network</p> +<p>Zeroconf-enabled repositories will be announced in a network without +the need to configure a server or a service. They can be discovered +without knowing their actual IP address.</p> +<p>To allow other people to discover your repository using run +<a class="reference external" href="hg.1.html#serve"><tt class="docutils literal">hg serve</tt></a> in your repository:</p> +<pre class="literal-block"> +$ cd test +$ hg serve +</pre> +<p>You can discover Zeroconf-enabled repositories by running +<a class="reference external" href="hg.1.html#paths"><tt class="docutils literal">hg paths</tt></a>:</p> +<pre class="literal-block"> +$ hg paths +zc-test = http://example.com:8000/test +</pre> +</div> +</div> +<div class="section" id="files"> +<h1><a class="toc-backref" href="#contents">Files</a></h1> +<dl class="docutils"> +<dt><tt class="docutils literal">/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-2012 Matt Mackall. +Free use of this software is granted under the terms of the GNU General +Public License version 2 or any later version.</p> +<!-- Common link and substitution definitions. --> +</div> +</div> +</body> +</html> diff --git a/doc/hg.1.txt b/doc/hg.1.txt new file mode 100644 index 0000000..f88ce38 --- /dev/null +++ b/doc/hg.1.txt @@ -0,0 +1,119 @@ +==== + hg +==== + +--------------------------------------- +Mercurial source code management system +--------------------------------------- + +:Author: Matt Mackall <mpm@selenic.com> +:Organization: Mercurial +:Manual section: 1 +:Manual group: Mercurial Manual + +.. contents:: + :backlinks: top + :class: htmlonly + :depth: 1 + + +Synopsis +"""""""" +**hg** *command* [*option*]... [*argument*]... + +Description +""""""""""" +The **hg** command provides a command line interface to the Mercurial +system. + +Command Elements +"""""""""""""""" + +files... + indicates one or more filename or relative path filenames; see + `File Name Patterns`_ for information on pattern matching + +path + indicates a path on the local machine + +revision + indicates a changeset which can be specified as a changeset + revision number, a tag, or a unique substring of the changeset + hash value + +repository path + either the pathname of a local repository or the URI of a remote + repository. + +.. include:: hg.1.gendoc.txt + +Files +""""" + +``/etc/mercurial/hgrc``, ``$HOME/.hgrc``, ``.hg/hgrc`` + This file contains defaults and configuration. Values in + ``.hg/hgrc`` override those in ``$HOME/.hgrc``, and these override + settings made in the global ``/etc/mercurial/hgrc`` configuration. + See |hgrc(5)|_ for details of the contents and format of these + files. + +``.hgignore`` + This file contains regular expressions (one per line) that + describe file names that should be ignored by **hg**. For details, + see |hgignore(5)|_. + +``.hgsub`` + This file defines the locations of all subrepositories, and + tells where the subrepository checkouts came from. For details, see + :hg:`help subrepos`. + +``.hgsubstate`` + This file is where Mercurial stores all nested repository states. *NB: This + file should not be edited manually.* + +``.hgtags`` + 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. + +``.hg/last-message.txt`` + This file is used by :hg:`commit` to store a backup of the commit message + in case the commit fails. + +``.hg/localtags`` + This file can be used to define local tags which are not shared among + repositories. The file format is the same as for ``.hgtags``, but it is + encoded using the local system encoding. + +Some commands (e.g. revert) produce backup files ending in ``.orig``, +if the ``.orig`` file already exists and is not tracked by Mercurial, +it will be overwritten. + +Bugs +"""" +Probably lots, please post them to the mailing list (see Resources_ +below) when you find them. + +See Also +"""""""" +|hgignore(5)|_, |hgrc(5)|_ + +Author +"""""" +Written by Matt Mackall <mpm@selenic.com> + +Resources +""""""""" +Main Web Site: http://mercurial.selenic.com/ + +Source code repository: http://selenic.com/hg + +Mailing list: http://selenic.com/mailman/listinfo/mercurial + +Copying +""""""" +Copyright (C) 2005-2012 Matt Mackall. +Free use of this software is granted under the terms of the GNU General +Public License version 2 or any later version. + +.. include:: common.txt diff --git a/doc/hgignore.5 b/doc/hgignore.5 new file mode 100644 index 0000000..3535da7 --- /dev/null +++ b/doc/hgignore.5 @@ -0,0 +1,151 @@ +.\" Man page generated from reStructeredText. +. +.TH HGIGNORE 5 "" "" "Mercurial Manual" +.SH NAME +hgignore \- syntax for Mercurial ignore files +. +.nr rst2man-indent-level 0 +. +.de1 rstReportMargin +\\$1 \\n[an-margin] +level \\n[rst2man-indent-level] +level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] +- +\\n[rst2man-indent0] +\\n[rst2man-indent1] +\\n[rst2man-indent2] +.. +.de1 INDENT +.\" .rstReportMargin pre: +. RS \\$1 +. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] +. nr rst2man-indent-level +1 +.\" .rstReportMargin post: +.. +.de UNINDENT +. RE +.\" indent \\n[an-margin] +.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] +.nr rst2man-indent-level -1 +.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] +.in \\n[rst2man-indent\\n[rst2man-indent-level]]u +.. +.SH SYNOPSIS +.sp +The Mercurial system uses a file called \fB.hgignore\fP in the root +directory of a repository to control its behavior when it searches +for files that it is not currently tracking. +.SH DESCRIPTION +.sp +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 \fB.hgignore\fP file in +the root of the working directory. The \fB.hgignore\fP 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. +.sp +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 \fB.hgignore\fP. +.sp +For example, say we have an untracked file, \fBfile.c\fP, at +\fBa/b/file.c\fP inside our repository. Mercurial will ignore \fBfile.c\fP +if any pattern in \fB.hgignore\fP matches \fBa/b/file.c\fP, \fBa/b\fP or \fBa\fP. +.sp +In addition, a Mercurial configuration file can reference a set of +per\-user or global ignore files. See the \fBignore\fP configuration +key on the \fB[ui]\fP section of \%\fBhg help config\fP\: for details of how to +configure these files. +.sp +To control Mercurial\(aqs handling of files that it manages, many +commands support the \fB\-I\fP and \fB\-X\fP options; see +\%\fBhg help <command>\fP\: and \%\fBhg help patterns\fP\: for details. +.sp +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 \%\fBhg add X\fP\:, even if X would be excluded by a pattern +in .hgignore. +.SH SYNTAX +.sp +An ignore file is a plain text file consisting of a list of patterns, +with one pattern per line. Empty lines are skipped. The \fB#\fP +character is treated as a comment character, and the \fB\e\fP character +is treated as an escape character. +.sp +Mercurial supports several pattern syntaxes. The default syntax used +is Python/Perl\-style regular expressions. +.sp +To change the syntax used, use a line of the following form: +.sp +.nf +.ft C +syntax: NAME +.ft P +.fi +.sp +where \fBNAME\fP is one of the following: +.INDENT 0.0 +.TP +.B \fBregexp\fP +.sp +Regular expression, Python/Perl syntax. +.TP +.B \fBglob\fP +.sp +Shell\-style glob. +.UNINDENT +.sp +The chosen syntax stays in effect when parsing all patterns that +follow, until another syntax is selected. +.sp +Neither glob nor regexp patterns are rooted. A glob\-syntax pattern of +the form \fB*.c\fP will match a file ending in \fB.c\fP in any directory, +and a regexp pattern of the form \fB\e.c$\fP will do the same. To root a +regexp pattern, start it with \fB^\fP. +.IP Note +. +Patterns specified in other than \fB.hgignore\fP are always rooted. +Please see \%\fBhg help patterns\fP\: for details. +.RE +.SH EXAMPLE +.sp +Here is an example ignore file. +.sp +.nf +.ft C +# use glob syntax. +syntax: glob + +*.elc +*.pyc +*~ + +# switch to regexp syntax. +syntax: regexp +^\e.pc/ +.ft P +.fi +.SH AUTHOR +.sp +Vadim Gelfer <\%vadim.gelfer@gmail.com\:> +.sp +Mercurial was written by Matt Mackall <\%mpm@selenic.com\:>. +.SH SEE ALSO +.sp +\%\fBhg\fP(1)\:, \%\fBhgrc\fP(5)\: +.SH COPYING +.sp +This manual page is copyright 2006 Vadim Gelfer. +Mercurial is copyright 2005\-2012 Matt Mackall. +Free use of this software is granted under the terms of the GNU General +Public License version 2 or any later version. +.\" Common link and substitution definitions. +. +.SH AUTHOR +Vadim Gelfer <vadim.gelfer@gmail.com> + +Organization: Mercurial +.\" Generated by docutils manpage writer. +.\" +. diff --git a/doc/hgignore.5.html b/doc/hgignore.5.html new file mode 100644 index 0000000..d760dba --- /dev/null +++ b/doc/hgignore.5.html @@ -0,0 +1,129 @@ +<?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.8.1: http://docutils.sourceforge.net/" /> +<title>hgignore</title> +<meta name="author" content="Vadim Gelfer <vadim.gelfer@gmail.com>" /> +<meta name="organization" content="Mercurial" /> +<link rel="stylesheet" href="style.css" type="text/css" /> +</head> +<body> +<div class="document" id="hgignore"> +<h1 class="title">hgignore</h1> +<h2 class="subtitle" id="syntax-for-mercurial-ignore-files">syntax for Mercurial ignore files</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>Vadim Gelfer <<a class="reference external" href="mailto:vadim.gelfer@gmail.com">vadim.gelfer@gmail.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">5</td> +</tr> +<tr class="field"><th class="docinfo-name">Manual group:</th><td class="field-body">Mercurial Manual</td> +</tr> +</tbody> +</table> +<div class="section" id="synopsis"> +<h1>Synopsis</h1> +<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="description"> +<h1>Description</h1> +<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"> +<h1>Syntax</h1> +<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> +<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"> +<h1>Example</h1> +<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 class="section" id="author"> +<h1>Author</h1> +<p>Vadim Gelfer <<a class="reference external" href="mailto:vadim.gelfer@gmail.com">vadim.gelfer@gmail.com</a>></p> +<p>Mercurial was written by Matt Mackall <<a class="reference external" href="mailto:mpm@selenic.com">mpm@selenic.com</a>>.</p> +</div> +<div class="section" id="see-also"> +<h1>See Also</h1> +<p><a class="reference external" href="hg.1.html"><strong>hg</strong>(1)</a>, <a class="reference external" href="hgrc.5.html"><strong>hgrc</strong>(5)</a></p> +</div> +<div class="section" id="copying"> +<h1>Copying</h1> +<p>This manual page is copyright 2006 Vadim Gelfer. +Mercurial is copyright 2005-2012 Matt Mackall. +Free use of this software is granted under the terms of the GNU General +Public License version 2 or any later version.</p> +<!-- Common link and substitution definitions. --> +</div> +</div> +</body> +</html> diff --git a/doc/hgignore.5.txt b/doc/hgignore.5.txt new file mode 100644 index 0000000..7e39f3e --- /dev/null +++ b/doc/hgignore.5.txt @@ -0,0 +1,34 @@ +========== + hgignore +========== + +--------------------------------- +syntax for Mercurial ignore files +--------------------------------- + +:Author: Vadim Gelfer <vadim.gelfer@gmail.com> +:Organization: Mercurial +:Manual section: 5 +:Manual group: Mercurial Manual + +.. include:: ../mercurial/help/hgignore.txt + +Author +====== +Vadim Gelfer <vadim.gelfer@gmail.com> + +Mercurial was written by Matt Mackall <mpm@selenic.com>. + +See Also +======== +|hg(1)|_, |hgrc(5)|_ + +Copying +======= +This manual page is copyright 2006 Vadim Gelfer. +Mercurial is copyright 2005-2012 Matt Mackall. +Free use of this software is granted under the terms of the GNU General +Public License version 2 or any later version. + +.. include:: common.txt + diff --git a/doc/hgmanpage.py b/doc/hgmanpage.py new file mode 100644 index 0000000..1d824b1 --- /dev/null +++ b/doc/hgmanpage.py @@ -0,0 +1,1110 @@ +# -*- coding: utf-8 -*- +# $Id: manpage.py 6110 2009-08-31 14:40:33Z grubert $ +# Author: Engelbert Gruber <grubert@users.sourceforge.net> +# Copyright: This module is put into the public domain. + +""" +Simple man page writer for reStructuredText. + +Man pages (short for "manual pages") contain system documentation on unix-like +systems. The pages are grouped in numbered sections: + + 1 executable programs and shell commands + 2 system calls + 3 library functions + 4 special files + 5 file formats + 6 games + 7 miscellaneous + 8 system administration + +Man pages are written *troff*, a text file formatting system. + +See http://www.tldp.org/HOWTO/Man-Page for a start. + +Man pages have no subsection only parts. +Standard parts + + NAME , + SYNOPSIS , + DESCRIPTION , + OPTIONS , + FILES , + SEE ALSO , + BUGS , + +and + + AUTHOR . + +A unix-like system keeps an index of the DESCRIPTIONs, which is accesable +by the command whatis or apropos. + +""" + +__docformat__ = 'reStructuredText' + +import re + +from docutils import nodes, writers, languages +try: + import roman +except ImportError: + from docutils.utils import roman +import inspect + +FIELD_LIST_INDENT = 7 +DEFINITION_LIST_INDENT = 7 +OPTION_LIST_INDENT = 7 +BLOCKQOUTE_INDENT = 3.5 + +# Define two macros so man/roff can calculate the +# indent/unindent margins by itself +MACRO_DEF = (r""". +.nr rst2man-indent-level 0 +. +.de1 rstReportMargin +\\$1 \\n[an-margin] +level \\n[rst2man-indent-level] +level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] +- +\\n[rst2man-indent0] +\\n[rst2man-indent1] +\\n[rst2man-indent2] +.. +.de1 INDENT +.\" .rstReportMargin pre: +. RS \\$1 +. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] +. nr rst2man-indent-level +1 +.\" .rstReportMargin post: +.. +.de UNINDENT +. RE +.\" indent \\n[an-margin] +.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] +.nr rst2man-indent-level -1 +.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] +.in \\n[rst2man-indent\\n[rst2man-indent-level]]u +.. +""") + +class Writer(writers.Writer): + + supported = ('manpage') + """Formats this writer supports.""" + + output = None + """Final translated form of `document`.""" + + def __init__(self): + writers.Writer.__init__(self) + self.translator_class = Translator + + def translate(self): + visitor = self.translator_class(self.document) + self.document.walkabout(visitor) + self.output = visitor.astext() + + +class Table(object): + def __init__(self): + self._rows = [] + self._options = ['center'] + self._tab_char = '\t' + self._coldefs = [] + def new_row(self): + self._rows.append([]) + def append_separator(self, separator): + """Append the separator for table head.""" + self._rows.append([separator]) + def append_cell(self, cell_lines): + """cell_lines is an array of lines""" + start = 0 + if len(cell_lines) > 0 and cell_lines[0] == '.sp\n': + start = 1 + self._rows[-1].append(cell_lines[start:]) + if len(self._coldefs) < len(self._rows[-1]): + self._coldefs.append('l') + def _minimize_cell(self, cell_lines): + """Remove leading and trailing blank and ``.sp`` lines""" + while (cell_lines and cell_lines[0] in ('\n', '.sp\n')): + del cell_lines[0] + while (cell_lines and cell_lines[-1] in ('\n', '.sp\n')): + del cell_lines[-1] + def as_list(self): + text = ['.TS\n'] + text.append(' '.join(self._options) + ';\n') + text.append('|%s|.\n' % ('|'.join(self._coldefs))) + for row in self._rows: + # row = array of cells. cell = array of lines. + text.append('_\n') # line above + text.append('T{\n') + for i in range(len(row)): + cell = row[i] + self._minimize_cell(cell) + text.extend(cell) + if not text[-1].endswith('\n'): + text[-1] += '\n' + if i < len(row)-1: + text.append('T}'+self._tab_char+'T{\n') + else: + text.append('T}\n') + text.append('_\n') + text.append('.TE\n') + return text + +class Translator(nodes.NodeVisitor): + """""" + + words_and_spaces = re.compile(r'\S+| +|\n') + document_start = """Man page generated from reStructeredText.""" + + def __init__(self, document): + nodes.NodeVisitor.__init__(self, document) + self.settings = settings = document.settings + lcode = settings.language_code + arglen = len(inspect.getargspec(languages.get_language)[0]) + if arglen == 2: + self.language = languages.get_language(lcode, + self.document.reporter) + else: + self.language = languages.get_language(lcode) + self.head = [] + self.body = [] + self.foot = [] + self.section_level = 0 + self.context = [] + self.topic_class = '' + self.colspecs = [] + self.compact_p = 1 + self.compact_simple = None + # the list style "*" bullet or "#" numbered + self._list_char = [] + # writing the header .TH and .SH NAME is postboned after + # docinfo. + self._docinfo = { + "title" : "", "title_upper": "", + "subtitle" : "", + "manual_section" : "", "manual_group" : "", + "author" : [], + "date" : "", + "copyright" : "", + "version" : "", + } + self._docinfo_keys = [] # a list to keep the sequence as in source. + self._docinfo_names = {} # to get name from text not normalized. + self._in_docinfo = None + self._active_table = None + self._in_literal = False + self.header_written = 0 + self._line_block = 0 + self.authors = [] + self.section_level = 0 + self._indent = [0] + # central definition of simple processing rules + # what to output on : visit, depart + # Do not use paragraph requests ``.PP`` because these set indentation. + # use ``.sp``. Remove superfluous ``.sp`` in ``astext``. + # + # Fonts are put on a stack, the top one is used. + # ``.ft P`` or ``\\fP`` pop from stack. + # ``B`` bold, ``I`` italic, ``R`` roman should be available. + # Hopefully ``C`` courier too. + self.defs = { + 'indent' : ('.INDENT %.1f\n', '.UNINDENT\n'), + 'definition_list_item' : ('.TP', ''), + 'field_name' : ('.TP\n.B ', '\n'), + 'literal' : ('\\fB', '\\fP'), + 'literal_block' : ('.sp\n.nf\n.ft C\n', '\n.ft P\n.fi\n'), + + 'option_list_item' : ('.TP\n', ''), + + 'reference' : (r'\%', r'\:'), + 'emphasis': ('\\fI', '\\fP'), + 'strong' : ('\\fB', '\\fP'), + 'term' : ('\n.B ', '\n'), + 'title_reference' : ('\\fI', '\\fP'), + + 'topic-title' : ('.SS ',), + 'sidebar-title' : ('.SS ',), + + 'problematic' : ('\n.nf\n', '\n.fi\n'), + } + # NOTE don't specify the newline before a dot-command, but ensure + # it is there. + + def comment_begin(self, text): + """Return commented version of the passed text WITHOUT end of + line/comment.""" + prefix = '.\\" ' + out_text = ''.join( + [(prefix + in_line + '\n') + for in_line in text.split('\n')]) + return out_text + + def comment(self, text): + """Return commented version of the passed text.""" + return self.comment_begin(text)+'.\n' + + def ensure_eol(self): + """Ensure the last line in body is terminated by new line.""" + if self.body[-1][-1] != '\n': + self.body.append('\n') + + def astext(self): + """Return the final formatted document as a string.""" + if not self.header_written: + # ensure we get a ".TH" as viewers require it. + self.head.append(self.header()) + # filter body + for i in xrange(len(self.body)-1, 0, -1): + # remove superfluous vertical gaps. + if self.body[i] == '.sp\n': + if self.body[i - 1][:4] in ('.BI ','.IP '): + self.body[i] = '.\n' + elif (self.body[i - 1][:3] == '.B ' and + self.body[i - 2][:4] == '.TP\n'): + self.body[i] = '.\n' + elif (self.body[i - 1] == '\n' and + self.body[i - 2][0] != '.' and + (self.body[i - 3][:7] == '.TP\n.B ' + or self.body[i - 3][:4] == '\n.B ') + ): + self.body[i] = '.\n' + return ''.join(self.head + self.body + self.foot) + + def deunicode(self, text): + text = text.replace(u'\xa0', '\\ ') + text = text.replace(u'\u2020', '\\(dg') + return text + + def visit_Text(self, node): + text = node.astext() + text = text.replace('\\','\\e') + replace_pairs = [ + (u'-', ur'\-'), + (u'\'', ur'\(aq'), + (u'´', ur'\''), + (u'`', ur'\(ga'), + ] + for (in_char, out_markup) in replace_pairs: + text = text.replace(in_char, out_markup) + # unicode + text = self.deunicode(text) + if self._in_literal: + # prevent interpretation of "." at line start + if text[0] == '.': + text = '\\&' + text + text = text.replace('\n.', '\n\\&.') + self.body.append(text) + + def depart_Text(self, node): + pass + + def list_start(self, node): + class enum_char(object): + enum_style = { + 'bullet' : '\\(bu', + 'emdash' : '\\(em', + } + + def __init__(self, style): + self._style = style + if 'start' in node: + self._cnt = node['start'] - 1 + else: + self._cnt = 0 + self._indent = 2 + if style == 'arabic': + # indentation depends on number of childrens + # and start value. + self._indent = len(str(len(node.children))) + self._indent += len(str(self._cnt)) + 1 + elif style == 'loweralpha': + self._cnt += ord('a') - 1 + self._indent = 3 + elif style == 'upperalpha': + self._cnt += ord('A') - 1 + self._indent = 3 + elif style.endswith('roman'): + self._indent = 5 + + def next(self): + if self._style == 'bullet': + return self.enum_style[self._style] + elif self._style == 'emdash': + return self.enum_style[self._style] + self._cnt += 1 + # TODO add prefix postfix + if self._style == 'arabic': + return "%d." % self._cnt + elif self._style in ('loweralpha', 'upperalpha'): + return "%c." % self._cnt + elif self._style.endswith('roman'): + res = roman.toRoman(self._cnt) + '.' + if self._style.startswith('upper'): + return res.upper() + return res.lower() + else: + return "%d." % self._cnt + def get_width(self): + return self._indent + def __repr__(self): + return 'enum_style-%s' % list(self._style) + + if 'enumtype' in node: + self._list_char.append(enum_char(node['enumtype'])) + else: + self._list_char.append(enum_char('bullet')) + if len(self._list_char) > 1: + # indent nested lists + self.indent(self._list_char[-2].get_width()) + else: + self.indent(self._list_char[-1].get_width()) + + def list_end(self): + self.dedent() + self._list_char.pop() + + def header(self): + tmpl = (".TH %(title_upper)s %(manual_section)s" + " \"%(date)s\" \"%(version)s\" \"%(manual_group)s\"\n" + ".SH NAME\n" + "%(title)s \- %(subtitle)s\n") + return tmpl % self._docinfo + + def append_header(self): + """append header with .TH and .SH NAME""" + # NOTE before everything + # .TH title_upper section date source manual + if self.header_written: + return + self.body.append(self.header()) + self.body.append(MACRO_DEF) + self.header_written = 1 + + def visit_address(self, node): + self.visit_docinfo_item(node, 'address') + + def depart_address(self, node): + pass + + def visit_admonition(self, node, name=None): + if name: + self.body.append('.IP %s\n' % + self.language.labels.get(name, name)) + + def depart_admonition(self, node): + self.body.append('.RE\n') + + def visit_attention(self, node): + self.visit_admonition(node, 'attention') + + depart_attention = depart_admonition + + def visit_docinfo_item(self, node, name): + if name == 'author': + self._docinfo[name].append(node.astext()) + else: + self._docinfo[name] = node.astext() + self._docinfo_keys.append(name) + raise nodes.SkipNode + + def depart_docinfo_item(self, node): + pass + + def visit_author(self, node): + self.visit_docinfo_item(node, 'author') + + depart_author = depart_docinfo_item + + def visit_authors(self, node): + # _author is called anyway. + pass + + def depart_authors(self, node): + pass + + def visit_block_quote(self, node): + # BUG/HACK: indent alway uses the _last_ indention, + # thus we need two of them. + self.indent(BLOCKQOUTE_INDENT) + self.indent(0) + + def depart_block_quote(self, node): + self.dedent() + self.dedent() + + def visit_bullet_list(self, node): + self.list_start(node) + + def depart_bullet_list(self, node): + self.list_end() + + def visit_caption(self, node): + pass + + def depart_caption(self, node): + pass + + def visit_caution(self, node): + self.visit_admonition(node, 'caution') + + depart_caution = depart_admonition + + def visit_citation(self, node): + num, text = node.astext().split(None, 1) + num = num.strip() + self.body.append('.IP [%s] 5\n' % num) + + def depart_citation(self, node): + pass + + def visit_citation_reference(self, node): + self.body.append('['+node.astext()+']') + raise nodes.SkipNode + + def visit_classifier(self, node): + pass + + def depart_classifier(self, node): + pass + + def visit_colspec(self, node): + self.colspecs.append(node) + + def depart_colspec(self, node): + pass + + def write_colspecs(self): + self.body.append("%s.\n" % ('L '*len(self.colspecs))) + + def visit_comment(self, node, + sub=re.compile('-(?=-)').sub): + self.body.append(self.comment(node.astext())) + raise nodes.SkipNode + + def visit_contact(self, node): + self.visit_docinfo_item(node, 'contact') + + depart_contact = depart_docinfo_item + + def visit_container(self, node): + pass + + def depart_container(self, node): + pass + + def visit_compound(self, node): + pass + + def depart_compound(self, node): + pass + + def visit_copyright(self, node): + self.visit_docinfo_item(node, 'copyright') + + def visit_danger(self, node): + self.visit_admonition(node, 'danger') + + depart_danger = depart_admonition + + def visit_date(self, node): + self.visit_docinfo_item(node, 'date') + + def visit_decoration(self, node): + pass + + def depart_decoration(self, node): + pass + + def visit_definition(self, node): + pass + + def depart_definition(self, node): + pass + + def visit_definition_list(self, node): + self.indent(DEFINITION_LIST_INDENT) + + def depart_definition_list(self, node): + self.dedent() + + def visit_definition_list_item(self, node): + self.body.append(self.defs['definition_list_item'][0]) + + def depart_definition_list_item(self, node): + self.body.append(self.defs['definition_list_item'][1]) + + def visit_description(self, node): + pass + + def depart_description(self, node): + pass + + def visit_docinfo(self, node): + self._in_docinfo = 1 + + def depart_docinfo(self, node): + self._in_docinfo = None + # NOTE nothing should be written before this + self.append_header() + + def visit_doctest_block(self, node): + self.body.append(self.defs['literal_block'][0]) + self._in_literal = True + + def depart_doctest_block(self, node): + self._in_literal = False + self.body.append(self.defs['literal_block'][1]) + + def visit_document(self, node): + # no blank line between comment and header. + self.body.append(self.comment(self.document_start).rstrip()+'\n') + # writing header is postboned + self.header_written = 0 + + def depart_document(self, node): + if self._docinfo['author']: + self.body.append('.SH AUTHOR\n%s\n' + % ', '.join(self._docinfo['author'])) + skip = ('author', 'copyright', 'date', + 'manual_group', 'manual_section', + 'subtitle', + 'title', 'title_upper', 'version') + for name in self._docinfo_keys: + if name == 'address': + self.body.append("\n%s:\n%s%s.nf\n%s\n.fi\n%s%s" % ( + self.language.labels.get(name, name), + self.defs['indent'][0] % 0, + self.defs['indent'][0] % BLOCKQOUTE_INDENT, + self._docinfo[name], + self.defs['indent'][1], + self.defs['indent'][1])) + elif name not in skip: + if name in self._docinfo_names: + label = self._docinfo_names[name] + else: + label = self.language.labels.get(name, name) + self.body.append("\n%s: %s\n" % (label, self._docinfo[name])) + if self._docinfo['copyright']: + self.body.append('.SH COPYRIGHT\n%s\n' + % self._docinfo['copyright']) + self.body.append(self.comment( + 'Generated by docutils manpage writer.\n')) + + def visit_emphasis(self, node): + self.body.append(self.defs['emphasis'][0]) + + def depart_emphasis(self, node): + self.body.append(self.defs['emphasis'][1]) + + def visit_entry(self, node): + # a cell in a table row + if 'morerows' in node: + self.document.reporter.warning('"table row spanning" not supported', + base_node=node) + if 'morecols' in node: + self.document.reporter.warning( + '"table cell spanning" not supported', base_node=node) + self.context.append(len(self.body)) + + def depart_entry(self, node): + start = self.context.pop() + self._active_table.append_cell(self.body[start:]) + del self.body[start:] + + def visit_enumerated_list(self, node): + self.list_start(node) + + def depart_enumerated_list(self, node): + self.list_end() + + def visit_error(self, node): + self.visit_admonition(node, 'error') + + depart_error = depart_admonition + + def visit_field(self, node): + pass + + def depart_field(self, node): + pass + + def visit_field_body(self, node): + if self._in_docinfo: + name_normalized = self._field_name.lower().replace(" ","_") + self._docinfo_names[name_normalized] = self._field_name + self.visit_docinfo_item(node, name_normalized) + raise nodes.SkipNode + + def depart_field_body(self, node): + pass + + def visit_field_list(self, node): + self.indent(FIELD_LIST_INDENT) + + def depart_field_list(self, node): + self.dedent() + + def visit_field_name(self, node): + if self._in_docinfo: + self._field_name = node.astext() + raise nodes.SkipNode + else: + self.body.append(self.defs['field_name'][0]) + + def depart_field_name(self, node): + self.body.append(self.defs['field_name'][1]) + + def visit_figure(self, node): + self.indent(2.5) + self.indent(0) + + def depart_figure(self, node): + self.dedent() + self.dedent() + + def visit_footer(self, node): + self.document.reporter.warning('"footer" not supported', + base_node=node) + + def depart_footer(self, node): + pass + + def visit_footnote(self, node): + num, text = node.astext().split(None, 1) + num = num.strip() + self.body.append('.IP [%s] 5\n' % self.deunicode(num)) + + def depart_footnote(self, node): + pass + + def footnote_backrefs(self, node): + self.document.reporter.warning('"footnote_backrefs" not supported', + base_node=node) + + def visit_footnote_reference(self, node): + self.body.append('['+self.deunicode(node.astext())+']') + raise nodes.SkipNode + + def depart_footnote_reference(self, node): + pass + + def visit_generated(self, node): + pass + + def depart_generated(self, node): + pass + + def visit_header(self, node): + raise NotImplementedError, node.astext() + + def depart_header(self, node): + pass + + def visit_hint(self, node): + self.visit_admonition(node, 'hint') + + depart_hint = depart_admonition + + def visit_subscript(self, node): + self.body.append('\\s-2\\d') + + def depart_subscript(self, node): + self.body.append('\\u\\s0') + + def visit_superscript(self, node): + self.body.append('\\s-2\\u') + + def depart_superscript(self, node): + self.body.append('\\d\\s0') + + def visit_attribution(self, node): + self.body.append('\\(em ') + + def depart_attribution(self, node): + self.body.append('\n') + + def visit_image(self, node): + self.document.reporter.warning('"image" not supported', + base_node=node) + text = [] + if 'alt' in node.attributes: + text.append(node.attributes['alt']) + if 'uri' in node.attributes: + text.append(node.attributes['uri']) + self.body.append('[image: %s]\n' % ('/'.join(text))) + raise nodes.SkipNode + + def visit_important(self, node): + self.visit_admonition(node, 'important') + + depart_important = depart_admonition + + def visit_label(self, node): + # footnote and citation + if (isinstance(node.parent, nodes.footnote) + or isinstance(node.parent, nodes.citation)): + raise nodes.SkipNode + self.document.reporter.warning('"unsupported "label"', + base_node=node) + self.body.append('[') + + def depart_label(self, node): + self.body.append(']\n') + + def visit_legend(self, node): + pass + + def depart_legend(self, node): + pass + + # WHAT should we use .INDENT, .UNINDENT ? + def visit_line_block(self, node): + self._line_block += 1 + if self._line_block == 1: + self.body.append('.sp\n') + self.body.append('.nf\n') + else: + self.body.append('.in +2\n') + + def depart_line_block(self, node): + self._line_block -= 1 + if self._line_block == 0: + self.body.append('.fi\n') + self.body.append('.sp\n') + else: + self.body.append('.in -2\n') + + def visit_line(self, node): + pass + + def depart_line(self, node): + self.body.append('\n') + + def visit_list_item(self, node): + # man 7 man argues to use ".IP" instead of ".TP" + self.body.append('.IP %s %d\n' % ( + self._list_char[-1].next(), + self._list_char[-1].get_width(),)) + + def depart_list_item(self, node): + pass + + def visit_literal(self, node): + self.body.append(self.defs['literal'][0]) + + def depart_literal(self, node): + self.body.append(self.defs['literal'][1]) + + def visit_literal_block(self, node): + self.body.append(self.defs['literal_block'][0]) + self._in_literal = True + + def depart_literal_block(self, node): + self._in_literal = False + self.body.append(self.defs['literal_block'][1]) + + def visit_meta(self, node): + raise NotImplementedError, node.astext() + + def depart_meta(self, node): + pass + + def visit_note(self, node): + self.visit_admonition(node, 'note') + + depart_note = depart_admonition + + def indent(self, by=0.5): + # if we are in a section ".SH" there already is a .RS + step = self._indent[-1] + self._indent.append(by) + self.body.append(self.defs['indent'][0] % step) + + def dedent(self): + self._indent.pop() + self.body.append(self.defs['indent'][1]) + + def visit_option_list(self, node): + self.indent(OPTION_LIST_INDENT) + + def depart_option_list(self, node): + self.dedent() + + def visit_option_list_item(self, node): + # one item of the list + self.body.append(self.defs['option_list_item'][0]) + + def depart_option_list_item(self, node): + self.body.append(self.defs['option_list_item'][1]) + + def visit_option_group(self, node): + # as one option could have several forms it is a group + # options without parameter bold only, .B, -v + # options with parameter bold italic, .BI, -f file + # + # we do not know if .B or .BI + self.context.append('.B') # blind guess + self.context.append(len(self.body)) # to be able to insert later + self.context.append(0) # option counter + + def depart_option_group(self, node): + self.context.pop() # the counter + start_position = self.context.pop() + text = self.body[start_position:] + del self.body[start_position:] + self.body.append('%s%s\n' % (self.context.pop(), ''.join(text))) + + def visit_option(self, node): + # each form of the option will be presented separately + if self.context[-1] > 0: + self.body.append(', ') + if self.context[-3] == '.BI': + self.body.append('\\') + self.body.append(' ') + + def depart_option(self, node): + self.context[-1] += 1 + + def visit_option_string(self, node): + # do not know if .B or .BI + pass + + def depart_option_string(self, node): + pass + + def visit_option_argument(self, node): + self.context[-3] = '.BI' # bold/italic alternate + if node['delimiter'] != ' ': + self.body.append('\\fB%s ' % node['delimiter']) + elif self.body[len(self.body)-1].endswith('='): + # a blank only means no blank in output, just changing font + self.body.append(' ') + else: + # blank backslash blank, switch font then a blank + self.body.append(' \\ ') + + def depart_option_argument(self, node): + pass + + def visit_organization(self, node): + self.visit_docinfo_item(node, 'organization') + + def depart_organization(self, node): + pass + + def visit_paragraph(self, node): + # ``.PP`` : Start standard indented paragraph. + # ``.LP`` : Start block paragraph, all except the first. + # ``.P [type]`` : Start paragraph type. + # NOTE dont use paragraph starts because they reset indentation. + # ``.sp`` is only vertical space + self.ensure_eol() + self.body.append('.sp\n') + + def depart_paragraph(self, node): + self.body.append('\n') + + def visit_problematic(self, node): + self.body.append(self.defs['problematic'][0]) + + def depart_problematic(self, node): + self.body.append(self.defs['problematic'][1]) + + def visit_raw(self, node): + if node.get('format') == 'manpage': + self.body.append(node.astext() + "\n") + # Keep non-manpage raw text out of output: + raise nodes.SkipNode + + def visit_reference(self, node): + """E.g. link or email address.""" + self.body.append(self.defs['reference'][0]) + + def depart_reference(self, node): + self.body.append(self.defs['reference'][1]) + + def visit_revision(self, node): + self.visit_docinfo_item(node, 'revision') + + depart_revision = depart_docinfo_item + + def visit_row(self, node): + self._active_table.new_row() + + def depart_row(self, node): + pass + + def visit_section(self, node): + self.section_level += 1 + + def depart_section(self, node): + self.section_level -= 1 + + def visit_status(self, node): + self.visit_docinfo_item(node, 'status') + + depart_status = depart_docinfo_item + + def visit_strong(self, node): + self.body.append(self.defs['strong'][0]) + + def depart_strong(self, node): + self.body.append(self.defs['strong'][1]) + + def visit_substitution_definition(self, node): + """Internal only.""" + raise nodes.SkipNode + + def visit_substitution_reference(self, node): + self.document.reporter.warning('"substitution_reference" not supported', + base_node=node) + + def visit_subtitle(self, node): + if isinstance(node.parent, nodes.sidebar): + self.body.append(self.defs['strong'][0]) + elif isinstance(node.parent, nodes.document): + self.visit_docinfo_item(node, 'subtitle') + elif isinstance(node.parent, nodes.section): + self.body.append(self.defs['strong'][0]) + + def depart_subtitle(self, node): + # document subtitle calls SkipNode + self.body.append(self.defs['strong'][1]+'\n.PP\n') + + def visit_system_message(self, node): + # TODO add report_level + #if node['level'] < self.document.reporter['writer'].report_level: + # Level is too low to display: + # raise nodes.SkipNode + attr = {} + backref_text = '' + if node.hasattr('id'): + attr['name'] = node['id'] + if node.hasattr('line'): + line = ', line %s' % node['line'] + else: + line = '' + self.body.append('.IP "System Message: %s/%s (%s:%s)"\n' + % (node['type'], node['level'], node['source'], line)) + + def depart_system_message(self, node): + pass + + def visit_table(self, node): + self._active_table = Table() + + def depart_table(self, node): + self.ensure_eol() + self.body.extend(self._active_table.as_list()) + self._active_table = None + + def visit_target(self, node): + # targets are in-document hyper targets, without any use for man-pages. + raise nodes.SkipNode + + def visit_tbody(self, node): + pass + + def depart_tbody(self, node): + pass + + def visit_term(self, node): + self.body.append(self.defs['term'][0]) + + def depart_term(self, node): + self.body.append(self.defs['term'][1]) + + def visit_tgroup(self, node): + pass + + def depart_tgroup(self, node): + pass + + def visit_thead(self, node): + # MAYBE double line '=' + pass + + def depart_thead(self, node): + # MAYBE double line '=' + pass + + def visit_tip(self, node): + self.visit_admonition(node, 'tip') + + depart_tip = depart_admonition + + def visit_title(self, node): + if isinstance(node.parent, nodes.topic): + self.body.append(self.defs['topic-title'][0]) + elif isinstance(node.parent, nodes.sidebar): + self.body.append(self.defs['sidebar-title'][0]) + elif isinstance(node.parent, nodes.admonition): + self.body.append('.IP "') + elif self.section_level == 0: + self._docinfo['title'] = node.astext() + # document title for .TH + self._docinfo['title_upper'] = node.astext().upper() + raise nodes.SkipNode + elif self.section_level == 1: + self.body.append('.SH ') + for n in node.traverse(nodes.Text): + n.parent.replace(n, nodes.Text(n.astext().upper())) + else: + self.body.append('.SS ') + + def depart_title(self, node): + if isinstance(node.parent, nodes.admonition): + self.body.append('"') + self.body.append('\n') + + def visit_title_reference(self, node): + """inline citation reference""" + self.body.append(self.defs['title_reference'][0]) + + def depart_title_reference(self, node): + self.body.append(self.defs['title_reference'][1]) + + def visit_topic(self, node): + pass + + def depart_topic(self, node): + pass + + def visit_sidebar(self, node): + pass + + def depart_sidebar(self, node): + pass + + def visit_rubric(self, node): + pass + + def depart_rubric(self, node): + pass + + def visit_transition(self, node): + # .PP Begin a new paragraph and reset prevailing indent. + # .sp N leaves N lines of blank space. + # .ce centers the next line + self.body.append('\n.sp\n.ce\n----\n') + + def depart_transition(self, node): + self.body.append('\n.ce 0\n.sp\n') + + def visit_version(self, node): + self.visit_docinfo_item(node, 'version') + + def visit_warning(self, node): + self.visit_admonition(node, 'warning') + + depart_warning = depart_admonition + + def unimplemented_visit(self, node): + raise NotImplementedError('visiting unimplemented node type: %s' + % node.__class__.__name__) + +# vim: set fileencoding=utf-8 et ts=4 ai : diff --git a/doc/hgrc.5 b/doc/hgrc.5 new file mode 100644 index 0000000..8d17bef --- /dev/null +++ b/doc/hgrc.5 @@ -0,0 +1,1793 @@ +.\" Man page generated from reStructeredText. +. +.TH HGRC 5 "" "" "Mercurial Manual" +.SH NAME +hgrc \- configuration files for Mercurial +. +.nr rst2man-indent-level 0 +. +.de1 rstReportMargin +\\$1 \\n[an-margin] +level \\n[rst2man-indent-level] +level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] +- +\\n[rst2man-indent0] +\\n[rst2man-indent1] +\\n[rst2man-indent2] +.. +.de1 INDENT +.\" .rstReportMargin pre: +. RS \\$1 +. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] +. nr rst2man-indent-level +1 +.\" .rstReportMargin post: +.. +.de UNINDENT +. RE +.\" indent \\n[an-margin] +.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] +.nr rst2man-indent-level -1 +.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] +.in \\n[rst2man-indent\\n[rst2man-indent-level]]u +.. +.SH SYNOPSIS +.sp +The Mercurial system uses a set of configuration files to control +aspects of its behavior. +.sp +The configuration files use a simple ini\-file format. A configuration +file consists of sections, led by a \fB[section]\fP header and followed +by \fBname = value\fP entries: +.sp +.nf +.ft C +[ui] +username = Firstname Lastname <firstname.lastname@example.net> +verbose = True +.ft P +.fi +.sp +The above entries will be referred to as \fBui.username\fP and +\fBui.verbose\fP, respectively. See the Syntax section below. +.SH FILES +.sp +Mercurial reads configuration data from several files, if they exist. +These files do not exist by default and you will have to create the +appropriate configuration files yourself: global configuration like +the username setting is typically put into +\fB%USERPROFILE%\emercurial.ini\fP or \fB$HOME/.hgrc\fP and local +configuration is put into the per\-repository \fB<repo>/.hg/hgrc\fP file. +.sp +The names of these files depend on the system on which Mercurial is +installed. \fB*.rc\fP files from a single directory are read in +alphabetical order, later ones overriding earlier ones. Where multiple +paths are given below, settings from earlier paths override later +ones. +.sp +.nf +(All) \fB<repo>/.hg/hgrc\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +.sp +Per\-repository configuration options that only apply in a +particular repository. This file is not version\-controlled, and +will not get transferred during a "clone" operation. Options in +this file override options in all other configuration files. On +Plan 9 and Unix, most of this file will be ignored if it doesn\(aqt +belong to a trusted user or to a trusted group. See the documentation +for the \fB[trusted]\fP section below for more details. +.UNINDENT +.UNINDENT +.sp +.nf +(Plan 9) \fB$home/lib/hgrc\fP +(Unix) \fB$HOME/.hgrc\fP +(Windows) \fB%USERPROFILE%\e.hgrc\fP +(Windows) \fB%USERPROFILE%\eMercurial.ini\fP +(Windows) \fB%HOME%\e.hgrc\fP +(Windows) \fB%HOME%\eMercurial.ini\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +.sp +Per\-user configuration file(s), for the user running Mercurial. On +Windows 9x, \fB%HOME%\fP is replaced by \fB%APPDATA%\fP. Options in these +files apply to all Mercurial commands executed by this user in any +directory. Options in these files override per\-system and per\-installation +options. +.UNINDENT +.UNINDENT +.sp +.nf +(Plan 9) \fB/lib/mercurial/hgrc\fP +(Plan 9) \fB/lib/mercurial/hgrc.d/*.rc\fP +(Unix) \fB/etc/mercurial/hgrc\fP +(Unix) \fB/etc/mercurial/hgrc.d/*.rc\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +.sp +Per\-system configuration files, for the system on which Mercurial +is running. Options in these files apply to all Mercurial commands +executed by any user in any directory. Options in these files +override per\-installation options. +.UNINDENT +.UNINDENT +.sp +.nf +(Plan 9) \fB<install\-root>/lib/mercurial/hgrc\fP +(Plan 9) \fB<install\-root>/lib/mercurial/hgrc.d/*.rc\fP +(Unix) \fB<install\-root>/etc/mercurial/hgrc\fP +(Unix) \fB<install\-root>/etc/mercurial/hgrc.d/*.rc\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +.sp +Per\-installation configuration files, searched for in the +directory where Mercurial is installed. \fB<install\-root>\fP is the +parent directory of the \fBhg\fP executable (or symlink) being run. For +example, if installed in \fB/shared/tools/bin/hg\fP, Mercurial will look +in \fB/shared/tools/etc/mercurial/hgrc\fP. Options in these files apply +to all Mercurial commands executed by any user in any directory. +.UNINDENT +.UNINDENT +.sp +.nf +(Windows) \fB<install\-dir>\eMercurial.ini\fP \fBor\fP +(Windows) \fB<install\-dir>\ehgrc.d\e*.rc\fP \fBor\fP +(Windows) \fBHKEY_LOCAL_MACHINE\eSOFTWARE\eMercurial\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +.sp +Per\-installation/system configuration files, for the system on +which Mercurial is running. Options in these files apply to all +Mercurial commands executed by any user in any directory. Registry +keys contain PATH\-like strings, every part of which must reference +a \fBMercurial.ini\fP file or be a directory where \fB*.rc\fP files will +be read. Mercurial checks each of these locations in the specified +order until one or more configuration files are detected. +.UNINDENT +.UNINDENT +.SH SYNTAX +.sp +A configuration file consists of sections, led by a \fB[section]\fP header +and followed by \fBname = value\fP entries (sometimes called +\fBconfiguration keys\fP): +.sp +.nf +.ft C +[spam] +eggs=ham +green= + eggs +.ft P +.fi +.sp +Each line contains one entry. If the lines that follow are indented, +they are treated as continuations of that entry. Leading whitespace is +removed from values. Empty lines are skipped. Lines beginning with +\fB#\fP or \fB;\fP are ignored and may be used to provide comments. +.sp +Configuration keys can be set multiple times, in which case Mercurial +will use the value that was configured last. As an example: +.sp +.nf +.ft C +[spam] +eggs=large +ham=serrano +eggs=small +.ft P +.fi +.sp +This would set the configuration key named \fBeggs\fP to \fBsmall\fP. +.sp +It is also possible to define a section multiple times. A section can +be redefined on the same and/or on different configuration files. For +example: +.sp +.nf +.ft C +[foo] +eggs=large +ham=serrano +eggs=small + +[bar] +eggs=ham +green= + eggs + +[foo] +ham=prosciutto +eggs=medium +bread=toasted +.ft P +.fi +.sp +This would set the \fBeggs\fP, \fBham\fP, and \fBbread\fP configuration keys +of the \fBfoo\fP section to \fBmedium\fP, \fBprosciutto\fP, and \fBtoasted\fP, +respectively. As you can see there only thing that matters is the last +value that was set for each of the configuration keys. +.sp +If a configuration key is set multiple times in different +configuration files the final value will depend on the order in which +the different configuration files are read, with settings from earlier +paths overriding later ones as described on the \fBFiles\fP section +above. +.sp +A line of the form \fB%include file\fP will include \fBfile\fP into the +current configuration file. The inclusion is recursive, which means +that included files can include other files. Filenames are relative to +the configuration file in which the \fB%include\fP directive is found. +Environment variables and \fB~user\fP constructs are expanded in +\fBfile\fP. This lets you do something like: +.sp +.nf +.ft C +%include ~/.hgrc.d/$HOST.rc +.ft P +.fi +.sp +to include a different configuration file on each computer you use. +.sp +A line with \fB%unset name\fP will remove \fBname\fP from the current +section, if it has been set previously. +.sp +The values are either free\-form text strings, lists of text strings, +or Boolean values. Boolean values can be set to true using any of "1", +"yes", "true", or "on" and to false using "0", "no", "false", or "off" +(all case insensitive). +.sp +List values are separated by whitespace or comma, except when values are +placed in double quotation marks: +.sp +.nf +.ft C +allow_read = "John Doe, PhD", brian, betty +.ft P +.fi +.sp +Quotation marks can be escaped by prefixing them with a backslash. Only +quotation marks at the beginning of a word is counted as a quotation +(e.g., \fBfoo"bar baz\fP is the list of \fBfoo"bar\fP and \fBbaz\fP). +.SH SECTIONS +.sp +This section describes the different sections that may appear in a +Mercurial configuration file, the purpose of each section, its possible +keys, and their possible values. +.SS \fBalias\fP +.sp +Defines command aliases. +Aliases allow you to define your own commands in terms of other +commands (or aliases), optionally including arguments. Positional +arguments in the form of \fB$1\fP, \fB$2\fP, etc in the alias definition +are expanded by Mercurial before execution. Positional arguments not +already used by \fB$N\fP in the definition are put at the end of the +command to be executed. +.sp +Alias definitions consist of lines of the form: +.sp +.nf +.ft C +<alias> = <command> [<argument>]... +.ft P +.fi +.sp +For example, this definition: +.sp +.nf +.ft C +latest = log \-\-limit 5 +.ft P +.fi +.sp +creates a new command \fBlatest\fP that shows only the five most recent +changesets. You can define subsequent aliases using earlier ones: +.sp +.nf +.ft C +stable5 = latest \-b stable +.ft P +.fi +.IP Note +. +It is possible to create aliases with the same names as +existing commands, which will then override the original +definitions. This is almost always a bad idea! +.RE +.sp +An alias can start with an exclamation point (\fB!\fP) to make it a +shell alias. A shell alias is executed with the shell and will let you +run arbitrary commands. As an example, +.sp +.nf +.ft C +echo = !echo $@ +.ft P +.fi +.sp +will let you do \fBhg echo foo\fP to have \fBfoo\fP printed in your +terminal. A better example might be: +.sp +.nf +.ft C +purge = !$HG status \-\-no\-status \-\-unknown \-0 | xargs \-0 rm +.ft P +.fi +.sp +which will make \fBhg purge\fP delete all unknown files in the +repository in the same manner as the purge extension. +.sp +Positional arguments like \fB$1\fP, \fB$2\fP, etc. in the alias definition +expand to the command arguments. Unmatched arguments are +removed. \fB$0\fP expands to the alias name and \fB$@\fP expands to all +arguments separated by a space. These expansions happen before the +command is passed to the shell. +.sp +Shell aliases are executed in an environment where \fB$HG\fP expands to +the path of the Mercurial that was used to execute the alias. This is +useful when you want to call further Mercurial commands in a shell +alias, as was done above for the purge alias. In addition, +\fB$HG_ARGS\fP expands to the arguments given to Mercurial. In the \fBhg +echo foo\fP call above, \fB$HG_ARGS\fP would expand to \fBecho foo\fP. +.IP Note +. +Some global configuration options such as \fB\-R\fP are +processed before shell aliases and will thus not be passed to +aliases. +.RE +.SS \fBannotate\fP +.sp +Settings used when displaying file annotations. All values are +Booleans and default to False. See \fBdiff\fP section for related +options for the diff command. +.INDENT 0.0 +.TP +.B \fBignorews\fP +.sp +Ignore white space when comparing lines. +.TP +.B \fBignorewsamount\fP +.sp +Ignore changes in the amount of white space. +.TP +.B \fBignoreblanklines\fP +.sp +Ignore changes whose lines are all blank. +.UNINDENT +.SS \fBauth\fP +.sp +Authentication credentials for HTTP authentication. This section +allows you to store usernames and passwords for use when logging +\fIinto\fP HTTP servers. See the \fB[web]\fP configuration section if +you want to configure \fIwho\fP can login to your HTTP server. +.sp +Each line has the following format: +.sp +.nf +.ft C +<name>.<argument> = <value> +.ft P +.fi +.sp +where \fB<name>\fP is used to group arguments into authentication +entries. Example: +.sp +.nf +.ft C +foo.prefix = hg.intevation.org/mercurial +foo.username = foo +foo.password = bar +foo.schemes = http https + +bar.prefix = secure.example.org +bar.key = path/to/file.key +bar.cert = path/to/file.cert +bar.schemes = https +.ft P +.fi +.sp +Supported arguments: +.INDENT 0.0 +.TP +.B \fBprefix\fP +.sp +Either \fB*\fP or a URI prefix with or without the scheme part. +The authentication entry with the longest matching prefix is used +(where \fB*\fP matches everything and counts as a match of length +1). If the prefix doesn\(aqt include a scheme, the match is performed +against the URI with its scheme stripped as well, and the schemes +argument, q.v., is then subsequently consulted. +.TP +.B \fBusername\fP +.sp +Optional. Username to authenticate with. If not given, and the +remote site requires basic or digest authentication, the user will +be prompted for it. Environment variables are expanded in the +username letting you do \fBfoo.username = $USER\fP. If the URI +includes a username, only \fB[auth]\fP entries with a matching +username or without a username will be considered. +.TP +.B \fBpassword\fP +.sp +Optional. Password to authenticate with. If not given, and the +remote site requires basic or digest authentication, the user +will be prompted for it. +.TP +.B \fBkey\fP +.sp +Optional. PEM encoded client certificate key file. Environment +variables are expanded in the filename. +.TP +.B \fBcert\fP +.sp +Optional. PEM encoded client certificate chain file. Environment +variables are expanded in the filename. +.TP +.B \fBschemes\fP +.sp +Optional. Space separated list of URI schemes to use this +authentication entry with. Only used if the prefix doesn\(aqt include +a scheme. Supported schemes are http and https. They will match +static\-http and static\-https respectively, as well. +Default: https. +.UNINDENT +.sp +If no suitable authentication entry is found, the user is prompted +for credentials as usual if required by the remote. +.SS \fBdecode/encode\fP +.sp +Filters for transforming files on checkout/checkin. This would +typically be used for newline processing or other +localization/canonicalization of files. +.sp +Filters consist of a filter pattern followed by a filter command. +Filter patterns are globs by default, rooted at the repository root. +For example, to match any file ending in \fB.txt\fP in the root +directory only, use the pattern \fB*.txt\fP. To match any file ending +in \fB.c\fP anywhere in the repository, use the pattern \fB**.c\fP. +For each file only the first matching filter applies. +.sp +The filter command can start with a specifier, either \fBpipe:\fP or +\fBtempfile:\fP. If no specifier is given, \fBpipe:\fP is used by default. +.sp +A \fBpipe:\fP command must accept data on stdin and return the transformed +data on stdout. +.sp +Pipe example: +.sp +.nf +.ft C +[encode] +# uncompress gzip files on checkin to improve delta compression +# note: not necessarily a good idea, just an example +*.gz = pipe: gunzip + +[decode] +# recompress gzip files when writing them to the working dir (we +# can safely omit "pipe:", because it\(aqs the default) +*.gz = gzip +.ft P +.fi +.sp +A \fBtempfile:\fP command is a template. The string \fBINFILE\fP is replaced +with the name of a temporary file that contains the data to be +filtered by the command. The string \fBOUTFILE\fP is replaced with the name +of an empty temporary file, where the filtered data must be written by +the command. +.IP Note +. +The tempfile mechanism is recommended for Windows systems, +where the standard shell I/O redirection operators often have +strange effects and may corrupt the contents of your files. +.RE +.sp +This filter mechanism is used internally by the \fBeol\fP extension to +translate line ending characters between Windows (CRLF) and Unix (LF) +format. We suggest you use the \fBeol\fP extension for convenience. +.SS \fBdefaults\fP +.sp +(defaults are deprecated. Don\(aqt use them. Use aliases instead) +.sp +Use the \fB[defaults]\fP section to define command defaults, i.e. the +default options/arguments to pass to the specified commands. +.sp +The following example makes \%\fBhg log\fP\: run in verbose mode, and +\%\fBhg status\fP\: show only the modified files, by default: +.sp +.nf +.ft C +[defaults] +log = \-v +status = \-m +.ft P +.fi +.sp +The actual commands, instead of their aliases, must be used when +defining command defaults. The command defaults will also be applied +to the aliases of the commands defined. +.SS \fBdiff\fP +.sp +Settings used when displaying diffs. Everything except for \fBunified\fP +is a Boolean and defaults to False. See \fBannotate\fP section for +related options for the annotate command. +.INDENT 0.0 +.TP +.B \fBgit\fP +.sp +Use git extended diff format. +.TP +.B \fBnodates\fP +.sp +Don\(aqt include dates in diff headers. +.TP +.B \fBshowfunc\fP +.sp +Show which function each change is in. +.TP +.B \fBignorews\fP +.sp +Ignore white space when comparing lines. +.TP +.B \fBignorewsamount\fP +.sp +Ignore changes in the amount of white space. +.TP +.B \fBignoreblanklines\fP +.sp +Ignore changes whose lines are all blank. +.TP +.B \fBunified\fP +.sp +Number of lines of context to show. +.UNINDENT +.SS \fBemail\fP +.sp +Settings for extensions that send email messages. +.INDENT 0.0 +.TP +.B \fBfrom\fP +.sp +Optional. Email address to use in "From" header and SMTP envelope +of outgoing messages. +.TP +.B \fBto\fP +.sp +Optional. Comma\-separated list of recipients\(aq email addresses. +.TP +.B \fBcc\fP +.sp +Optional. Comma\-separated list of carbon copy recipients\(aq +email addresses. +.TP +.B \fBbcc\fP +.sp +Optional. Comma\-separated list of blind carbon copy recipients\(aq +email addresses. +.TP +.B \fBmethod\fP +.sp +Optional. Method to use to send email messages. If value is \fBsmtp\fP +(default), use SMTP (see the \fB[smtp]\fP section for configuration). +Otherwise, use as name of program to run that acts like sendmail +(takes \fB\-f\fP option for sender, list of recipients on command line, +message on stdin). Normally, setting this to \fBsendmail\fP or +\fB/usr/sbin/sendmail\fP is enough to use sendmail to send messages. +.TP +.B \fBcharsets\fP +.sp +Optional. Comma\-separated list of character sets considered +convenient for recipients. Addresses, headers, and parts not +containing patches of outgoing messages will be encoded in the +first character set to which conversion from local encoding +(\fB$HGENCODING\fP, \fBui.fallbackencoding\fP) succeeds. If correct +conversion fails, the text in question is sent as is. Defaults to +empty (explicit) list. +.sp +Order of outgoing email character sets: +.INDENT 7.0 +.IP 1. 3 +. +\fBus\-ascii\fP: always first, regardless of settings +.IP 2. 3 +. +\fBemail.charsets\fP: in order given by user +.IP 3. 3 +. +\fBui.fallbackencoding\fP: if not in email.charsets +.IP 4. 3 +. +\fB$HGENCODING\fP: if not in email.charsets +.IP 5. 3 +. +\fButf\-8\fP: always last, regardless of settings +.UNINDENT +.UNINDENT +.sp +Email example: +.sp +.nf +.ft C +[email] +from = Joseph User <joe.user@example.com> +method = /usr/sbin/sendmail +# charsets for western Europeans +# us\-ascii, utf\-8 omitted, as they are tried first and last +charsets = iso\-8859\-1, iso\-8859\-15, windows\-1252 +.ft P +.fi +.SS \fBextensions\fP +.sp +Mercurial has an extension mechanism for adding new features. To +enable an extension, create an entry for it in this section. +.sp +If you know that the extension is already in Python\(aqs search path, +you can give the name of the module, followed by \fB=\fP, with nothing +after the \fB=\fP. +.sp +Otherwise, give a name that you choose, followed by \fB=\fP, followed by +the path to the \fB.py\fP file (including the file name extension) that +defines the extension. +.sp +To explicitly disable an extension that is enabled in an hgrc of +broader scope, prepend its path with \fB!\fP, as in \fBfoo = !/ext/path\fP +or \fBfoo = !\fP when path is not supplied. +.sp +Example for \fB~/.hgrc\fP: +.sp +.nf +.ft C +[extensions] +# (the mq extension will get loaded from Mercurial\(aqs path) +mq = +# (this extension will get loaded from the file specified) +myfeature = ~/.hgext/myfeature.py +.ft P +.fi +.SS \fBformat\fP +.INDENT 0.0 +.TP +.B \fBusestore\fP +.sp +Enable or disable the "store" repository format which improves +compatibility with systems that fold case or otherwise mangle +filenames. Enabled by default. Disabling this option will allow +you to store longer filenames in some situations at the expense of +compatibility and ensures that the on\-disk format of newly created +repositories will be compatible with Mercurial before version 0.9.4. +.TP +.B \fBusefncache\fP +.sp +Enable or disable the "fncache" repository format which enhances +the "store" repository format (which has to be enabled to use +fncache) to allow longer filenames and avoids using Windows +reserved names, e.g. "nul". Enabled by default. Disabling this +option ensures that the on\-disk format of newly created +repositories will be compatible with Mercurial before version 1.1. +.TP +.B \fBdotencode\fP +.sp +Enable or disable the "dotencode" repository format which enhances +the "fncache" repository format (which has to be enabled to use +dotencode) to avoid issues with filenames starting with ._ on +Mac OS X and spaces on Windows. Enabled by default. Disabling this +option ensures that the on\-disk format of newly created +repositories will be compatible with Mercurial before version 1.7. +.UNINDENT +.SS \fBgraph\fP +.sp +Web graph view configuration. This section let you change graph +elements display properties by branches, for instance to make the +\fBdefault\fP branch stand out. +.sp +Each line has the following format: +.sp +.nf +.ft C +<branch>.<argument> = <value> +.ft P +.fi +.sp +where \fB<branch>\fP is the name of the branch being +customized. Example: +.sp +.nf +.ft C +[graph] +# 2px width +default.width = 2 +# red color +default.color = FF0000 +.ft P +.fi +.sp +Supported arguments: +.INDENT 0.0 +.TP +.B \fBwidth\fP +.sp +Set branch edges width in pixels. +.TP +.B \fBcolor\fP +.sp +Set branch edges color in hexadecimal RGB notation. +.UNINDENT +.SS \fBhooks\fP +.sp +Commands or Python functions that get automatically executed by +various actions such as starting or finishing a commit. Multiple +hooks can be run for the same action by appending a suffix to the +action. Overriding a site\-wide hook can be done by changing its +value or setting it to an empty string. Hooks can be prioritized +by adding a prefix of \fBpriority\fP to the hook name on a new line +and setting the priority. The default priority is 0 if +not specified. +.sp +Example \fB.hg/hgrc\fP: +.sp +.nf +.ft C +[hooks] +# update working directory after adding changesets +changegroup.update = hg update +# do not use the site\-wide hook +incoming = +incoming.email = /my/email/hook +incoming.autobuild = /my/build/hook +# force autobuild hook to run before other incoming hooks +priority.incoming.autobuild = 1 +.ft P +.fi +.sp +Most hooks are run with environment variables set that give useful +additional information. For each hook below, the environment +variables it is passed are listed with names of the form \fB$HG_foo\fP. +.INDENT 0.0 +.TP +.B \fBchangegroup\fP +.sp +Run after a changegroup has been added via push, pull or unbundle. +ID of the first new changeset is in \fB$HG_NODE\fP. URL from which +changes came is in \fB$HG_URL\fP. +.TP +.B \fBcommit\fP +.sp +Run after a changeset has been created in the local repository. ID +of the newly created changeset is in \fB$HG_NODE\fP. Parent changeset +IDs are in \fB$HG_PARENT1\fP and \fB$HG_PARENT2\fP. +.TP +.B \fBincoming\fP +.sp +Run after a changeset has been pulled, pushed, or unbundled into +the local repository. The ID of the newly arrived changeset is in +\fB$HG_NODE\fP. URL that was source of changes came is in \fB$HG_URL\fP. +.TP +.B \fBoutgoing\fP +.sp +Run after sending changes from local repository to another. ID of +first changeset sent is in \fB$HG_NODE\fP. Source of operation is in +\fB$HG_SOURCE\fP; see "preoutgoing" hook for description. +.TP +.B \fBpost\-<command>\fP +.sp +Run after successful invocations of the associated command. The +contents of the command line are passed as \fB$HG_ARGS\fP and the result +code in \fB$HG_RESULT\fP. Parsed command line arguments are passed as +\fB$HG_PATS\fP and \fB$HG_OPTS\fP. These contain string representations of +the python data internally passed to <command>. \fB$HG_OPTS\fP is a +dictionary of options (with unspecified options set to their defaults). +\fB$HG_PATS\fP is a list of arguments. Hook failure is ignored. +.TP +.B \fBpre\-<command>\fP +.sp +Run before executing the associated command. The contents of the +command line are passed as \fB$HG_ARGS\fP. Parsed command line arguments +are passed as \fB$HG_PATS\fP and \fB$HG_OPTS\fP. These contain string +representations of the data internally passed to <command>. \fB$HG_OPTS\fP +is a dictionary of options (with unspecified options set to their +defaults). \fB$HG_PATS\fP is a list of arguments. If the hook returns +failure, the command doesn\(aqt execute and Mercurial returns the failure +code. +.TP +.B \fBprechangegroup\fP +.sp +Run before a changegroup is added via push, pull or unbundle. Exit +status 0 allows the changegroup to proceed. Non\-zero status will +cause the push, pull or unbundle to fail. URL from which changes +will come is in \fB$HG_URL\fP. +.TP +.B \fBprecommit\fP +.sp +Run before starting a local commit. Exit status 0 allows the +commit to proceed. Non\-zero status will cause the commit to fail. +Parent changeset IDs are in \fB$HG_PARENT1\fP and \fB$HG_PARENT2\fP. +.TP +.B \fBprelistkeys\fP +.sp +Run before listing pushkeys (like bookmarks) in the +repository. Non\-zero status will cause failure. The key namespace is +in \fB$HG_NAMESPACE\fP. +.TP +.B \fBpreoutgoing\fP +.sp +Run before collecting changes to send from the local repository to +another. Non\-zero status will cause failure. This lets you prevent +pull over HTTP or SSH. Also prevents against local pull, push +(outbound) or bundle commands, but not effective, since you can +just copy files instead then. Source of operation is in +\fB$HG_SOURCE\fP. If "serve", operation is happening on behalf of remote +SSH or HTTP repository. If "push", "pull" or "bundle", operation +is happening on behalf of repository on same system. +.TP +.B \fBprepushkey\fP +.sp +Run before a pushkey (like a bookmark) is added to the +repository. Non\-zero status will cause the key to be rejected. The +key namespace is in \fB$HG_NAMESPACE\fP, the key is in \fB$HG_KEY\fP, +the old value (if any) is in \fB$HG_OLD\fP, and the new value is in +\fB$HG_NEW\fP. +.TP +.B \fBpretag\fP +.sp +Run before creating a tag. Exit status 0 allows the tag to be +created. Non\-zero status will cause the tag to fail. ID of +changeset to tag is in \fB$HG_NODE\fP. Name of tag is in \fB$HG_TAG\fP. Tag is +local if \fB$HG_LOCAL=1\fP, in repository if \fB$HG_LOCAL=0\fP. +.TP +.B \fBpretxnchangegroup\fP +.sp +Run after a changegroup has been added via push, pull or unbundle, +but before the transaction has been committed. Changegroup is +visible to hook program. This lets you validate incoming changes +before accepting them. Passed the ID of the first new changeset in +\fB$HG_NODE\fP. Exit status 0 allows the transaction to commit. Non\-zero +status will cause the transaction to be rolled back and the push, +pull or unbundle will fail. URL that was source of changes is in +\fB$HG_URL\fP. +.TP +.B \fBpretxncommit\fP +.sp +Run after a changeset has been created but the transaction not yet +committed. Changeset is visible to hook program. This lets you +validate commit message and changes. Exit status 0 allows the +commit to proceed. Non\-zero status will cause the transaction to +be rolled back. ID of changeset is in \fB$HG_NODE\fP. Parent changeset +IDs are in \fB$HG_PARENT1\fP and \fB$HG_PARENT2\fP. +.TP +.B \fBpreupdate\fP +.sp +Run before updating the working directory. Exit status 0 allows +the update to proceed. Non\-zero status will prevent the update. +Changeset ID of first new parent is in \fB$HG_PARENT1\fP. If merge, ID +of second new parent is in \fB$HG_PARENT2\fP. +.TP +.B \fBlistkeys\fP +.sp +Run after listing pushkeys (like bookmarks) in the repository. The +key namespace is in \fB$HG_NAMESPACE\fP. \fB$HG_VALUES\fP is a +dictionary containing the keys and values. +.TP +.B \fBpushkey\fP +.sp +Run after a pushkey (like a bookmark) is added to the +repository. The key namespace is in \fB$HG_NAMESPACE\fP, the key is in +\fB$HG_KEY\fP, the old value (if any) is in \fB$HG_OLD\fP, and the new +value is in \fB$HG_NEW\fP. +.TP +.B \fBtag\fP +.sp +Run after a tag is created. ID of tagged changeset is in \fB$HG_NODE\fP. +Name of tag is in \fB$HG_TAG\fP. Tag is local if \fB$HG_LOCAL=1\fP, in +repository if \fB$HG_LOCAL=0\fP. +.TP +.B \fBupdate\fP +.sp +Run after updating the working directory. Changeset ID of first +new parent is in \fB$HG_PARENT1\fP. If merge, ID of second new parent is +in \fB$HG_PARENT2\fP. If the update succeeded, \fB$HG_ERROR=0\fP. If the +update failed (e.g. because conflicts not resolved), \fB$HG_ERROR=1\fP. +.UNINDENT +.IP Note +. +It is generally better to use standard hooks rather than the +generic pre\- and post\- command hooks as they are guaranteed to be +called in the appropriate contexts for influencing transactions. +Also, hooks like "commit" will be called in all contexts that +generate a commit (e.g. tag) and not just the commit command. +.RE +.IP Note +. +Environment variables with empty values may not be passed to +hooks on platforms such as Windows. As an example, \fB$HG_PARENT2\fP +will have an empty value under Unix\-like platforms for non\-merge +changesets, while it will not be available at all under Windows. +.RE +.sp +The syntax for Python hooks is as follows: +.sp +.nf +.ft C +hookname = python:modulename.submodule.callable +hookname = python:/path/to/python/module.py:callable +.ft P +.fi +.sp +Python hooks are run within the Mercurial process. Each hook is +called with at least three keyword arguments: a ui object (keyword +\fBui\fP), a repository object (keyword \fBrepo\fP), and a \fBhooktype\fP +keyword that tells what kind of hook is used. Arguments listed as +environment variables above are passed as keyword arguments, with no +\fBHG_\fP prefix, and names in lower case. +.sp +If a Python hook returns a "true" value or raises an exception, this +is treated as a failure. +.SS \fBhostfingerprints\fP +.sp +Fingerprints of the certificates of known HTTPS servers. +A HTTPS connection to a server with a fingerprint configured here will +only succeed if the servers certificate matches the fingerprint. +This is very similar to how ssh known hosts works. +The fingerprint is the SHA\-1 hash value of the DER encoded certificate. +The CA chain and web.cacerts is not used for servers with a fingerprint. +.sp +For example: +.sp +.nf +.ft C +[hostfingerprints] +hg.intevation.org = 38:76:52:7c:87:26:9a:8f:4a:f8:d3:de:08:45:3b:ea:d6:4b:ee:cc +.ft P +.fi +.sp +This feature is only supported when using Python 2.6 or later. +.SS \fBhttp_proxy\fP +.sp +Used to access web\-based Mercurial repositories through a HTTP +proxy. +.INDENT 0.0 +.TP +.B \fBhost\fP +.sp +Host name and (optional) port of the proxy server, for example +"myproxy:8000". +.TP +.B \fBno\fP +.sp +Optional. Comma\-separated list of host names that should bypass +the proxy. +.TP +.B \fBpasswd\fP +.sp +Optional. Password to authenticate with at the proxy server. +.TP +.B \fBuser\fP +.sp +Optional. User name to authenticate with at the proxy server. +.TP +.B \fBalways\fP +.sp +Optional. Always use the proxy, even for localhost and any entries +in \fBhttp_proxy.no\fP. True or False. Default: False. +.UNINDENT +.SS \fBmerge\-patterns\fP +.sp +This section specifies merge tools to associate with particular file +patterns. Tools matched here will take precedence over the default +merge tool. Patterns are globs by default, rooted at the repository +root. +.sp +Example: +.sp +.nf +.ft C +[merge\-patterns] +**.c = kdiff3 +**.jpg = myimgmerge +.ft P +.fi +.SS \fBmerge\-tools\fP +.sp +This section configures external merge tools to use for file\-level +merges. +.sp +Example \fB~/.hgrc\fP: +.sp +.nf +.ft C +[merge\-tools] +# Override stock tool location +kdiff3.executable = ~/bin/kdiff3 +# Specify command line +kdiff3.args = $base $local $other \-o $output +# Give higher priority +kdiff3.priority = 1 + +# Define new tool +myHtmlTool.args = \-m $local $other $base $output +myHtmlTool.regkey = Software\eFooSoftware\eHtmlMerge +myHtmlTool.priority = 1 +.ft P +.fi +.sp +Supported arguments: +.INDENT 0.0 +.TP +.B \fBpriority\fP +.sp +The priority in which to evaluate this tool. +Default: 0. +.TP +.B \fBexecutable\fP +.sp +Either just the name of the executable or its pathname. On Windows, +the path can use environment variables with ${ProgramFiles} syntax. +Default: the tool name. +.TP +.B \fBargs\fP +.sp +The arguments to pass to the tool executable. You can refer to the +files being merged as well as the output file through these +variables: \fB$base\fP, \fB$local\fP, \fB$other\fP, \fB$output\fP. +Default: \fB$local $base $other\fP +.TP +.B \fBpremerge\fP +.sp +Attempt to run internal non\-interactive 3\-way merge tool before +launching external tool. Options are \fBtrue\fP, \fBfalse\fP, or \fBkeep\fP +to leave markers in the file if the premerge fails. +Default: True +.TP +.B \fBbinary\fP +.sp +This tool can merge binary files. Defaults to False, unless tool +was selected by file pattern match. +.TP +.B \fBsymlink\fP +.sp +This tool can merge symlinks. Defaults to False, even if tool was +selected by file pattern match. +.TP +.B \fBcheck\fP +.sp +A list of merge success\-checking options: +.INDENT 7.0 +.TP +.B \fBchanged\fP +.sp +Ask whether merge was successful when the merged file shows no changes. +.TP +.B \fBconflicts\fP +.sp +Check whether there are conflicts even though the tool reported success. +.TP +.B \fBprompt\fP +.sp +Always prompt for merge success, regardless of success reported by tool. +.UNINDENT +.TP +.B \fBcheckchanged\fP +.sp +True is equivalent to \fBcheck = changed\fP. +Default: False +.TP +.B \fBcheckconflicts\fP +.sp +True is equivalent to \fBcheck = conflicts\fP. +Default: False +.TP +.B \fBfixeol\fP +.sp +Attempt to fix up EOL changes caused by the merge tool. +Default: False +.TP +.B \fBgui\fP +.sp +This tool requires a graphical interface to run. Default: False +.TP +.B \fBregkey\fP +.sp +Windows registry key which describes install location of this +tool. Mercurial will search for this key first under +\fBHKEY_CURRENT_USER\fP and then under \fBHKEY_LOCAL_MACHINE\fP. +Default: None +.TP +.B \fBregkeyalt\fP +.sp +An alternate Windows registry key to try if the first key is not +found. The alternate key uses the same \fBregname\fP and \fBregappend\fP +semantics of the primary key. The most common use for this key +is to search for 32bit applications on 64bit operating systems. +Default: None +.TP +.B \fBregname\fP +.sp +Name of value to read from specified registry key. Defaults to the +unnamed (default) value. +.TP +.B \fBregappend\fP +.sp +String to append to the value read from the registry, typically +the executable name of the tool. +Default: None +.UNINDENT +.SS \fBpatch\fP +.sp +Settings used when applying patches, for instance through the \(aqimport\(aq +command or with Mercurial Queues extension. +.INDENT 0.0 +.TP +.B \fBeol\fP +.sp +When set to \(aqstrict\(aq patch content and patched files end of lines +are preserved. When set to \fBlf\fP or \fBcrlf\fP, both files end of +lines are ignored when patching and the result line endings are +normalized to either LF (Unix) or CRLF (Windows). When set to +\fBauto\fP, end of lines are again ignored while patching but line +endings in patched files are normalized to their original setting +on a per\-file basis. If target file does not exist or has no end +of line, patch line endings are preserved. +Default: strict. +.UNINDENT +.SS \fBpaths\fP +.sp +Assigns symbolic names to repositories. The left side is the +symbolic name, and the right gives the directory or URL that is the +location of the repository. Default paths can be declared by setting +the following entries. +.INDENT 0.0 +.TP +.B \fBdefault\fP +.sp +Directory or URL to use when pulling if no source is specified. +Default is set to repository from which the current repository was +cloned. +.TP +.B \fBdefault\-push\fP +.sp +Optional. Directory or URL to use when pushing if no destination +is specified. +.UNINDENT +.SS \fBphases\fP +.sp +Specifies default handling of phases. See \%\fBhg help phases\fP\: for more +information about working with phases. +.INDENT 0.0 +.TP +.B \fBpublish\fP +.sp +Controls draft phase behavior when working as a server. When true, +pushed changesets are set to public in both client and server and +pulled or cloned changesets are set to public in the client. +Default: True +.TP +.B \fBnew\-commit\fP +.sp +Phase of newly\-created commits. +Default: draft +.UNINDENT +.SS \fBprofiling\fP +.sp +Specifies profiling type, format, and file output. Two profilers are +supported: an instrumenting profiler (named \fBls\fP), and a sampling +profiler (named \fBstat\fP). +.sp +In this section description, \(aqprofiling data\(aq stands for the raw data +collected during profiling, while \(aqprofiling report\(aq stands for a +statistical text report generated from the profiling data. The +profiling is done using lsprof. +.INDENT 0.0 +.TP +.B \fBtype\fP +.sp +The type of profiler to use. +Default: ls. +.INDENT 7.0 +.TP +.B \fBls\fP +.sp +Use Python\(aqs built\-in instrumenting profiler. This profiler +works on all platforms, but each line number it reports is the +first line of a function. This restriction makes it difficult to +identify the expensive parts of a non\-trivial function. +.TP +.B \fBstat\fP +.sp +Use a third\-party statistical profiler, statprof. This profiler +currently runs only on Unix systems, and is most useful for +profiling commands that run for longer than about 0.1 seconds. +.UNINDENT +.TP +.B \fBformat\fP +.sp +Profiling format. Specific to the \fBls\fP instrumenting profiler. +Default: text. +.INDENT 7.0 +.TP +.B \fBtext\fP +.sp +Generate a profiling report. When saving to a file, it should be +noted that only the report is saved, and the profiling data is +not kept. +.TP +.B \fBkcachegrind\fP +.sp +Format profiling data for kcachegrind use: when saving to a +file, the generated file can directly be loaded into +kcachegrind. +.UNINDENT +.TP +.B \fBfrequency\fP +.sp +Sampling frequency. Specific to the \fBstat\fP sampling profiler. +Default: 1000. +.TP +.B \fBoutput\fP +.sp +File path where profiling data or report should be saved. If the +file exists, it is replaced. Default: None, data is printed on +stderr +.UNINDENT +.SS \fBrevsetalias\fP +.sp +Alias definitions for revsets. See \%\fBhg help revsets\fP\: for details. +.SS \fBserver\fP +.sp +Controls generic server settings. +.INDENT 0.0 +.TP +.B \fBuncompressed\fP +.sp +Whether to allow clients to clone a repository using the +uncompressed streaming protocol. This transfers about 40% more +data than a regular clone, but uses less memory and CPU on both +server and client. Over a LAN (100 Mbps or better) or a very fast +WAN, an uncompressed streaming clone is a lot faster (~10x) than a +regular clone. Over most WAN connections (anything slower than +about 6 Mbps), uncompressed streaming is slower, because of the +extra data transfer overhead. This mode will also temporarily hold +the write lock while determining what data to transfer. +Default is True. +.TP +.B \fBpreferuncompressed\fP +.sp +When set, clients will try to use the uncompressed streaming +protocol. Default is False. +.TP +.B \fBvalidate\fP +.sp +Whether to validate the completeness of pushed changesets by +checking that all new file revisions specified in manifests are +present. Default is False. +.UNINDENT +.SS \fBsmtp\fP +.sp +Configuration for extensions that need to send email messages. +.INDENT 0.0 +.TP +.B \fBhost\fP +.sp +Host name of mail server, e.g. "mail.example.com". +.TP +.B \fBport\fP +.sp +Optional. Port to connect to on mail server. Default: 25. +.TP +.B \fBtls\fP +.sp +Optional. Method to enable TLS when connecting to mail server: starttls, +smtps or none. Default: none. +.TP +.B \fBusername\fP +.sp +Optional. User name for authenticating with the SMTP server. +Default: none. +.TP +.B \fBpassword\fP +.sp +Optional. Password for authenticating with the SMTP server. If not +specified, interactive sessions will prompt the user for a +password; non\-interactive sessions will fail. Default: none. +.TP +.B \fBlocal_hostname\fP +.sp +Optional. It\(aqs the hostname that the sender can use to identify +itself to the MTA. +.UNINDENT +.SS \fBsubpaths\fP +.sp +Subrepository source URLs can go stale if a remote server changes name +or becomes temporarily unavailable. This section lets you define +rewrite rules of the form: +.sp +.nf +.ft C +<pattern> = <replacement> +.ft P +.fi +.sp +where \fBpattern\fP is a regular expression matching a subrepository +source URL and \fBreplacement\fP is the replacement string used to +rewrite it. Groups can be matched in \fBpattern\fP and referenced in +\fBreplacements\fP. For instance: +.sp +.nf +.ft C +http://server/(.*)\-hg/ = http://hg.server/\e1/ +.ft P +.fi +.sp +rewrites \fBhttp://server/foo\-hg/\fP into \fBhttp://hg.server/foo/\fP. +.sp +Relative subrepository paths are first made absolute, and the +rewrite rules are then applied on the full (absolute) path. The rules +are applied in definition order. +.SS \fBtrusted\fP +.sp +Mercurial will not use the settings in the +\fB.hg/hgrc\fP file from a repository if it doesn\(aqt belong to a trusted +user or to a trusted group, as various hgrc features allow arbitrary +commands to be run. This issue is often encountered when configuring +hooks or extensions for shared repositories or servers. However, +the web interface will use some safe settings from the \fB[web]\fP +section. +.sp +This section specifies what users and groups are trusted. The +current user is always trusted. To trust everybody, list a user or a +group with name \fB*\fP. These settings must be placed in an +\fIalready\-trusted file\fP to take effect, such as \fB$HOME/.hgrc\fP of the +user or service running Mercurial. +.INDENT 0.0 +.TP +.B \fBusers\fP +.sp +Comma\-separated list of trusted users. +.TP +.B \fBgroups\fP +.sp +Comma\-separated list of trusted groups. +.UNINDENT +.SS \fBui\fP +.sp +User interface controls. +.INDENT 0.0 +.TP +.B \fBarchivemeta\fP +.sp +Whether to include the .hg_archival.txt file containing meta data +(hashes for the repository base and for tip) in archives created +by the \%\fBhg archive\fP\: command or downloaded via hgweb. +Default is True. +.TP +.B \fBaskusername\fP +.sp +Whether to prompt for a username when committing. If True, and +neither \fB$HGUSER\fP nor \fB$EMAIL\fP has been specified, then the user will +be prompted to enter a username. If no username is entered, the +default \fBUSER@HOST\fP is used instead. +Default is False. +.TP +.B \fBcommitsubrepos\fP +.sp +Whether to commit modified subrepositories when committing the +parent repository. If False and one subrepository has uncommitted +changes, abort the commit. +Default is False. +.TP +.B \fBdebug\fP +.sp +Print debugging information. True or False. Default is False. +.TP +.B \fBeditor\fP +.sp +The editor to use during a commit. Default is \fB$EDITOR\fP or \fBvi\fP. +.TP +.B \fBfallbackencoding\fP +.sp +Encoding to try if it\(aqs not possible to decode the changelog using +UTF\-8. Default is ISO\-8859\-1. +.TP +.B \fBignore\fP +.sp +A file to read per\-user ignore patterns from. This file should be +in the same format as a repository\-wide .hgignore file. This +option supports hook syntax, so if you want to specify multiple +ignore files, you can do so by setting something like +\fBignore.other = ~/.hgignore2\fP. For details of the ignore file +format, see the \fBhgignore(5)\fP man page. +.TP +.B \fBinteractive\fP +.sp +Allow to prompt the user. True or False. Default is True. +.TP +.B \fBlogtemplate\fP +.sp +Template string for commands that print changesets. +.TP +.B \fBmerge\fP +.sp +The conflict resolution program to use during a manual merge. +For more information on merge tools see \%\fBhg help merge\-tools\fP\:. +For configuring merge tools see the \fB[merge\-tools]\fP section. +.TP +.B \fBportablefilenames\fP +.sp +Check for portable filenames. Can be \fBwarn\fP, \fBignore\fP or \fBabort\fP. +Default is \fBwarn\fP. +If set to \fBwarn\fP (or \fBtrue\fP), a warning message is printed on POSIX +platforms, if a file with a non\-portable filename is added (e.g. a file +with a name that can\(aqt be created on Windows because it contains reserved +parts like \fBAUX\fP, reserved characters like \fB:\fP, or would cause a case +collision with an existing file). +If set to \fBignore\fP (or \fBfalse\fP), no warning is printed. +If set to \fBabort\fP, the command is aborted. +On Windows, this configuration option is ignored and the command aborted. +.TP +.B \fBquiet\fP +.sp +Reduce the amount of output printed. True or False. Default is False. +.TP +.B \fBremotecmd\fP +.sp +remote command to use for clone/push/pull operations. Default is \fBhg\fP. +.TP +.B \fBreportoldssl\fP +.sp +Warn if an SSL certificate is unable to be due to using Python +2.5 or earlier. True or False. Default is True. +.TP +.B \fBreport_untrusted\fP +.sp +Warn if a \fB.hg/hgrc\fP file is ignored due to not being owned by a +trusted user or group. True or False. Default is True. +.TP +.B \fBslash\fP +.sp +Display paths using a slash (\fB/\fP) as the path separator. This +only makes a difference on systems where the default path +separator is not the slash character (e.g. Windows uses the +backslash character (\fB\e\fP)). +Default is False. +.TP +.B \fBssh\fP +.sp +command to use for SSH connections. Default is \fBssh\fP. +.TP +.B \fBstrict\fP +.sp +Require exact command names, instead of allowing unambiguous +abbreviations. True or False. Default is False. +.TP +.B \fBstyle\fP +.sp +Name of style to use for command output. +.TP +.B \fBtimeout\fP +.sp +The timeout used when a lock is held (in seconds), a negative value +means no timeout. Default is 600. +.TP +.B \fBtraceback\fP +.sp +Mercurial always prints a traceback when an unknown exception +occurs. Setting this to True will make Mercurial print a traceback +on all exceptions, even those recognized by Mercurial (such as +IOError or MemoryError). Default is False. +.TP +.B \fBusername\fP +.sp +The committer of a changeset created when running "commit". +Typically a person\(aqs name and email address, e.g. \fBFred Widget +<fred@example.com>\fP. Default is \fB$EMAIL\fP or \fBusername@hostname\fP. If +the username in hgrc is empty, it has to be specified manually or +in a different hgrc file (e.g. \fB$HOME/.hgrc\fP, if the admin set +\fBusername =\fP in the system hgrc). Environment variables in the +username are expanded. +.TP +.B \fBverbose\fP +.sp +Increase the amount of output printed. True or False. Default is False. +.UNINDENT +.SS \fBweb\fP +.sp +Web interface configuration. The settings in this section apply to +both the builtin webserver (started by \%\fBhg serve\fP\:) and the script you +run through a webserver (\fBhgweb.cgi\fP and the derivatives for FastCGI +and WSGI). +.sp +The Mercurial webserver does no authentication (it does not prompt for +usernames and passwords to validate \fIwho\fP users are), but it does do +authorization (it grants or denies access for \fIauthenticated users\fP +based on settings in this section). You must either configure your +webserver to do authentication for you, or disable the authorization +checks. +.sp +For a quick setup in a trusted environment, e.g., a private LAN, where +you want it to accept pushes from anybody, you can use the following +command line: +.sp +.nf +.ft C +$ hg \-\-config web.allow_push=* \-\-config web.push_ssl=False serve +.ft P +.fi +.sp +Note that this will allow anybody to push anything to the server and +that this should not be used for public servers. +.sp +The full set of options is: +.INDENT 0.0 +.TP +.B \fBaccesslog\fP +.sp +Where to output the access log. Default is stdout. +.TP +.B \fBaddress\fP +.sp +Interface address to bind to. Default is all. +.TP +.B \fBallow_archive\fP +.sp +List of archive format (bz2, gz, zip) allowed for downloading. +Default is empty. +.TP +.B \fBallowbz2\fP +.sp +(DEPRECATED) Whether to allow .tar.bz2 downloading of repository +revisions. +Default is False. +.TP +.B \fBallowgz\fP +.sp +(DEPRECATED) Whether to allow .tar.gz downloading of repository +revisions. +Default is False. +.TP +.B \fBallowpull\fP +.sp +Whether to allow pulling from the repository. Default is True. +.TP +.B \fBallow_push\fP +.sp +Whether to allow pushing to the repository. If empty or not set, +push is not allowed. If the special value \fB*\fP, any remote user can +push, including unauthenticated users. Otherwise, the remote user +must have been authenticated, and the authenticated user name must +be present in this list. The contents of the allow_push list are +examined after the deny_push list. +.TP +.B \fBallow_read\fP +.sp +If the user has not already been denied repository access due to +the contents of deny_read, this list determines whether to grant +repository access to the user. If this list is not empty, and the +user is unauthenticated or not present in the list, then access is +denied for the user. If the list is empty or not set, then access +is permitted to all users by default. Setting allow_read to the +special value \fB*\fP is equivalent to it not being set (i.e. access +is permitted to all users). The contents of the allow_read list are +examined after the deny_read list. +.TP +.B \fBallowzip\fP +.sp +(DEPRECATED) Whether to allow .zip downloading of repository +revisions. Default is False. This feature creates temporary files. +.TP +.B \fBbaseurl\fP +.sp +Base URL to use when publishing URLs in other locations, so +third\-party tools like email notification hooks can construct +URLs. Example: \fBhttp://hgserver/repos/\fP. +.TP +.B \fBcacerts\fP +.sp +Path to file containing a list of PEM encoded certificate +authority certificates. Environment variables and \fB~user\fP +constructs are expanded in the filename. If specified on the +client, then it will verify the identity of remote HTTPS servers +with these certificates. +.sp +This feature is only supported when using Python 2.6 or later. If you wish +to use it with earlier versions of Python, install the backported +version of the ssl library that is available from +\fBhttp://pypi.python.org\fP. +.sp +To disable SSL verification temporarily, specify \fB\-\-insecure\fP from +command line. +.sp +You can use OpenSSL\(aqs CA certificate file if your platform has +one. On most Linux systems this will be +\fB/etc/ssl/certs/ca\-certificates.crt\fP. Otherwise you will have to +generate this file manually. The form must be as follows: +.sp +.nf +.ft C +\-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\- +\&... (certificate in base64 PEM encoding) ... +\-\-\-\-\-END CERTIFICATE\-\-\-\-\- +\-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\- +\&... (certificate in base64 PEM encoding) ... +\-\-\-\-\-END CERTIFICATE\-\-\-\-\- +.ft P +.fi +.TP +.B \fBcache\fP +.sp +Whether to support caching in hgweb. Defaults to True. +.TP +.B \fBcollapse\fP +.sp +With \fBdescend\fP enabled, repositories in subdirectories are shown at +a single level alongside repositories in the current path. With +\fBcollapse\fP also enabled, repositories residing at a deeper level than +the current path are grouped behind navigable directory entries that +lead to the locations of these repositories. In effect, this setting +collapses each collection of repositories found within a subdirectory +into a single entry for that subdirectory. Default is False. +.TP +.B \fBcomparisoncontext\fP +.sp +Number of lines of context to show in side\-by\-side file comparison. If +negative or the value \fBfull\fP, whole files are shown. Default is 5. +This setting can be overridden by a \fBcontext\fP request parameter to the +\fBcomparison\fP command, taking the same values. +.TP +.B \fBcontact\fP +.sp +Name or email address of the person in charge of the repository. +Defaults to ui.username or \fB$EMAIL\fP or "unknown" if unset or empty. +.TP +.B \fBdeny_push\fP +.sp +Whether to deny pushing to the repository. If empty or not set, +push is not denied. If the special value \fB*\fP, all remote users are +denied push. Otherwise, unauthenticated users are all denied, and +any authenticated user name present in this list is also denied. The +contents of the deny_push list are examined before the allow_push list. +.TP +.B \fBdeny_read\fP +.sp +Whether to deny reading/viewing of the repository. If this list is +not empty, unauthenticated users are all denied, and any +authenticated user name present in this list is also denied access to +the repository. If set to the special value \fB*\fP, all remote users +are denied access (rarely needed ;). If deny_read is empty or not set, +the determination of repository access depends on the presence and +content of the allow_read list (see description). If both +deny_read and allow_read are empty or not set, then access is +permitted to all users by default. If the repository is being +served via hgwebdir, denied users will not be able to see it in +the list of repositories. The contents of the deny_read list have +priority over (are examined before) the contents of the allow_read +list. +.TP +.B \fBdescend\fP +.sp +hgwebdir indexes will not descend into subdirectories. Only repositories +directly in the current path will be shown (other repositories are still +available from the index corresponding to their containing path). +.TP +.B \fBdescription\fP +.sp +Textual description of the repository\(aqs purpose or contents. +Default is "unknown". +.TP +.B \fBencoding\fP +.sp +Character encoding name. Default is the current locale charset. +Example: "UTF\-8" +.TP +.B \fBerrorlog\fP +.sp +Where to output the error log. Default is stderr. +.TP +.B \fBguessmime\fP +.sp +Control MIME types for raw download of file content. +Set to True to let hgweb guess the content type from the file +extension. This will serve HTML files as \fBtext/html\fP and might +allow cross\-site scripting attacks when serving untrusted +repositories. Default is False. +.TP +.B \fBhidden\fP +.sp +Whether to hide the repository in the hgwebdir index. +Default is False. +.TP +.B \fBipv6\fP +.sp +Whether to use IPv6. Default is False. +.TP +.B \fBlogoimg\fP +.sp +File name of the logo image that some templates display on each page. +The file name is relative to \fBstaticurl\fP. That is, the full path to +the logo image is "staticurl/logoimg". +If unset, \fBhglogo.png\fP will be used. +.TP +.B \fBlogourl\fP +.sp +Base URL to use for logos. If unset, \fBhttp://mercurial.selenic.com/\fP +will be used. +.TP +.B \fBmaxchanges\fP +.sp +Maximum number of changes to list on the changelog. Default is 10. +.TP +.B \fBmaxfiles\fP +.sp +Maximum number of files to list per changeset. Default is 10. +.TP +.B \fBmaxshortchanges\fP +.sp +Maximum number of changes to list on the shortlog, graph or filelog +pages. Default is 60. +.TP +.B \fBname\fP +.sp +Repository name to use in the web interface. Default is current +working directory. +.TP +.B \fBport\fP +.sp +Port to listen on. Default is 8000. +.TP +.B \fBprefix\fP +.sp +Prefix path to serve from. Default is \(aq\(aq (server root). +.TP +.B \fBpush_ssl\fP +.sp +Whether to require that inbound pushes be transported over SSL to +prevent password sniffing. Default is True. +.TP +.B \fBstaticurl\fP +.sp +Base URL to use for static files. If unset, static files (e.g. the +hgicon.png favicon) will be served by the CGI script itself. Use +this setting to serve them directly with the HTTP server. +Example: \fBhttp://hgserver/static/\fP. +.TP +.B \fBstripes\fP +.sp +How many lines a "zebra stripe" should span in multiline output. +Default is 1; set to 0 to disable. +.TP +.B \fBstyle\fP +.sp +Which template map style to use. +.TP +.B \fBtemplates\fP +.sp +Where to find the HTML templates. Default is install path. +.UNINDENT +.SH AUTHOR +.sp +Bryan O\(aqSullivan <\%bos@serpentine.com\:>. +.sp +Mercurial was written by Matt Mackall <\%mpm@selenic.com\:>. +.SH SEE ALSO +.sp +\%\fBhg\fP(1)\:, \%\fBhgignore\fP(5)\: +.SH COPYING +.sp +This manual page is copyright 2005 Bryan O\(aqSullivan. +Mercurial is copyright 2005\-2012 Matt Mackall. +Free use of this software is granted under the terms of the GNU General +Public License version 2 or any later version. +.\" Common link and substitution definitions. +. +.SH AUTHOR +Bryan O'Sullivan <bos@serpentine.com> + +Organization: Mercurial +.\" Generated by docutils manpage writer. +.\" +. diff --git a/doc/hgrc.5.html b/doc/hgrc.5.html new file mode 100644 index 0000000..c9c0222 --- /dev/null +++ b/doc/hgrc.5.html @@ -0,0 +1,1366 @@ +<?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.8.1: http://docutils.sourceforge.net/" /> +<title>hgrc</title> +<meta name="author" content="Bryan O'Sullivan <bos@serpentine.com>" /> +<meta name="organization" content="Mercurial" /> +<link rel="stylesheet" href="style.css" type="text/css" /> +</head> +<body> +<div class="document" id="hgrc"> +<h1 class="title">hgrc</h1> +<h2 class="subtitle" id="configuration-files-for-mercurial">configuration files for Mercurial</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>Bryan O'Sullivan <<a class="reference external" href="mailto:bos@serpentine.com">bos@serpentine.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">5</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="id1">Synopsis</a></li> +<li><a class="reference internal" href="#files" id="id2">Files</a></li> +<li><a class="reference internal" href="#syntax" id="id3">Syntax</a></li> +<li><a class="reference internal" href="#sections" id="id4">Sections</a><ul> +<li><a class="reference internal" href="#alias" id="id5"><tt class="docutils literal">alias</tt></a></li> +<li><a class="reference internal" href="#annotate" id="id6"><tt class="docutils literal">annotate</tt></a></li> +<li><a class="reference internal" href="#auth" id="id7"><tt class="docutils literal">auth</tt></a></li> +<li><a class="reference internal" href="#decode-encode" id="id8"><tt class="docutils literal">decode/encode</tt></a></li> +<li><a class="reference internal" href="#defaults" id="id9"><tt class="docutils literal">defaults</tt></a></li> +<li><a class="reference internal" href="#diff" id="id10"><tt class="docutils literal">diff</tt></a></li> +<li><a class="reference internal" href="#email" id="id11"><tt class="docutils literal">email</tt></a></li> +<li><a class="reference internal" href="#extensions" id="id12"><tt class="docutils literal">extensions</tt></a></li> +<li><a class="reference internal" href="#format" id="id13"><tt class="docutils literal">format</tt></a></li> +<li><a class="reference internal" href="#graph" id="id14"><tt class="docutils literal">graph</tt></a></li> +<li><a class="reference internal" href="#hooks" id="id15"><tt class="docutils literal">hooks</tt></a></li> +<li><a class="reference internal" href="#hostfingerprints" id="id16"><tt class="docutils literal">hostfingerprints</tt></a></li> +<li><a class="reference internal" href="#http-proxy" id="id17"><tt class="docutils literal">http_proxy</tt></a></li> +<li><a class="reference internal" href="#merge-patterns" id="id18"><tt class="docutils literal"><span class="pre">merge-patterns</span></tt></a></li> +<li><a class="reference internal" href="#merge-tools" id="id19"><tt class="docutils literal"><span class="pre">merge-tools</span></tt></a></li> +<li><a class="reference internal" href="#patch" id="id20"><tt class="docutils literal">patch</tt></a></li> +<li><a class="reference internal" href="#paths" id="id21"><tt class="docutils literal">paths</tt></a></li> +<li><a class="reference internal" href="#phases" id="id22"><tt class="docutils literal">phases</tt></a></li> +<li><a class="reference internal" href="#profiling" id="id23"><tt class="docutils literal">profiling</tt></a></li> +<li><a class="reference internal" href="#revsetalias" id="id24"><tt class="docutils literal">revsetalias</tt></a></li> +<li><a class="reference internal" href="#server" id="id25"><tt class="docutils literal">server</tt></a></li> +<li><a class="reference internal" href="#smtp" id="id26"><tt class="docutils literal">smtp</tt></a></li> +<li><a class="reference internal" href="#subpaths" id="id27"><tt class="docutils literal">subpaths</tt></a></li> +<li><a class="reference internal" href="#trusted" id="id28"><tt class="docutils literal">trusted</tt></a></li> +<li><a class="reference internal" href="#ui" id="id29"><tt class="docutils literal">ui</tt></a></li> +<li><a class="reference internal" href="#web" id="id30"><tt class="docutils literal">web</tt></a></li> +</ul> +</li> +<li><a class="reference internal" href="#author" id="id31">Author</a></li> +<li><a class="reference internal" href="#see-also" id="id32">See Also</a></li> +<li><a class="reference internal" href="#copying" id="id33">Copying</a></li> +</ul> +</div> +<div class="section" id="synopsis"> +<h1><a class="toc-backref" href="#contents">Synopsis</a></h1> +<p>The Mercurial system uses a set of configuration files to control +aspects of its behavior.</p> +<p>The configuration files use a simple ini-file format. A configuration +file consists of sections, led by a <tt class="docutils literal">[section]</tt> header and followed +by <tt class="docutils literal">name = value</tt> entries:</p> +<pre class="literal-block"> +[ui] +username = Firstname Lastname <firstname.lastname@example.net> +verbose = True +</pre> +<p>The above entries will be referred to as <tt class="docutils literal">ui.username</tt> and +<tt class="docutils literal">ui.verbose</tt>, respectively. See the Syntax section below.</p> +</div> +<div class="section" id="files"> +<h1><a class="toc-backref" href="#contents">Files</a></h1> +<p>Mercurial reads configuration data from several files, if they exist. +These files do not exist by default and you will have to create the +appropriate configuration files yourself: global configuration like +the username setting is typically put into +<tt class="docutils literal"><span class="pre">%USERPROFILE%\mercurial.ini</span></tt> or <tt class="docutils literal"><span class="pre">$HOME/.hgrc</span></tt> and local +configuration is put into the per-repository <tt class="docutils literal"><span class="pre"><repo>/.hg/hgrc</span></tt> file.</p> +<p>The names of these files depend on the system on which Mercurial is +installed. <tt class="docutils literal">*.rc</tt> files from a single directory are read in +alphabetical order, later ones overriding earlier ones. Where multiple +paths are given below, settings from earlier paths override later +ones.</p> +<div class="line-block"> +<div class="line">(All) <tt class="docutils literal"><span class="pre"><repo>/.hg/hgrc</span></tt></div> +</div> +<blockquote> +Per-repository configuration options that only apply in a +particular repository. This file is not version-controlled, and +will not get transferred during a "clone" operation. Options in +this file override options in all other configuration files. On +Plan 9 and Unix, most of this file will be ignored if it doesn't +belong to a trusted user or to a trusted group. See the documentation +for the <tt class="docutils literal">[trusted]</tt> section below for more details.</blockquote> +<div class="line-block"> +<div class="line">(Plan 9) <tt class="docutils literal">$home/lib/hgrc</tt></div> +<div class="line">(Unix) <tt class="docutils literal"><span class="pre">$HOME/.hgrc</span></tt></div> +<div class="line">(Windows) <tt class="docutils literal"><span class="pre">%USERPROFILE%\.hgrc</span></tt></div> +<div class="line">(Windows) <tt class="docutils literal"><span class="pre">%USERPROFILE%\Mercurial.ini</span></tt></div> +<div class="line">(Windows) <tt class="docutils literal"><span class="pre">%HOME%\.hgrc</span></tt></div> +<div class="line">(Windows) <tt class="docutils literal"><span class="pre">%HOME%\Mercurial.ini</span></tt></div> +</div> +<blockquote> +Per-user configuration file(s), for the user running Mercurial. On +Windows 9x, <tt class="docutils literal">%HOME%</tt> is replaced by <tt class="docutils literal">%APPDATA%</tt>. Options in these +files apply to all Mercurial commands executed by this user in any +directory. Options in these files override per-system and per-installation +options.</blockquote> +<div class="line-block"> +<div class="line">(Plan 9) <tt class="docutils literal">/lib/mercurial/hgrc</tt></div> +<div class="line">(Plan 9) <tt class="docutils literal"><span class="pre">/lib/mercurial/hgrc.d/*.rc</span></tt></div> +<div class="line">(Unix) <tt class="docutils literal">/etc/mercurial/hgrc</tt></div> +<div class="line">(Unix) <tt class="docutils literal"><span class="pre">/etc/mercurial/hgrc.d/*.rc</span></tt></div> +</div> +<blockquote> +Per-system configuration files, for the system on which Mercurial +is running. Options in these files apply to all Mercurial commands +executed by any user in any directory. Options in these files +override per-installation options.</blockquote> +<div class="line-block"> +<div class="line">(Plan 9) <tt class="docutils literal"><span class="pre"><install-root>/lib/mercurial/hgrc</span></tt></div> +<div class="line">(Plan 9) <tt class="docutils literal"><span class="pre"><install-root>/lib/mercurial/hgrc.d/*.rc</span></tt></div> +<div class="line">(Unix) <tt class="docutils literal"><span class="pre"><install-root>/etc/mercurial/hgrc</span></tt></div> +<div class="line">(Unix) <tt class="docutils literal"><span class="pre"><install-root>/etc/mercurial/hgrc.d/*.rc</span></tt></div> +</div> +<blockquote> +Per-installation configuration files, searched for in the +directory where Mercurial is installed. <tt class="docutils literal"><span class="pre"><install-root></span></tt> is the +parent directory of the <strong>hg</strong> executable (or symlink) being run. For +example, if installed in <tt class="docutils literal">/shared/tools/bin/hg</tt>, Mercurial will look +in <tt class="docutils literal">/shared/tools/etc/mercurial/hgrc</tt>. Options in these files apply +to all Mercurial commands executed by any user in any directory.</blockquote> +<div class="line-block"> +<div class="line">(Windows) <tt class="docutils literal"><span class="pre"><install-dir>\Mercurial.ini</span></tt> <strong>or</strong></div> +<div class="line">(Windows) <tt class="docutils literal"><span class="pre"><install-dir>\hgrc.d\*.rc</span></tt> <strong>or</strong></div> +<div class="line">(Windows) <tt class="docutils literal">HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial</tt></div> +</div> +<blockquote> +Per-installation/system configuration files, for the system on +which Mercurial is running. Options in these files apply to all +Mercurial commands executed by any user in any directory. Registry +keys contain PATH-like strings, every part of which must reference +a <tt class="docutils literal">Mercurial.ini</tt> file or be a directory where <tt class="docutils literal">*.rc</tt> files will +be read. Mercurial checks each of these locations in the specified +order until one or more configuration files are detected.</blockquote> +</div> +<div class="section" id="syntax"> +<h1><a class="toc-backref" href="#contents">Syntax</a></h1> +<p>A configuration file consists of sections, led by a <tt class="docutils literal">[section]</tt> header +and followed by <tt class="docutils literal">name = value</tt> entries (sometimes called +<tt class="docutils literal">configuration keys</tt>):</p> +<pre class="literal-block"> +[spam] +eggs=ham +green= + eggs +</pre> +<p>Each line contains one entry. If the lines that follow are indented, +they are treated as continuations of that entry. Leading whitespace is +removed from values. Empty lines are skipped. Lines beginning with +<tt class="docutils literal">#</tt> or <tt class="docutils literal">;</tt> are ignored and may be used to provide comments.</p> +<p>Configuration keys can be set multiple times, in which case Mercurial +will use the value that was configured last. As an example:</p> +<pre class="literal-block"> +[spam] +eggs=large +ham=serrano +eggs=small +</pre> +<p>This would set the configuration key named <tt class="docutils literal">eggs</tt> to <tt class="docutils literal">small</tt>.</p> +<p>It is also possible to define a section multiple times. A section can +be redefined on the same and/or on different configuration files. For +example:</p> +<pre class="literal-block"> +[foo] +eggs=large +ham=serrano +eggs=small + +[bar] +eggs=ham +green= + eggs + +[foo] +ham=prosciutto +eggs=medium +bread=toasted +</pre> +<p>This would set the <tt class="docutils literal">eggs</tt>, <tt class="docutils literal">ham</tt>, and <tt class="docutils literal">bread</tt> configuration keys +of the <tt class="docutils literal">foo</tt> section to <tt class="docutils literal">medium</tt>, <tt class="docutils literal">prosciutto</tt>, and <tt class="docutils literal">toasted</tt>, +respectively. As you can see there only thing that matters is the last +value that was set for each of the configuration keys.</p> +<p>If a configuration key is set multiple times in different +configuration files the final value will depend on the order in which +the different configuration files are read, with settings from earlier +paths overriding later ones as described on the <tt class="docutils literal">Files</tt> section +above.</p> +<p>A line of the form <tt class="docutils literal">%include file</tt> will include <tt class="docutils literal">file</tt> into the +current configuration file. The inclusion is recursive, which means +that included files can include other files. Filenames are relative to +the configuration file in which the <tt class="docutils literal">%include</tt> directive is found. +Environment variables and <tt class="docutils literal">~user</tt> constructs are expanded in +<tt class="docutils literal">file</tt>. This lets you do something like:</p> +<pre class="literal-block"> +%include ~/.hgrc.d/$HOST.rc +</pre> +<p>to include a different configuration file on each computer you use.</p> +<p>A line with <tt class="docutils literal">%unset name</tt> will remove <tt class="docutils literal">name</tt> from the current +section, if it has been set previously.</p> +<p>The values are either free-form text strings, lists of text strings, +or Boolean values. Boolean values can be set to true using any of "1", +"yes", "true", or "on" and to false using "0", "no", "false", or "off" +(all case insensitive).</p> +<p>List values are separated by whitespace or comma, except when values are +placed in double quotation marks:</p> +<pre class="literal-block"> +allow_read = "John Doe, PhD", brian, betty +</pre> +<p>Quotation marks can be escaped by prefixing them with a backslash. Only +quotation marks at the beginning of a word is counted as a quotation +(e.g., <tt class="docutils literal">foo"bar baz</tt> is the list of <tt class="docutils literal">foo"bar</tt> and <tt class="docutils literal">baz</tt>).</p> +</div> +<div class="section" id="sections"> +<h1><a class="toc-backref" href="#contents">Sections</a></h1> +<p>This section describes the different sections that may appear in a +Mercurial configuration file, the purpose of each section, its possible +keys, and their possible values.</p> +<div class="section" id="alias"> +<h2><a class="toc-backref" href="#contents"><tt class="docutils literal">alias</tt></a></h2> +<p>Defines command aliases. +Aliases allow you to define your own commands in terms of other +commands (or aliases), optionally including arguments. Positional +arguments in the form of <tt class="docutils literal">$1</tt>, <tt class="docutils literal">$2</tt>, etc in the alias definition +are expanded by Mercurial before execution. Positional arguments not +already used by <tt class="docutils literal">$N</tt> in the definition are put at the end of the +command to be executed.</p> +<p>Alias definitions consist of lines of the form:</p> +<pre class="literal-block"> +<alias> = <command> [<argument>]... +</pre> +<p>For example, this definition:</p> +<pre class="literal-block"> +latest = log --limit 5 +</pre> +<p>creates a new command <tt class="docutils literal">latest</tt> that shows only the five most recent +changesets. You can define subsequent aliases using earlier ones:</p> +<pre class="literal-block"> +stable5 = latest -b stable +</pre> +<div class="note"> +<p class="first admonition-title">Note</p> +<p class="last">It is possible to create aliases with the same names as +existing commands, which will then override the original +definitions. This is almost always a bad idea!</p> +</div> +<p>An alias can start with an exclamation point (<tt class="docutils literal">!</tt>) to make it a +shell alias. A shell alias is executed with the shell and will let you +run arbitrary commands. As an example,</p> +<pre class="literal-block"> +echo = !echo $@ +</pre> +<p>will let you do <tt class="docutils literal">hg echo foo</tt> to have <tt class="docutils literal">foo</tt> printed in your +terminal. A better example might be:</p> +<pre class="literal-block"> +purge = !$HG status --no-status --unknown -0 | xargs -0 rm +</pre> +<p>which will make <tt class="docutils literal">hg purge</tt> delete all unknown files in the +repository in the same manner as the purge extension.</p> +<p>Positional arguments like <tt class="docutils literal">$1</tt>, <tt class="docutils literal">$2</tt>, etc. in the alias definition +expand to the command arguments. Unmatched arguments are +removed. <tt class="docutils literal">$0</tt> expands to the alias name and <tt class="docutils literal">$@</tt> expands to all +arguments separated by a space. These expansions happen before the +command is passed to the shell.</p> +<p>Shell aliases are executed in an environment where <tt class="docutils literal">$HG</tt> expands to +the path of the Mercurial that was used to execute the alias. This is +useful when you want to call further Mercurial commands in a shell +alias, as was done above for the purge alias. In addition, +<tt class="docutils literal">$HG_ARGS</tt> expands to the arguments given to Mercurial. In the <tt class="docutils literal">hg +echo foo</tt> call above, <tt class="docutils literal">$HG_ARGS</tt> would expand to <tt class="docutils literal">echo foo</tt>.</p> +<div class="note"> +<p class="first admonition-title">Note</p> +<p class="last">Some global configuration options such as <tt class="docutils literal"><span class="pre">-R</span></tt> are +processed before shell aliases and will thus not be passed to +aliases.</p> +</div> +</div> +<div class="section" id="annotate"> +<h2><a class="toc-backref" href="#contents"><tt class="docutils literal">annotate</tt></a></h2> +<p>Settings used when displaying file annotations. All values are +Booleans and default to False. See <tt class="docutils literal">diff</tt> section for related +options for the diff command.</p> +<dl class="docutils"> +<dt><tt class="docutils literal">ignorews</tt></dt> +<dd>Ignore white space when comparing lines.</dd> +<dt><tt class="docutils literal">ignorewsamount</tt></dt> +<dd>Ignore changes in the amount of white space.</dd> +<dt><tt class="docutils literal">ignoreblanklines</tt></dt> +<dd>Ignore changes whose lines are all blank.</dd> +</dl> +</div> +<div class="section" id="auth"> +<h2><a class="toc-backref" href="#contents"><tt class="docutils literal">auth</tt></a></h2> +<p>Authentication credentials for HTTP authentication. This section +allows you to store usernames and passwords for use when logging +<em>into</em> HTTP servers. See the <tt class="docutils literal">[web]</tt> configuration section if +you want to configure <em>who</em> can login to your HTTP server.</p> +<p>Each line has the following format:</p> +<pre class="literal-block"> +<name>.<argument> = <value> +</pre> +<p>where <tt class="docutils literal"><name></tt> is used to group arguments into authentication +entries. Example:</p> +<pre class="literal-block"> +foo.prefix = hg.intevation.org/mercurial +foo.username = foo +foo.password = bar +foo.schemes = http https + +bar.prefix = secure.example.org +bar.key = path/to/file.key +bar.cert = path/to/file.cert +bar.schemes = https +</pre> +<p>Supported arguments:</p> +<dl class="docutils"> +<dt><tt class="docutils literal">prefix</tt></dt> +<dd>Either <tt class="docutils literal">*</tt> or a URI prefix with or without the scheme part. +The authentication entry with the longest matching prefix is used +(where <tt class="docutils literal">*</tt> matches everything and counts as a match of length +1). If the prefix doesn't include a scheme, the match is performed +against the URI with its scheme stripped as well, and the schemes +argument, q.v., is then subsequently consulted.</dd> +<dt><tt class="docutils literal">username</tt></dt> +<dd>Optional. Username to authenticate with. If not given, and the +remote site requires basic or digest authentication, the user will +be prompted for it. Environment variables are expanded in the +username letting you do <tt class="docutils literal">foo.username = $USER</tt>. If the URI +includes a username, only <tt class="docutils literal">[auth]</tt> entries with a matching +username or without a username will be considered.</dd> +<dt><tt class="docutils literal">password</tt></dt> +<dd>Optional. Password to authenticate with. If not given, and the +remote site requires basic or digest authentication, the user +will be prompted for it.</dd> +<dt><tt class="docutils literal">key</tt></dt> +<dd>Optional. PEM encoded client certificate key file. Environment +variables are expanded in the filename.</dd> +<dt><tt class="docutils literal">cert</tt></dt> +<dd>Optional. PEM encoded client certificate chain file. Environment +variables are expanded in the filename.</dd> +<dt><tt class="docutils literal">schemes</tt></dt> +<dd>Optional. Space separated list of URI schemes to use this +authentication entry with. Only used if the prefix doesn't include +a scheme. Supported schemes are http and https. They will match +static-http and static-https respectively, as well. +Default: https.</dd> +</dl> +<p>If no suitable authentication entry is found, the user is prompted +for credentials as usual if required by the remote.</p> +</div> +<div class="section" id="decode-encode"> +<h2><a class="toc-backref" href="#contents"><tt class="docutils literal">decode/encode</tt></a></h2> +<p>Filters for transforming files on checkout/checkin. This would +typically be used for newline processing or other +localization/canonicalization of files.</p> +<p>Filters consist of a filter pattern followed by a filter command. +Filter patterns are globs by default, rooted at the repository root. +For example, to match any file ending in <tt class="docutils literal">.txt</tt> in the root +directory only, use the pattern <tt class="docutils literal">*.txt</tt>. To match any file ending +in <tt class="docutils literal">.c</tt> anywhere in the repository, use the pattern <tt class="docutils literal"><span class="pre">**.c</span></tt>. +For each file only the first matching filter applies.</p> +<p>The filter command can start with a specifier, either <tt class="docutils literal">pipe:</tt> or +<tt class="docutils literal">tempfile:</tt>. If no specifier is given, <tt class="docutils literal">pipe:</tt> is used by default.</p> +<p>A <tt class="docutils literal">pipe:</tt> command must accept data on stdin and return the transformed +data on stdout.</p> +<p>Pipe example:</p> +<pre class="literal-block"> +[encode] +# uncompress gzip files on checkin to improve delta compression +# note: not necessarily a good idea, just an example +*.gz = pipe: gunzip + +[decode] +# recompress gzip files when writing them to the working dir (we +# can safely omit "pipe:", because it's the default) +*.gz = gzip +</pre> +<p>A <tt class="docutils literal">tempfile:</tt> command is a template. The string <tt class="docutils literal">INFILE</tt> is replaced +with the name of a temporary file that contains the data to be +filtered by the command. The string <tt class="docutils literal">OUTFILE</tt> is replaced with the name +of an empty temporary file, where the filtered data must be written by +the command.</p> +<div class="note"> +<p class="first admonition-title">Note</p> +<p class="last">The tempfile mechanism is recommended for Windows systems, +where the standard shell I/O redirection operators often have +strange effects and may corrupt the contents of your files.</p> +</div> +<p>This filter mechanism is used internally by the <tt class="docutils literal">eol</tt> extension to +translate line ending characters between Windows (CRLF) and Unix (LF) +format. We suggest you use the <tt class="docutils literal">eol</tt> extension for convenience.</p> +</div> +<div class="section" id="defaults"> +<h2><a class="toc-backref" href="#contents"><tt class="docutils literal">defaults</tt></a></h2> +<p>(defaults are deprecated. Don't use them. Use aliases instead)</p> +<p>Use the <tt class="docutils literal">[defaults]</tt> section to define command defaults, i.e. the +default options/arguments to pass to the specified commands.</p> +<p>The following example makes <a class="reference external" href="hg.1.html#log"><tt class="docutils literal">hg log</tt></a> run in verbose mode, and +<a class="reference external" href="hg.1.html#status"><tt class="docutils literal">hg status</tt></a> show only the modified files, by default:</p> +<pre class="literal-block"> +[defaults] +log = -v +status = -m +</pre> +<p>The actual commands, instead of their aliases, must be used when +defining command defaults. The command defaults will also be applied +to the aliases of the commands defined.</p> +</div> +<div class="section" id="diff"> +<h2><a class="toc-backref" href="#contents"><tt class="docutils literal">diff</tt></a></h2> +<p>Settings used when displaying diffs. Everything except for <tt class="docutils literal">unified</tt> +is a Boolean and defaults to False. See <tt class="docutils literal">annotate</tt> section for +related options for the annotate command.</p> +<dl class="docutils"> +<dt><tt class="docutils literal">git</tt></dt> +<dd>Use git extended diff format.</dd> +<dt><tt class="docutils literal">nodates</tt></dt> +<dd>Don't include dates in diff headers.</dd> +<dt><tt class="docutils literal">showfunc</tt></dt> +<dd>Show which function each change is in.</dd> +<dt><tt class="docutils literal">ignorews</tt></dt> +<dd>Ignore white space when comparing lines.</dd> +<dt><tt class="docutils literal">ignorewsamount</tt></dt> +<dd>Ignore changes in the amount of white space.</dd> +<dt><tt class="docutils literal">ignoreblanklines</tt></dt> +<dd>Ignore changes whose lines are all blank.</dd> +<dt><tt class="docutils literal">unified</tt></dt> +<dd>Number of lines of context to show.</dd> +</dl> +</div> +<div class="section" id="email"> +<h2><a class="toc-backref" href="#contents"><tt class="docutils literal">email</tt></a></h2> +<p>Settings for extensions that send email messages.</p> +<dl class="docutils"> +<dt><tt class="docutils literal">from</tt></dt> +<dd>Optional. Email address to use in "From" header and SMTP envelope +of outgoing messages.</dd> +<dt><tt class="docutils literal">to</tt></dt> +<dd>Optional. Comma-separated list of recipients' email addresses.</dd> +<dt><tt class="docutils literal">cc</tt></dt> +<dd>Optional. Comma-separated list of carbon copy recipients' +email addresses.</dd> +<dt><tt class="docutils literal">bcc</tt></dt> +<dd>Optional. Comma-separated list of blind carbon copy recipients' +email addresses.</dd> +<dt><tt class="docutils literal">method</tt></dt> +<dd>Optional. Method to use to send email messages. If value is <tt class="docutils literal">smtp</tt> +(default), use SMTP (see the <tt class="docutils literal">[smtp]</tt> section for configuration). +Otherwise, use as name of program to run that acts like sendmail +(takes <tt class="docutils literal"><span class="pre">-f</span></tt> option for sender, list of recipients on command line, +message on stdin). Normally, setting this to <tt class="docutils literal">sendmail</tt> or +<tt class="docutils literal">/usr/sbin/sendmail</tt> is enough to use sendmail to send messages.</dd> +<dt><tt class="docutils literal">charsets</tt></dt> +<dd><p class="first">Optional. Comma-separated list of character sets considered +convenient for recipients. Addresses, headers, and parts not +containing patches of outgoing messages will be encoded in the +first character set to which conversion from local encoding +(<tt class="docutils literal">$HGENCODING</tt>, <tt class="docutils literal">ui.fallbackencoding</tt>) succeeds. If correct +conversion fails, the text in question is sent as is. Defaults to +empty (explicit) list.</p> +<p>Order of outgoing email character sets:</p> +<ol class="last arabic simple"> +<li><tt class="docutils literal"><span class="pre">us-ascii</span></tt>: always first, regardless of settings</li> +<li><tt class="docutils literal">email.charsets</tt>: in order given by user</li> +<li><tt class="docutils literal">ui.fallbackencoding</tt>: if not in email.charsets</li> +<li><tt class="docutils literal">$HGENCODING</tt>: if not in email.charsets</li> +<li><tt class="docutils literal"><span class="pre">utf-8</span></tt>: always last, regardless of settings</li> +</ol> +</dd> +</dl> +<p>Email example:</p> +<pre class="literal-block"> +[email] +from = Joseph User <joe.user@example.com> +method = /usr/sbin/sendmail +# charsets for western Europeans +# us-ascii, utf-8 omitted, as they are tried first and last +charsets = iso-8859-1, iso-8859-15, windows-1252 +</pre> +</div> +<div class="section" id="extensions"> +<h2><a class="toc-backref" href="#contents"><tt class="docutils literal">extensions</tt></a></h2> +<p>Mercurial has an extension mechanism for adding new features. To +enable an extension, create an entry for it in this section.</p> +<p>If you know that the extension is already in Python's search path, +you can give the name of the module, followed by <tt class="docutils literal">=</tt>, with nothing +after the <tt class="docutils literal">=</tt>.</p> +<p>Otherwise, give a name that you choose, followed by <tt class="docutils literal">=</tt>, followed by +the path to the <tt class="docutils literal">.py</tt> file (including the file name extension) that +defines the extension.</p> +<p>To explicitly disable an extension that is enabled in an hgrc of +broader scope, prepend its path with <tt class="docutils literal">!</tt>, as in <tt class="docutils literal">foo = !/ext/path</tt> +or <tt class="docutils literal">foo = !</tt> when path is not supplied.</p> +<p>Example for <tt class="docutils literal"><span class="pre">~/.hgrc</span></tt>:</p> +<pre class="literal-block"> +[extensions] +# (the mq extension will get loaded from Mercurial's path) +mq = +# (this extension will get loaded from the file specified) +myfeature = ~/.hgext/myfeature.py +</pre> +</div> +<div class="section" id="format"> +<h2><a class="toc-backref" href="#contents"><tt class="docutils literal">format</tt></a></h2> +<dl class="docutils"> +<dt><tt class="docutils literal">usestore</tt></dt> +<dd>Enable or disable the "store" repository format which improves +compatibility with systems that fold case or otherwise mangle +filenames. Enabled by default. Disabling this option will allow +you to store longer filenames in some situations at the expense of +compatibility and ensures that the on-disk format of newly created +repositories will be compatible with Mercurial before version 0.9.4.</dd> +<dt><tt class="docutils literal">usefncache</tt></dt> +<dd>Enable or disable the "fncache" repository format which enhances +the "store" repository format (which has to be enabled to use +fncache) to allow longer filenames and avoids using Windows +reserved names, e.g. "nul". Enabled by default. Disabling this +option ensures that the on-disk format of newly created +repositories will be compatible with Mercurial before version 1.1.</dd> +<dt><tt class="docutils literal">dotencode</tt></dt> +<dd>Enable or disable the "dotencode" repository format which enhances +the "fncache" repository format (which has to be enabled to use +dotencode) to avoid issues with filenames starting with ._ on +Mac OS X and spaces on Windows. Enabled by default. Disabling this +option ensures that the on-disk format of newly created +repositories will be compatible with Mercurial before version 1.7.</dd> +</dl> +</div> +<div class="section" id="graph"> +<h2><a class="toc-backref" href="#contents"><tt class="docutils literal">graph</tt></a></h2> +<p>Web graph view configuration. This section let you change graph +elements display properties by branches, for instance to make the +<tt class="docutils literal">default</tt> branch stand out.</p> +<p>Each line has the following format:</p> +<pre class="literal-block"> +<branch>.<argument> = <value> +</pre> +<p>where <tt class="docutils literal"><branch></tt> is the name of the branch being +customized. Example:</p> +<pre class="literal-block"> +[graph] +# 2px width +default.width = 2 +# red color +default.color = FF0000 +</pre> +<p>Supported arguments:</p> +<dl class="docutils"> +<dt><tt class="docutils literal">width</tt></dt> +<dd>Set branch edges width in pixels.</dd> +<dt><tt class="docutils literal">color</tt></dt> +<dd>Set branch edges color in hexadecimal RGB notation.</dd> +</dl> +</div> +<div class="section" id="hooks"> +<h2><a class="toc-backref" href="#contents"><tt class="docutils literal">hooks</tt></a></h2> +<p>Commands or Python functions that get automatically executed by +various actions such as starting or finishing a commit. Multiple +hooks can be run for the same action by appending a suffix to the +action. Overriding a site-wide hook can be done by changing its +value or setting it to an empty string. Hooks can be prioritized +by adding a prefix of <tt class="docutils literal">priority</tt> to the hook name on a new line +and setting the priority. The default priority is 0 if +not specified.</p> +<p>Example <tt class="docutils literal">.hg/hgrc</tt>:</p> +<pre class="literal-block"> +[hooks] +# update working directory after adding changesets +changegroup.update = hg update +# do not use the site-wide hook +incoming = +incoming.email = /my/email/hook +incoming.autobuild = /my/build/hook +# force autobuild hook to run before other incoming hooks +priority.incoming.autobuild = 1 +</pre> +<p>Most hooks are run with environment variables set that give useful +additional information. For each hook below, the environment +variables it is passed are listed with names of the form <tt class="docutils literal">$HG_foo</tt>.</p> +<dl class="docutils"> +<dt><tt class="docutils literal">changegroup</tt></dt> +<dd>Run after a changegroup has been added via push, pull or unbundle. +ID of the first new changeset is in <tt class="docutils literal">$HG_NODE</tt>. URL from which +changes came is in <tt class="docutils literal">$HG_URL</tt>.</dd> +<dt><tt class="docutils literal">commit</tt></dt> +<dd>Run after a changeset has been created in the local repository. ID +of the newly created changeset is in <tt class="docutils literal">$HG_NODE</tt>. Parent changeset +IDs are in <tt class="docutils literal">$HG_PARENT1</tt> and <tt class="docutils literal">$HG_PARENT2</tt>.</dd> +<dt><tt class="docutils literal">incoming</tt></dt> +<dd>Run after a changeset has been pulled, pushed, or unbundled into +the local repository. The ID of the newly arrived changeset is in +<tt class="docutils literal">$HG_NODE</tt>. URL that was source of changes came is in <tt class="docutils literal">$HG_URL</tt>.</dd> +<dt><tt class="docutils literal">outgoing</tt></dt> +<dd>Run after sending changes from local repository to another. ID of +first changeset sent is in <tt class="docutils literal">$HG_NODE</tt>. Source of operation is in +<tt class="docutils literal">$HG_SOURCE</tt>; see "preoutgoing" hook for description.</dd> +<dt><tt class="docutils literal"><span class="pre">post-<command></span></tt></dt> +<dd>Run after successful invocations of the associated command. The +contents of the command line are passed as <tt class="docutils literal">$HG_ARGS</tt> and the result +code in <tt class="docutils literal">$HG_RESULT</tt>. Parsed command line arguments are passed as +<tt class="docutils literal">$HG_PATS</tt> and <tt class="docutils literal">$HG_OPTS</tt>. These contain string representations of +the python data internally passed to <command>. <tt class="docutils literal">$HG_OPTS</tt> is a +dictionary of options (with unspecified options set to their defaults). +<tt class="docutils literal">$HG_PATS</tt> is a list of arguments. Hook failure is ignored.</dd> +<dt><tt class="docutils literal"><span class="pre">pre-<command></span></tt></dt> +<dd>Run before executing the associated command. The contents of the +command line are passed as <tt class="docutils literal">$HG_ARGS</tt>. Parsed command line arguments +are passed as <tt class="docutils literal">$HG_PATS</tt> and <tt class="docutils literal">$HG_OPTS</tt>. These contain string +representations of the data internally passed to <command>. <tt class="docutils literal">$HG_OPTS</tt> +is a dictionary of options (with unspecified options set to their +defaults). <tt class="docutils literal">$HG_PATS</tt> is a list of arguments. If the hook returns +failure, the command doesn't execute and Mercurial returns the failure +code.</dd> +<dt><tt class="docutils literal">prechangegroup</tt></dt> +<dd>Run before a changegroup is added via push, pull or unbundle. Exit +status 0 allows the changegroup to proceed. Non-zero status will +cause the push, pull or unbundle to fail. URL from which changes +will come is in <tt class="docutils literal">$HG_URL</tt>.</dd> +<dt><tt class="docutils literal">precommit</tt></dt> +<dd>Run before starting a local commit. Exit status 0 allows the +commit to proceed. Non-zero status will cause the commit to fail. +Parent changeset IDs are in <tt class="docutils literal">$HG_PARENT1</tt> and <tt class="docutils literal">$HG_PARENT2</tt>.</dd> +<dt><tt class="docutils literal">prelistkeys</tt></dt> +<dd>Run before listing pushkeys (like bookmarks) in the +repository. Non-zero status will cause failure. The key namespace is +in <tt class="docutils literal">$HG_NAMESPACE</tt>.</dd> +<dt><tt class="docutils literal">preoutgoing</tt></dt> +<dd>Run before collecting changes to send from the local repository to +another. Non-zero status will cause failure. This lets you prevent +pull over HTTP or SSH. Also prevents against local pull, push +(outbound) or bundle commands, but not effective, since you can +just copy files instead then. Source of operation is in +<tt class="docutils literal">$HG_SOURCE</tt>. If "serve", operation is happening on behalf of remote +SSH or HTTP repository. If "push", "pull" or "bundle", operation +is happening on behalf of repository on same system.</dd> +<dt><tt class="docutils literal">prepushkey</tt></dt> +<dd>Run before a pushkey (like a bookmark) is added to the +repository. Non-zero status will cause the key to be rejected. The +key namespace is in <tt class="docutils literal">$HG_NAMESPACE</tt>, the key is in <tt class="docutils literal">$HG_KEY</tt>, +the old value (if any) is in <tt class="docutils literal">$HG_OLD</tt>, and the new value is in +<tt class="docutils literal">$HG_NEW</tt>.</dd> +<dt><tt class="docutils literal">pretag</tt></dt> +<dd>Run before creating a tag. Exit status 0 allows the tag to be +created. Non-zero status will cause the tag to fail. ID of +changeset to tag is in <tt class="docutils literal">$HG_NODE</tt>. Name of tag is in <tt class="docutils literal">$HG_TAG</tt>. Tag is +local if <tt class="docutils literal">$HG_LOCAL=1</tt>, in repository if <tt class="docutils literal">$HG_LOCAL=0</tt>.</dd> +<dt><tt class="docutils literal">pretxnchangegroup</tt></dt> +<dd>Run after a changegroup has been added via push, pull or unbundle, +but before the transaction has been committed. Changegroup is +visible to hook program. This lets you validate incoming changes +before accepting them. Passed the ID of the first new changeset in +<tt class="docutils literal">$HG_NODE</tt>. Exit status 0 allows the transaction to commit. Non-zero +status will cause the transaction to be rolled back and the push, +pull or unbundle will fail. URL that was source of changes is in +<tt class="docutils literal">$HG_URL</tt>.</dd> +<dt><tt class="docutils literal">pretxncommit</tt></dt> +<dd>Run after a changeset has been created but the transaction not yet +committed. Changeset is visible to hook program. This lets you +validate commit message and changes. Exit status 0 allows the +commit to proceed. Non-zero status will cause the transaction to +be rolled back. ID of changeset is in <tt class="docutils literal">$HG_NODE</tt>. Parent changeset +IDs are in <tt class="docutils literal">$HG_PARENT1</tt> and <tt class="docutils literal">$HG_PARENT2</tt>.</dd> +<dt><tt class="docutils literal">preupdate</tt></dt> +<dd>Run before updating the working directory. Exit status 0 allows +the update to proceed. Non-zero status will prevent the update. +Changeset ID of first new parent is in <tt class="docutils literal">$HG_PARENT1</tt>. If merge, ID +of second new parent is in <tt class="docutils literal">$HG_PARENT2</tt>.</dd> +<dt><tt class="docutils literal">listkeys</tt></dt> +<dd>Run after listing pushkeys (like bookmarks) in the repository. The +key namespace is in <tt class="docutils literal">$HG_NAMESPACE</tt>. <tt class="docutils literal">$HG_VALUES</tt> is a +dictionary containing the keys and values.</dd> +<dt><tt class="docutils literal">pushkey</tt></dt> +<dd>Run after a pushkey (like a bookmark) is added to the +repository. The key namespace is in <tt class="docutils literal">$HG_NAMESPACE</tt>, the key is in +<tt class="docutils literal">$HG_KEY</tt>, the old value (if any) is in <tt class="docutils literal">$HG_OLD</tt>, and the new +value is in <tt class="docutils literal">$HG_NEW</tt>.</dd> +<dt><tt class="docutils literal">tag</tt></dt> +<dd>Run after a tag is created. ID of tagged changeset is in <tt class="docutils literal">$HG_NODE</tt>. +Name of tag is in <tt class="docutils literal">$HG_TAG</tt>. Tag is local if <tt class="docutils literal">$HG_LOCAL=1</tt>, in +repository if <tt class="docutils literal">$HG_LOCAL=0</tt>.</dd> +<dt><tt class="docutils literal">update</tt></dt> +<dd>Run after updating the working directory. Changeset ID of first +new parent is in <tt class="docutils literal">$HG_PARENT1</tt>. If merge, ID of second new parent is +in <tt class="docutils literal">$HG_PARENT2</tt>. If the update succeeded, <tt class="docutils literal">$HG_ERROR=0</tt>. If the +update failed (e.g. because conflicts not resolved), <tt class="docutils literal">$HG_ERROR=1</tt>.</dd> +</dl> +<div class="note"> +<p class="first admonition-title">Note</p> +<p class="last">It is generally better to use standard hooks rather than the +generic pre- and post- command hooks as they are guaranteed to be +called in the appropriate contexts for influencing transactions. +Also, hooks like "commit" will be called in all contexts that +generate a commit (e.g. tag) and not just the commit command.</p> +</div> +<div class="note"> +<p class="first admonition-title">Note</p> +<p class="last">Environment variables with empty values may not be passed to +hooks on platforms such as Windows. As an example, <tt class="docutils literal">$HG_PARENT2</tt> +will have an empty value under Unix-like platforms for non-merge +changesets, while it will not be available at all under Windows.</p> +</div> +<p>The syntax for Python hooks is as follows:</p> +<pre class="literal-block"> +hookname = python:modulename.submodule.callable +hookname = python:/path/to/python/module.py:callable +</pre> +<p>Python hooks are run within the Mercurial process. Each hook is +called with at least three keyword arguments: a ui object (keyword +<tt class="docutils literal">ui</tt>), a repository object (keyword <tt class="docutils literal">repo</tt>), and a <tt class="docutils literal">hooktype</tt> +keyword that tells what kind of hook is used. Arguments listed as +environment variables above are passed as keyword arguments, with no +<tt class="docutils literal">HG_</tt> prefix, and names in lower case.</p> +<p>If a Python hook returns a "true" value or raises an exception, this +is treated as a failure.</p> +</div> +<div class="section" id="hostfingerprints"> +<h2><a class="toc-backref" href="#contents"><tt class="docutils literal">hostfingerprints</tt></a></h2> +<p>Fingerprints of the certificates of known HTTPS servers. +A HTTPS connection to a server with a fingerprint configured here will +only succeed if the servers certificate matches the fingerprint. +This is very similar to how ssh known hosts works. +The fingerprint is the SHA-1 hash value of the DER encoded certificate. +The CA chain and web.cacerts is not used for servers with a fingerprint.</p> +<p>For example:</p> +<pre class="literal-block"> +[hostfingerprints] +hg.intevation.org = 38:76:52:7c:87:26:9a:8f:4a:f8:d3:de:08:45:3b:ea:d6:4b:ee:cc +</pre> +<p>This feature is only supported when using Python 2.6 or later.</p> +</div> +<div class="section" id="http-proxy"> +<h2><a class="toc-backref" href="#contents"><tt class="docutils literal">http_proxy</tt></a></h2> +<p>Used to access web-based Mercurial repositories through a HTTP +proxy.</p> +<dl class="docutils"> +<dt><tt class="docutils literal">host</tt></dt> +<dd>Host name and (optional) port of the proxy server, for example +"myproxy:8000".</dd> +<dt><tt class="docutils literal">no</tt></dt> +<dd>Optional. Comma-separated list of host names that should bypass +the proxy.</dd> +<dt><tt class="docutils literal">passwd</tt></dt> +<dd>Optional. Password to authenticate with at the proxy server.</dd> +<dt><tt class="docutils literal">user</tt></dt> +<dd>Optional. User name to authenticate with at the proxy server.</dd> +<dt><tt class="docutils literal">always</tt></dt> +<dd>Optional. Always use the proxy, even for localhost and any entries +in <tt class="docutils literal">http_proxy.no</tt>. True or False. Default: False.</dd> +</dl> +</div> +<div class="section" id="merge-patterns"> +<h2><a class="toc-backref" href="#contents"><tt class="docutils literal"><span class="pre">merge-patterns</span></tt></a></h2> +<p>This section specifies merge tools to associate with particular file +patterns. Tools matched here will take precedence over the default +merge tool. Patterns are globs by default, rooted at the repository +root.</p> +<p>Example:</p> +<pre class="literal-block"> +[merge-patterns] +**.c = kdiff3 +**.jpg = myimgmerge +</pre> +</div> +<div class="section" id="merge-tools"> +<h2><a class="toc-backref" href="#contents"><tt class="docutils literal"><span class="pre">merge-tools</span></tt></a></h2> +<p>This section configures external merge tools to use for file-level +merges.</p> +<p>Example <tt class="docutils literal"><span class="pre">~/.hgrc</span></tt>:</p> +<pre class="literal-block"> +[merge-tools] +# Override stock tool location +kdiff3.executable = ~/bin/kdiff3 +# Specify command line +kdiff3.args = $base $local $other -o $output +# Give higher priority +kdiff3.priority = 1 + +# Define new tool +myHtmlTool.args = -m $local $other $base $output +myHtmlTool.regkey = Software\FooSoftware\HtmlMerge +myHtmlTool.priority = 1 +</pre> +<p>Supported arguments:</p> +<dl class="docutils"> +<dt><tt class="docutils literal">priority</tt></dt> +<dd>The priority in which to evaluate this tool. +Default: 0.</dd> +<dt><tt class="docutils literal">executable</tt></dt> +<dd>Either just the name of the executable or its pathname. On Windows, +the path can use environment variables with ${ProgramFiles} syntax. +Default: the tool name.</dd> +<dt><tt class="docutils literal">args</tt></dt> +<dd>The arguments to pass to the tool executable. You can refer to the +files being merged as well as the output file through these +variables: <tt class="docutils literal">$base</tt>, <tt class="docutils literal">$local</tt>, <tt class="docutils literal">$other</tt>, <tt class="docutils literal">$output</tt>. +Default: <tt class="docutils literal">$local $base $other</tt></dd> +<dt><tt class="docutils literal">premerge</tt></dt> +<dd>Attempt to run internal non-interactive 3-way merge tool before +launching external tool. Options are <tt class="docutils literal">true</tt>, <tt class="docutils literal">false</tt>, or <tt class="docutils literal">keep</tt> +to leave markers in the file if the premerge fails. +Default: True</dd> +<dt><tt class="docutils literal">binary</tt></dt> +<dd>This tool can merge binary files. Defaults to False, unless tool +was selected by file pattern match.</dd> +<dt><tt class="docutils literal">symlink</tt></dt> +<dd>This tool can merge symlinks. Defaults to False, even if tool was +selected by file pattern match.</dd> +<dt><tt class="docutils literal">check</tt></dt> +<dd><p class="first">A list of merge success-checking options:</p> +<dl class="last docutils"> +<dt><tt class="docutils literal">changed</tt></dt> +<dd>Ask whether merge was successful when the merged file shows no changes.</dd> +<dt><tt class="docutils literal">conflicts</tt></dt> +<dd>Check whether there are conflicts even though the tool reported success.</dd> +<dt><tt class="docutils literal">prompt</tt></dt> +<dd>Always prompt for merge success, regardless of success reported by tool.</dd> +</dl> +</dd> +<dt><tt class="docutils literal">checkchanged</tt></dt> +<dd>True is equivalent to <tt class="docutils literal">check = changed</tt>. +Default: False</dd> +<dt><tt class="docutils literal">checkconflicts</tt></dt> +<dd>True is equivalent to <tt class="docutils literal">check = conflicts</tt>. +Default: False</dd> +<dt><tt class="docutils literal">fixeol</tt></dt> +<dd>Attempt to fix up EOL changes caused by the merge tool. +Default: False</dd> +<dt><tt class="docutils literal">gui</tt></dt> +<dd>This tool requires a graphical interface to run. Default: False</dd> +<dt><tt class="docutils literal">regkey</tt></dt> +<dd>Windows registry key which describes install location of this +tool. Mercurial will search for this key first under +<tt class="docutils literal">HKEY_CURRENT_USER</tt> and then under <tt class="docutils literal">HKEY_LOCAL_MACHINE</tt>. +Default: None</dd> +<dt><tt class="docutils literal">regkeyalt</tt></dt> +<dd>An alternate Windows registry key to try if the first key is not +found. The alternate key uses the same <tt class="docutils literal">regname</tt> and <tt class="docutils literal">regappend</tt> +semantics of the primary key. The most common use for this key +is to search for 32bit applications on 64bit operating systems. +Default: None</dd> +<dt><tt class="docutils literal">regname</tt></dt> +<dd>Name of value to read from specified registry key. Defaults to the +unnamed (default) value.</dd> +<dt><tt class="docutils literal">regappend</tt></dt> +<dd>String to append to the value read from the registry, typically +the executable name of the tool. +Default: None</dd> +</dl> +</div> +<div class="section" id="patch"> +<h2><a class="toc-backref" href="#contents"><tt class="docutils literal">patch</tt></a></h2> +<p>Settings used when applying patches, for instance through the 'import' +command or with Mercurial Queues extension.</p> +<dl class="docutils"> +<dt><tt class="docutils literal">eol</tt></dt> +<dd>When set to 'strict' patch content and patched files end of lines +are preserved. When set to <tt class="docutils literal">lf</tt> or <tt class="docutils literal">crlf</tt>, both files end of +lines are ignored when patching and the result line endings are +normalized to either LF (Unix) or CRLF (Windows). When set to +<tt class="docutils literal">auto</tt>, end of lines are again ignored while patching but line +endings in patched files are normalized to their original setting +on a per-file basis. If target file does not exist or has no end +of line, patch line endings are preserved. +Default: strict.</dd> +</dl> +</div> +<div class="section" id="paths"> +<h2><a class="toc-backref" href="#contents"><tt class="docutils literal">paths</tt></a></h2> +<p>Assigns symbolic names to repositories. The left side is the +symbolic name, and the right gives the directory or URL that is the +location of the repository. Default paths can be declared by setting +the following entries.</p> +<dl class="docutils"> +<dt><tt class="docutils literal">default</tt></dt> +<dd>Directory or URL to use when pulling if no source is specified. +Default is set to repository from which the current repository was +cloned.</dd> +<dt><tt class="docutils literal"><span class="pre">default-push</span></tt></dt> +<dd>Optional. Directory or URL to use when pushing if no destination +is specified.</dd> +</dl> +</div> +<div class="section" id="phases"> +<h2><a class="toc-backref" href="#contents"><tt class="docutils literal">phases</tt></a></h2> +<p>Specifies default handling of phases. See <a class="reference external" href="hg.1.html#phases"><tt class="docutils literal">hg help phases</tt></a> for more +information about working with phases.</p> +<dl class="docutils"> +<dt><tt class="docutils literal">publish</tt></dt> +<dd>Controls draft phase behavior when working as a server. When true, +pushed changesets are set to public in both client and server and +pulled or cloned changesets are set to public in the client. +Default: True</dd> +<dt><tt class="docutils literal"><span class="pre">new-commit</span></tt></dt> +<dd>Phase of newly-created commits. +Default: draft</dd> +</dl> +</div> +<div class="section" id="profiling"> +<h2><a class="toc-backref" href="#contents"><tt class="docutils literal">profiling</tt></a></h2> +<p>Specifies profiling type, format, and file output. Two profilers are +supported: an instrumenting profiler (named <tt class="docutils literal">ls</tt>), and a sampling +profiler (named <tt class="docutils literal">stat</tt>).</p> +<p>In this section description, 'profiling data' stands for the raw data +collected during profiling, while 'profiling report' stands for a +statistical text report generated from the profiling data. The +profiling is done using lsprof.</p> +<dl class="docutils"> +<dt><tt class="docutils literal">type</tt></dt> +<dd><p class="first">The type of profiler to use. +Default: ls.</p> +<dl class="last docutils"> +<dt><tt class="docutils literal">ls</tt></dt> +<dd>Use Python's built-in instrumenting profiler. This profiler +works on all platforms, but each line number it reports is the +first line of a function. This restriction makes it difficult to +identify the expensive parts of a non-trivial function.</dd> +<dt><tt class="docutils literal">stat</tt></dt> +<dd>Use a third-party statistical profiler, statprof. This profiler +currently runs only on Unix systems, and is most useful for +profiling commands that run for longer than about 0.1 seconds.</dd> +</dl> +</dd> +<dt><tt class="docutils literal">format</tt></dt> +<dd><p class="first">Profiling format. Specific to the <tt class="docutils literal">ls</tt> instrumenting profiler. +Default: text.</p> +<dl class="last docutils"> +<dt><tt class="docutils literal">text</tt></dt> +<dd>Generate a profiling report. When saving to a file, it should be +noted that only the report is saved, and the profiling data is +not kept.</dd> +<dt><tt class="docutils literal">kcachegrind</tt></dt> +<dd>Format profiling data for kcachegrind use: when saving to a +file, the generated file can directly be loaded into +kcachegrind.</dd> +</dl> +</dd> +<dt><tt class="docutils literal">frequency</tt></dt> +<dd>Sampling frequency. Specific to the <tt class="docutils literal">stat</tt> sampling profiler. +Default: 1000.</dd> +<dt><tt class="docutils literal">output</tt></dt> +<dd>File path where profiling data or report should be saved. If the +file exists, it is replaced. Default: None, data is printed on +stderr</dd> +</dl> +</div> +<div class="section" id="revsetalias"> +<h2><a class="toc-backref" href="#contents"><tt class="docutils literal">revsetalias</tt></a></h2> +<p>Alias definitions for revsets. See <a class="reference external" href="hg.1.html#revsets"><tt class="docutils literal">hg help revsets</tt></a> for details.</p> +</div> +<div class="section" id="server"> +<h2><a class="toc-backref" href="#contents"><tt class="docutils literal">server</tt></a></h2> +<p>Controls generic server settings.</p> +<dl class="docutils"> +<dt><tt class="docutils literal">uncompressed</tt></dt> +<dd>Whether to allow clients to clone a repository using the +uncompressed streaming protocol. This transfers about 40% more +data than a regular clone, but uses less memory and CPU on both +server and client. Over a LAN (100 Mbps or better) or a very fast +WAN, an uncompressed streaming clone is a lot faster (~10x) than a +regular clone. Over most WAN connections (anything slower than +about 6 Mbps), uncompressed streaming is slower, because of the +extra data transfer overhead. This mode will also temporarily hold +the write lock while determining what data to transfer. +Default is True.</dd> +<dt><tt class="docutils literal">preferuncompressed</tt></dt> +<dd>When set, clients will try to use the uncompressed streaming +protocol. Default is False.</dd> +<dt><tt class="docutils literal">validate</tt></dt> +<dd>Whether to validate the completeness of pushed changesets by +checking that all new file revisions specified in manifests are +present. Default is False.</dd> +</dl> +</div> +<div class="section" id="smtp"> +<h2><a class="toc-backref" href="#contents"><tt class="docutils literal">smtp</tt></a></h2> +<p>Configuration for extensions that need to send email messages.</p> +<dl class="docutils"> +<dt><tt class="docutils literal">host</tt></dt> +<dd>Host name of mail server, e.g. "mail.example.com".</dd> +<dt><tt class="docutils literal">port</tt></dt> +<dd>Optional. Port to connect to on mail server. Default: 25.</dd> +<dt><tt class="docutils literal">tls</tt></dt> +<dd>Optional. Method to enable TLS when connecting to mail server: starttls, +smtps or none. Default: none.</dd> +<dt><tt class="docutils literal">username</tt></dt> +<dd>Optional. User name for authenticating with the SMTP server. +Default: none.</dd> +<dt><tt class="docutils literal">password</tt></dt> +<dd>Optional. Password for authenticating with the SMTP server. If not +specified, interactive sessions will prompt the user for a +password; non-interactive sessions will fail. Default: none.</dd> +<dt><tt class="docutils literal">local_hostname</tt></dt> +<dd>Optional. It's the hostname that the sender can use to identify +itself to the MTA.</dd> +</dl> +</div> +<div class="section" id="subpaths"> +<h2><a class="toc-backref" href="#contents"><tt class="docutils literal">subpaths</tt></a></h2> +<p>Subrepository source URLs can go stale if a remote server changes name +or becomes temporarily unavailable. This section lets you define +rewrite rules of the form:</p> +<pre class="literal-block"> +<pattern> = <replacement> +</pre> +<p>where <tt class="docutils literal">pattern</tt> is a regular expression matching a subrepository +source URL and <tt class="docutils literal">replacement</tt> is the replacement string used to +rewrite it. Groups can be matched in <tt class="docutils literal">pattern</tt> and referenced in +<tt class="docutils literal">replacements</tt>. For instance:</p> +<pre class="literal-block"> +http://server/(.*)-hg/ = http://hg.server/\1/ +</pre> +<p>rewrites <tt class="docutils literal"><span class="pre">http://server/foo-hg/</span></tt> into <tt class="docutils literal"><span class="pre">http://hg.server/foo/</span></tt>.</p> +<p>Relative subrepository paths are first made absolute, and the +rewrite rules are then applied on the full (absolute) path. The rules +are applied in definition order.</p> +</div> +<div class="section" id="trusted"> +<h2><a class="toc-backref" href="#contents"><tt class="docutils literal">trusted</tt></a></h2> +<p>Mercurial will not use the settings in the +<tt class="docutils literal">.hg/hgrc</tt> file from a repository if it doesn't belong to a trusted +user or to a trusted group, as various hgrc features allow arbitrary +commands to be run. This issue is often encountered when configuring +hooks or extensions for shared repositories or servers. However, +the web interface will use some safe settings from the <tt class="docutils literal">[web]</tt> +section.</p> +<p>This section specifies what users and groups are trusted. The +current user is always trusted. To trust everybody, list a user or a +group with name <tt class="docutils literal">*</tt>. These settings must be placed in an +<em>already-trusted file</em> to take effect, such as <tt class="docutils literal"><span class="pre">$HOME/.hgrc</span></tt> of the +user or service running Mercurial.</p> +<dl class="docutils"> +<dt><tt class="docutils literal">users</tt></dt> +<dd>Comma-separated list of trusted users.</dd> +<dt><tt class="docutils literal">groups</tt></dt> +<dd>Comma-separated list of trusted groups.</dd> +</dl> +</div> +<div class="section" id="ui"> +<h2><a class="toc-backref" href="#contents"><tt class="docutils literal">ui</tt></a></h2> +<p>User interface controls.</p> +<dl class="docutils"> +<dt><tt class="docutils literal">archivemeta</tt></dt> +<dd>Whether to include the .hg_archival.txt file containing meta data +(hashes for the repository base and for tip) in archives created +by the <a class="reference external" href="hg.1.html#archive"><tt class="docutils literal">hg archive</tt></a> command or downloaded via hgweb. +Default is True.</dd> +<dt><tt class="docutils literal">askusername</tt></dt> +<dd>Whether to prompt for a username when committing. If True, and +neither <tt class="docutils literal">$HGUSER</tt> nor <tt class="docutils literal">$EMAIL</tt> has been specified, then the user will +be prompted to enter a username. If no username is entered, the +default <tt class="docutils literal">USER@HOST</tt> is used instead. +Default is False.</dd> +<dt><tt class="docutils literal">commitsubrepos</tt></dt> +<dd>Whether to commit modified subrepositories when committing the +parent repository. If False and one subrepository has uncommitted +changes, abort the commit. +Default is False.</dd> +<dt><tt class="docutils literal">debug</tt></dt> +<dd>Print debugging information. True or False. Default is False.</dd> +<dt><tt class="docutils literal">editor</tt></dt> +<dd>The editor to use during a commit. Default is <tt class="docutils literal">$EDITOR</tt> or <tt class="docutils literal">vi</tt>.</dd> +<dt><tt class="docutils literal">fallbackencoding</tt></dt> +<dd>Encoding to try if it's not possible to decode the changelog using +UTF-8. Default is ISO-8859-1.</dd> +<dt><tt class="docutils literal">ignore</tt></dt> +<dd>A file to read per-user ignore patterns from. This file should be +in the same format as a repository-wide .hgignore file. This +option supports hook syntax, so if you want to specify multiple +ignore files, you can do so by setting something like +<tt class="docutils literal">ignore.other = <span class="pre">~/.hgignore2</span></tt>. For details of the ignore file +format, see the <tt class="docutils literal">hgignore(5)</tt> man page.</dd> +<dt><tt class="docutils literal">interactive</tt></dt> +<dd>Allow to prompt the user. True or False. Default is True.</dd> +<dt><tt class="docutils literal">logtemplate</tt></dt> +<dd>Template string for commands that print changesets.</dd> +<dt><tt class="docutils literal">merge</tt></dt> +<dd>The conflict resolution program to use during a manual merge. +For more information on merge tools 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 configuring merge tools see the <tt class="docutils literal"><span class="pre">[merge-tools]</span></tt> section.</dd> +<dt><tt class="docutils literal">portablefilenames</tt></dt> +<dd>Check for portable filenames. Can be <tt class="docutils literal">warn</tt>, <tt class="docutils literal">ignore</tt> or <tt class="docutils literal">abort</tt>. +Default is <tt class="docutils literal">warn</tt>. +If set to <tt class="docutils literal">warn</tt> (or <tt class="docutils literal">true</tt>), a warning message is printed on POSIX +platforms, if a file with a non-portable filename is added (e.g. a file +with a name that can't be created on Windows because it contains reserved +parts like <tt class="docutils literal">AUX</tt>, reserved characters like <tt class="docutils literal">:</tt>, or would cause a case +collision with an existing file). +If set to <tt class="docutils literal">ignore</tt> (or <tt class="docutils literal">false</tt>), no warning is printed. +If set to <tt class="docutils literal">abort</tt>, the command is aborted. +On Windows, this configuration option is ignored and the command aborted.</dd> +<dt><tt class="docutils literal">quiet</tt></dt> +<dd>Reduce the amount of output printed. True or False. Default is False.</dd> +<dt><tt class="docutils literal">remotecmd</tt></dt> +<dd>remote command to use for clone/push/pull operations. Default is <tt class="docutils literal">hg</tt>.</dd> +<dt><tt class="docutils literal">reportoldssl</tt></dt> +<dd>Warn if an SSL certificate is unable to be due to using Python +2.5 or earlier. True or False. Default is True.</dd> +<dt><tt class="docutils literal">report_untrusted</tt></dt> +<dd>Warn if a <tt class="docutils literal">.hg/hgrc</tt> file is ignored due to not being owned by a +trusted user or group. True or False. Default is True.</dd> +<dt><tt class="docutils literal">slash</tt></dt> +<dd>Display paths using a slash (<tt class="docutils literal">/</tt>) as the path separator. This +only makes a difference on systems where the default path +separator is not the slash character (e.g. Windows uses the +backslash character (<tt class="docutils literal">\</tt>)). +Default is False.</dd> +<dt><tt class="docutils literal">ssh</tt></dt> +<dd>command to use for SSH connections. Default is <tt class="docutils literal">ssh</tt>.</dd> +<dt><tt class="docutils literal">strict</tt></dt> +<dd>Require exact command names, instead of allowing unambiguous +abbreviations. True or False. Default is False.</dd> +<dt><tt class="docutils literal">style</tt></dt> +<dd>Name of style to use for command output.</dd> +<dt><tt class="docutils literal">timeout</tt></dt> +<dd>The timeout used when a lock is held (in seconds), a negative value +means no timeout. Default is 600.</dd> +<dt><tt class="docutils literal">traceback</tt></dt> +<dd>Mercurial always prints a traceback when an unknown exception +occurs. Setting this to True will make Mercurial print a traceback +on all exceptions, even those recognized by Mercurial (such as +IOError or MemoryError). Default is False.</dd> +<dt><tt class="docutils literal">username</tt></dt> +<dd>The committer of a changeset created when running "commit". +Typically a person's name and email address, e.g. <tt class="docutils literal">Fred Widget +<fred@example.com></tt>. Default is <tt class="docutils literal">$EMAIL</tt> or <tt class="docutils literal">username@hostname</tt>. If +the username in hgrc is empty, it has to be specified manually or +in a different hgrc file (e.g. <tt class="docutils literal"><span class="pre">$HOME/.hgrc</span></tt>, if the admin set +<tt class="docutils literal">username =</tt> in the system hgrc). Environment variables in the +username are expanded.</dd> +<dt><tt class="docutils literal">verbose</tt></dt> +<dd>Increase the amount of output printed. True or False. Default is False.</dd> +</dl> +</div> +<div class="section" id="web"> +<h2><a class="toc-backref" href="#contents"><tt class="docutils literal">web</tt></a></h2> +<p>Web interface configuration. The settings in this section apply to +both the builtin webserver (started by <a class="reference external" href="hg.1.html#serve"><tt class="docutils literal">hg serve</tt></a>) and the script you +run through a webserver (<tt class="docutils literal">hgweb.cgi</tt> and the derivatives for FastCGI +and WSGI).</p> +<p>The Mercurial webserver does no authentication (it does not prompt for +usernames and passwords to validate <em>who</em> users are), but it does do +authorization (it grants or denies access for <em>authenticated users</em> +based on settings in this section). You must either configure your +webserver to do authentication for you, or disable the authorization +checks.</p> +<p>For a quick setup in a trusted environment, e.g., a private LAN, where +you want it to accept pushes from anybody, you can use the following +command line:</p> +<pre class="literal-block"> +$ hg --config web.allow_push=* --config web.push_ssl=False serve +</pre> +<p>Note that this will allow anybody to push anything to the server and +that this should not be used for public servers.</p> +<p>The full set of options is:</p> +<dl class="docutils"> +<dt><tt class="docutils literal">accesslog</tt></dt> +<dd>Where to output the access log. Default is stdout.</dd> +<dt><tt class="docutils literal">address</tt></dt> +<dd>Interface address to bind to. Default is all.</dd> +<dt><tt class="docutils literal">allow_archive</tt></dt> +<dd>List of archive format (bz2, gz, zip) allowed for downloading. +Default is empty.</dd> +<dt><tt class="docutils literal">allowbz2</tt></dt> +<dd>(DEPRECATED) Whether to allow .tar.bz2 downloading of repository +revisions. +Default is False.</dd> +<dt><tt class="docutils literal">allowgz</tt></dt> +<dd>(DEPRECATED) Whether to allow .tar.gz downloading of repository +revisions. +Default is False.</dd> +<dt><tt class="docutils literal">allowpull</tt></dt> +<dd>Whether to allow pulling from the repository. Default is True.</dd> +<dt><tt class="docutils literal">allow_push</tt></dt> +<dd>Whether to allow pushing to the repository. If empty or not set, +push is not allowed. If the special value <tt class="docutils literal">*</tt>, any remote user can +push, including unauthenticated users. Otherwise, the remote user +must have been authenticated, and the authenticated user name must +be present in this list. The contents of the allow_push list are +examined after the deny_push list.</dd> +<dt><tt class="docutils literal">allow_read</tt></dt> +<dd>If the user has not already been denied repository access due to +the contents of deny_read, this list determines whether to grant +repository access to the user. If this list is not empty, and the +user is unauthenticated or not present in the list, then access is +denied for the user. If the list is empty or not set, then access +is permitted to all users by default. Setting allow_read to the +special value <tt class="docutils literal">*</tt> is equivalent to it not being set (i.e. access +is permitted to all users). The contents of the allow_read list are +examined after the deny_read list.</dd> +<dt><tt class="docutils literal">allowzip</tt></dt> +<dd>(DEPRECATED) Whether to allow .zip downloading of repository +revisions. Default is False. This feature creates temporary files.</dd> +<dt><tt class="docutils literal">baseurl</tt></dt> +<dd>Base URL to use when publishing URLs in other locations, so +third-party tools like email notification hooks can construct +URLs. Example: <tt class="docutils literal"><span class="pre">http://hgserver/repos/</span></tt>.</dd> +<dt><tt class="docutils literal">cacerts</tt></dt> +<dd><p class="first">Path to file containing a list of PEM encoded certificate +authority certificates. Environment variables and <tt class="docutils literal">~user</tt> +constructs are expanded in the filename. If specified on the +client, then it will verify the identity of remote HTTPS servers +with these certificates.</p> +<p>This feature is only supported when using Python 2.6 or later. If you wish +to use it with earlier versions of Python, install the backported +version of the ssl library that is available from +<tt class="docutils literal"><span class="pre">http://pypi.python.org</span></tt>.</p> +<p>To disable SSL verification temporarily, specify <tt class="docutils literal"><span class="pre">--insecure</span></tt> from +command line.</p> +<p>You can use OpenSSL's CA certificate file if your platform has +one. On most Linux systems this will be +<tt class="docutils literal"><span class="pre">/etc/ssl/certs/ca-certificates.crt</span></tt>. Otherwise you will have to +generate this file manually. The form must be as follows:</p> +<pre class="last literal-block"> +-----BEGIN CERTIFICATE----- +... (certificate in base64 PEM encoding) ... +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +... (certificate in base64 PEM encoding) ... +-----END CERTIFICATE----- +</pre> +</dd> +<dt><tt class="docutils literal">cache</tt></dt> +<dd>Whether to support caching in hgweb. Defaults to True.</dd> +<dt><tt class="docutils literal">collapse</tt></dt> +<dd>With <tt class="docutils literal">descend</tt> enabled, repositories in subdirectories are shown at +a single level alongside repositories in the current path. With +<tt class="docutils literal">collapse</tt> also enabled, repositories residing at a deeper level than +the current path are grouped behind navigable directory entries that +lead to the locations of these repositories. In effect, this setting +collapses each collection of repositories found within a subdirectory +into a single entry for that subdirectory. Default is False.</dd> +<dt><tt class="docutils literal">comparisoncontext</tt></dt> +<dd>Number of lines of context to show in side-by-side file comparison. If +negative or the value <tt class="docutils literal">full</tt>, whole files are shown. Default is 5. +This setting can be overridden by a <tt class="docutils literal">context</tt> request parameter to the +<tt class="docutils literal">comparison</tt> command, taking the same values.</dd> +<dt><tt class="docutils literal">contact</tt></dt> +<dd>Name or email address of the person in charge of the repository. +Defaults to ui.username or <tt class="docutils literal">$EMAIL</tt> or "unknown" if unset or empty.</dd> +<dt><tt class="docutils literal">deny_push</tt></dt> +<dd>Whether to deny pushing to the repository. If empty or not set, +push is not denied. If the special value <tt class="docutils literal">*</tt>, all remote users are +denied push. Otherwise, unauthenticated users are all denied, and +any authenticated user name present in this list is also denied. The +contents of the deny_push list are examined before the allow_push list.</dd> +<dt><tt class="docutils literal">deny_read</tt></dt> +<dd>Whether to deny reading/viewing of the repository. If this list is +not empty, unauthenticated users are all denied, and any +authenticated user name present in this list is also denied access to +the repository. If set to the special value <tt class="docutils literal">*</tt>, all remote users +are denied access (rarely needed ;). If deny_read is empty or not set, +the determination of repository access depends on the presence and +content of the allow_read list (see description). If both +deny_read and allow_read are empty or not set, then access is +permitted to all users by default. If the repository is being +served via hgwebdir, denied users will not be able to see it in +the list of repositories. The contents of the deny_read list have +priority over (are examined before) the contents of the allow_read +list.</dd> +<dt><tt class="docutils literal">descend</tt></dt> +<dd>hgwebdir indexes will not descend into subdirectories. Only repositories +directly in the current path will be shown (other repositories are still +available from the index corresponding to their containing path).</dd> +<dt><tt class="docutils literal">description</tt></dt> +<dd>Textual description of the repository's purpose or contents. +Default is "unknown".</dd> +<dt><tt class="docutils literal">encoding</tt></dt> +<dd>Character encoding name. Default is the current locale charset. +Example: "UTF-8"</dd> +<dt><tt class="docutils literal">errorlog</tt></dt> +<dd>Where to output the error log. Default is stderr.</dd> +<dt><tt class="docutils literal">guessmime</tt></dt> +<dd>Control MIME types for raw download of file content. +Set to True to let hgweb guess the content type from the file +extension. This will serve HTML files as <tt class="docutils literal">text/html</tt> and might +allow cross-site scripting attacks when serving untrusted +repositories. Default is False.</dd> +<dt><tt class="docutils literal">hidden</tt></dt> +<dd>Whether to hide the repository in the hgwebdir index. +Default is False.</dd> +<dt><tt class="docutils literal">ipv6</tt></dt> +<dd>Whether to use IPv6. Default is False.</dd> +<dt><tt class="docutils literal">logoimg</tt></dt> +<dd>File name of the logo image that some templates display on each page. +The file name is relative to <tt class="docutils literal">staticurl</tt>. That is, the full path to +the logo image is "staticurl/logoimg". +If unset, <tt class="docutils literal">hglogo.png</tt> will be used.</dd> +<dt><tt class="docutils literal">logourl</tt></dt> +<dd>Base URL to use for logos. If unset, <tt class="docutils literal"><span class="pre">http://mercurial.selenic.com/</span></tt> +will be used.</dd> +<dt><tt class="docutils literal">maxchanges</tt></dt> +<dd>Maximum number of changes to list on the changelog. Default is 10.</dd> +<dt><tt class="docutils literal">maxfiles</tt></dt> +<dd>Maximum number of files to list per changeset. Default is 10.</dd> +<dt><tt class="docutils literal">maxshortchanges</tt></dt> +<dd>Maximum number of changes to list on the shortlog, graph or filelog +pages. Default is 60.</dd> +<dt><tt class="docutils literal">name</tt></dt> +<dd>Repository name to use in the web interface. Default is current +working directory.</dd> +<dt><tt class="docutils literal">port</tt></dt> +<dd>Port to listen on. Default is 8000.</dd> +<dt><tt class="docutils literal">prefix</tt></dt> +<dd>Prefix path to serve from. Default is '' (server root).</dd> +<dt><tt class="docutils literal">push_ssl</tt></dt> +<dd>Whether to require that inbound pushes be transported over SSL to +prevent password sniffing. Default is True.</dd> +<dt><tt class="docutils literal">staticurl</tt></dt> +<dd>Base URL to use for static files. If unset, static files (e.g. the +hgicon.png favicon) will be served by the CGI script itself. Use +this setting to serve them directly with the HTTP server. +Example: <tt class="docutils literal"><span class="pre">http://hgserver/static/</span></tt>.</dd> +<dt><tt class="docutils literal">stripes</tt></dt> +<dd>How many lines a "zebra stripe" should span in multiline output. +Default is 1; set to 0 to disable.</dd> +<dt><tt class="docutils literal">style</tt></dt> +<dd>Which template map style to use.</dd> +<dt><tt class="docutils literal">templates</tt></dt> +<dd>Where to find the HTML templates. Default is install path.</dd> +</dl> +</div> +</div> +<div class="section" id="author"> +<h1><a class="toc-backref" href="#contents">Author</a></h1> +<p>Bryan O'Sullivan <<a class="reference external" href="mailto:bos@serpentine.com">bos@serpentine.com</a>>.</p> +<p>Mercurial was written by Matt Mackall <<a class="reference external" href="mailto:mpm@selenic.com">mpm@selenic.com</a>>.</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="hg.1.html"><strong>hg</strong>(1)</a>, <a class="reference external" href="hgignore.5.html"><strong>hgignore</strong>(5)</a></p> +</div> +<div class="section" id="copying"> +<h1><a class="toc-backref" href="#contents">Copying</a></h1> +<p>This manual page is copyright 2005 Bryan O'Sullivan. +Mercurial is copyright 2005-2012 Matt Mackall. +Free use of this software is granted under the terms of the GNU General +Public License version 2 or any later version.</p> +<!-- Common link and substitution definitions. --> +</div> +</div> +</body> +</html> diff --git a/doc/hgrc.5.txt b/doc/hgrc.5.txt new file mode 100644 index 0000000..e6adaf3 --- /dev/null +++ b/doc/hgrc.5.txt @@ -0,0 +1,41 @@ +====== + hgrc +====== + +--------------------------------- +configuration files for Mercurial +--------------------------------- + +:Author: Bryan O'Sullivan <bos@serpentine.com> +:Organization: Mercurial +:Manual section: 5 +:Manual group: Mercurial Manual + +.. contents:: + :backlinks: top + :class: htmlonly + + +Synopsis +======== + +.. include:: ../mercurial/help/config.txt + +Author +====== +Bryan O'Sullivan <bos@serpentine.com>. + +Mercurial was written by Matt Mackall <mpm@selenic.com>. + +See Also +======== +|hg(1)|_, |hgignore(5)|_ + +Copying +======= +This manual page is copyright 2005 Bryan O'Sullivan. +Mercurial is copyright 2005-2012 Matt Mackall. +Free use of this software is granted under the terms of the GNU General +Public License version 2 or any later version. + +.. include:: common.txt diff --git a/doc/runrst b/doc/runrst new file mode 100755 index 0000000..8c9d222 --- /dev/null +++ b/doc/runrst @@ -0,0 +1,49 @@ +#!/usr/bin/env python +# +# runrst - register custom roles and run correct writer +# +# Copyright 2010 Matt Mackall <mpm@selenic.com> and others +# +# This software may be used and distributed according to the terms of the +# GNU General Public License version 2 or any later version. + +"""usage: %s WRITER args... + +where WRITER is the name of a Docutils writer such as 'html' or 'manpage' +""" + +import sys +try: + from docutils.parsers.rst import roles + from docutils.core import publish_cmdline + from docutils import nodes, utils +except ImportError: + sys.stderr.write("abort: couldn't generate documentation: docutils " + "module is missing\n") + sys.stderr.write("please install python-docutils or see " + "http://docutils.sourceforge.net/\n") + sys.exit(-1) + +def role_hg(name, rawtext, text, lineno, inliner, + options={}, content=[]): + text = "hg " + utils.unescape(text) + linktext = nodes.literal(rawtext, text) + parts = text.split() + cmd, args = parts[1], parts[2:] + if cmd == 'help' and args: + cmd = args[0] # link to 'dates' for 'hg help dates' + node = nodes.reference(rawtext, '', linktext, + refuri="hg.1.html#%s" % cmd) + return [node], [] + +roles.register_local_role("hg", role_hg) + +if __name__ == "__main__": + if len(sys.argv) < 2: + sys.stderr.write(__doc__ % sys.argv[0]) + sys.exit(1) + + writer = sys.argv[1] + del sys.argv[1] + + publish_cmdline(writer_name=writer) diff --git a/doc/style.css b/doc/style.css new file mode 100644 index 0000000..a35be2b --- /dev/null +++ b/doc/style.css @@ -0,0 +1,309 @@ +/* + * Styles for man pages, which match with http://mercurial.selenic.com/ + * + * Color scheme & layout are borrowed from + * http://mercurial.selenic.com/css/styles.css + * + * Some styles are from html4css1.css from Docutils, which is in the + * public domain. + */ + +body { + margin: 0; + padding: 0; + font-family: sans-serif; +} + +.document { + position: relative; /* be a top of absolute positioning */ + margin: 1.5em 1.8em; + padding: 0; + line-height: 1.3; +} + +/* layout: toc to right */ +#contents { + position: absolute; + right: 0; + top: 0; + width: 26%; +} + +/* layout: others to left */ +h1.title, h2.subtitle, .section { width: 72%; } +.section .section { width: auto; } +table.docinfo { max-width: 72%; } + +/* headings */ +h1, h2, .topic-title, .admonition-title { + font-family: "MgOpen Cosmetica", "Lucida Sans Unicode", sans-serif; + font-weight: normal; +} +h1, h2, .topic-title, .admonition-title { + margin: 1em 0 0.5em; +} +h1.title { font-size: 300%; } +h2.subtitle, h1 { font-size: 200%; } +h2, .topic-title, .admonition-title { font-size: 140%; } + +/* subtitle starts with lowercase in man pages, but not in HTML */ +h2.subtitle:first-letter { text-transform: uppercase; } + +/* override first/last margin */ +.first, h1.title, h2.subtitle { margin-top: 0 !important; } +.last, .with-subtitle { margin-bottom: 0 !important; } + +blockquote, pre, dd .option-list, .field-list { + margin: 0.2em 0 1em 2em; +} + +kbd, tt, pre { font-family: monospace; } + +dt { font-weight: bold; } +dd { margin-bottom: 0.5em; } + +th, td { padding: 0.1em 0.2em; border: 0 none; } +th { font-weight: bold; text-align: left; } + +a:link, a:visited { text-decoration: underline; } +a:hover, a:focus { text-decoration: none; } +a:link { color: #00b5f1; } +a:visited { color: #5c9caf; } +a:link.toc-backref, a:visited.toc-backref { + text-decoration: none; + color: inherit; /* NOTE: `inherit' is not supported by IE6 */ +} + +div.admonition, div.attention, div.caution, +div.danger, div.error, div.hint, div.important, +div.note, div.tip, div.warning { + border-top: 1px #ccc solid; + border-bottom: 1px #ccc solid; + padding: 0.3em 1em; + margin: 1em; +} + +div.note { + border-color: #fcc200; +} + + +/* + * The following styles are from Docutils. + * Please refine if necessary. + */ + +table.borderless td, table.borderless th { + /* Override padding for "table.docutils td" with "! important". + The right padding separates the table cells. */ + padding: 0 0.5em 0 0 ! important; +} + +.hidden { + display: none; +} + +blockquote.epigraph { + margin: 2em 5em; +} + +div.abstract { + margin: 2em 5em; +} + +div.dedication { + margin: 2em 5em; + text-align: center; + font-style: italic; +} + +div.figure { + margin-left: 2em; + margin-right: 2em; +} + +div.footer, div.header { + clear: both; + font-size: smaller; +} + +div.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +div.line-block div.line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +div.sidebar { + margin: 0 0 0.5em 1em; + border: medium outset; + padding: 1em; + background-color: #ffffee; + width: 40%; + float: right; + clear: right; +} + +div.sidebar p.rubric { + font-family: sans-serif; + font-size: medium; +} + +div.system-messages { + margin: 5em; +} + +div.system-messages h1 { + color: red; +} + +div.system-message { + border: medium outset; + padding: 1em; +} + +div.system-message p.system-message-title { + color: red; + font-weight: bold; +} + +h1.section-subtitle, h2.section-subtitle, h3.section-subtitle, +h4.section-subtitle, h5.section-subtitle, h6.section-subtitle { + margin-top: 0.4em; +} + +hr.docutils { + width: 75%; +} + +img.align-left { + clear: left; +} + +img.align-right { + clear: right; +} + +ol.simple, ul.simple { + margin-bottom: 1em; +} + +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + +p.attribution { + text-align: right; + margin-left: 50%; +} + +p.caption { + font-style: italic; +} + +p.credits { + font-style: italic; + font-size: smaller; +} + +p.label { + white-space: nowrap; +} + +p.rubric { + font-weight: bold; + font-size: larger; + color: maroon; + text-align: center; +} + +pre.address { + margin-bottom: 0; + margin-top: 0; + font-family: serif; + font-size: 100%; +} + +pre.literal-block, pre.doctest-block { + margin-left: 2em; + margin-right: 2em; +} + +span.classifier { + font-family: sans-serif; + font-style: oblique; +} + +span.classifier-delimiter { + font-family: sans-serif; + font-weight: bold; +} + +span.interpreted { + font-family: sans-serif; +} + +span.option { + white-space: nowrap; +} + +span.pre { + white-space: pre; +} + +span.problematic { + color: red; +} + +span.section-subtitle { + /* font-size relative to parent (h1..h6 element) */ + font-size: 80%; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.footnote { + border-left: solid 1px black; + margin-left: 1px; +} + +h1 tt.docutils, h2 tt.docutils, h3 tt.docutils, +h4 tt.docutils, h5 tt.docutils, h6 tt.docutils { + font-size: 100%; +} + +ul.auto-toc { + list-style-type: none; +} + +div.contents.local { + -moz-column-width: 10em; + -moz-column-gap: 1em; + + -webkit-column-width: 10em; + -webkit-column-gap: 1em; +} |