diff -Nru mercurial-1.5.4/contrib/check-code.py mercurial-1.6/contrib/check-code.py --- mercurial-1.5.4/contrib/check-code.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/contrib/check-code.py 2010-07-01 18:06:26.000000000 +0100 @@ -7,12 +7,19 @@ # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. -import sys, re, glob +import re, glob +import optparse def repquote(m): - t = re.sub(r"\w", "x", m.group(2)) + t = re.sub(r"\w", "x", m.group('text')) t = re.sub(r"[^\sx]", "o", t) - return m.group(1) + t + m.group(1) + return m.group('quote') + t + m.group('quote') + +def reppython(m): + comment = m.group('comment') + if comment: + return "#" * len(comment) + return repquote(m) def repcomment(m): return m.group(1) + "#" * len(m.group(2)) @@ -54,6 +61,7 @@ (r'[^\n]\Z', "no trailing newline"), (r'export.*=', "don't export and assign at once"), ('^([^"\']|("[^"]*")|(\'[^\']*\'))*\\^', "^ must be quoted"), + (r'^source\b', "don't use 'source', use '.'"), ] testfilters = [ @@ -84,23 +92,29 @@ (r'[\x80-\xff]', "non-ASCII character literal"), (r'("\')\.format\(', "str.format() not available in Python 2.4"), (r'^\s*with\s+', "with not available in Python 2.4"), + (r'(?< ](\+=|-=|!=|<>|<=|>=|<<=|>>=)\S', "missing whitespace around operator"), - (r'[^>< ](\+=|-=|!=|<>|<=|>=|<<=|>>=)\s', "missing whitespace around operator"), - (r'\s(\+=|-=|!=|<>|<=|>=|<<=|>>=)\S', "missing whitespace around operator"), - (r'[^+=*!<>&| -](\s=|=\s)[^= ]', "wrong whitespace around ="), + (r'[^>< ](\+=|-=|!=|<>|<=|>=|<<=|>>=)\S', + "missing whitespace around operator"), + (r'[^>< ](\+=|-=|!=|<>|<=|>=|<<=|>>=)\s', + "missing whitespace around operator"), + (r'\s(\+=|-=|!=|<>|<=|>=|<<=|>>=)\S', + "missing whitespace around operator"), + (r'[^+=*!<>&| -](\s=|=\s)[^= ]', + "wrong whitespace around ="), (r'raise Exception', "don't raise generic exceptions"), - (r'ui\.(status|progress|write|note)\([\'\"]x', "unwrapped ui message"), + (r'ui\.(status|progress|write|note)\([\'\"]x', + "warning: unwrapped ui message"), ] pyfilters = [ - (r"""(''')(([^']|\\'|'{1,2}(?!'))*)'''""", repquote), - (r'''(""")(([^"]|\\"|"{1,2}(?!"))*)"""''', repquote), - (r'''(?\#.*?$)| + ((?P('''|\"\"\"|(?(([^\\]|\\.)*?)) + (?P=quote))""", reppython), ] cpats = [ @@ -123,7 +137,7 @@ cfilters = [ (r'(/\*)(((\*(?!/))|[^*])*)\*/', repccomment), - (r'''(?(?([^"]|\\")+)"(?!")''', repquote), (r'''(#\s*include\s+<)([^>]+)>''', repinclude), (r'(\()([^)]+\))', repcallspaces), ] @@ -134,12 +148,42 @@ ('c', r'.*\.c$', cfilters, cpats), ] -if len(sys.argv) == 1: - check = glob.glob("*") -else: - check = sys.argv[1:] - -for f in check: +class norepeatlogger(object): + def __init__(self): + self._lastseen = None + + def log(self, fname, lineno, line, msg): + """print error related a to given line of a given file. + + The faulty line will also be printed but only once in the case + of multiple errors. + + :fname: filename + :lineno: line number + :line: actual content of the line + :msg: error message + """ + msgid = fname, lineno, line + if msgid != self._lastseen: + print "%s:%d:" % (fname, lineno) + print " > %s" % line + self._lastseen = msgid + print " " + msg + +_defaultlogger = norepeatlogger() + +def checkfile(f, logfunc=_defaultlogger.log, maxerr=None, warnings=False): + """checks style and portability of a given file + + :f: filepath + :logfunc: function used to report error + logfunc(filename, linenumber, linecontent, errormessage) + :maxerr: number of error to display before arborting. + Set to None (default) to report all errors + + return True if no error is found, False otherwise. + """ + result = True for name, match, filters, pats in checks: fc = 0 if not re.match(match, f): @@ -154,16 +198,34 @@ for n, l in z: if "check-code" + "-ignore" in l[0]: continue - lc = 0 for p, msg in pats: + if not warnings and msg.startswith("warning"): + continue if re.search(p, l[1]): - if not lc: - print "%s:%d:" % (f, n + 1) - print " > %s" % l[0] - print " %s" % msg - lc += 1 + logfunc(f, n + 1, l[0], msg) fc += 1 - if fc == 15: + result = False + if maxerr is not None and fc >= maxerr: print " (too many errors, giving up)" break break + return result + + +if __name__ == "__main__": + parser = optparse.OptionParser("%prog [options] [files]") + parser.add_option("-w", "--warnings", action="store_true", + help="include warning-level checks") + parser.add_option("-p", "--per-file", type="int", + help="max warnings per file") + + parser.set_defaults(per_file=15, warnings=False) + (options, args) = parser.parse_args() + + if len(args) == 0: + check = glob.glob("*") + else: + check = args + + for f in check: + checkfile(f, maxerr=options.per_file, warnings=options.warnings) diff -Nru mercurial-1.5.4/contrib/git-viz/git-cat-file mercurial-1.6/contrib/git-viz/git-cat-file --- mercurial-1.5.4/contrib/git-viz/git-cat-file 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/contrib/git-viz/git-cat-file 1970-01-01 01:00:00.000000000 +0100 @@ -1,5 +0,0 @@ -#!/bin/sh - -op=`basename $0 | sed -e 's/^git-//'` -exec hgit $op "$@" - diff -Nru mercurial-1.5.4/contrib/git-viz/git-diff-tree mercurial-1.6/contrib/git-viz/git-diff-tree --- mercurial-1.5.4/contrib/git-viz/git-diff-tree 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/contrib/git-viz/git-diff-tree 1970-01-01 01:00:00.000000000 +0100 @@ -1,5 +0,0 @@ -#!/bin/sh - -op=`basename $0 | sed -e 's/^git-//'` -exec hgit $op "$@" - diff -Nru mercurial-1.5.4/contrib/git-viz/git-rev-list mercurial-1.6/contrib/git-viz/git-rev-list --- mercurial-1.5.4/contrib/git-viz/git-rev-list 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/contrib/git-viz/git-rev-list 1970-01-01 01:00:00.000000000 +0100 @@ -1,5 +0,0 @@ -#!/bin/sh - -op=`basename $0 | sed -e 's/^git-//'` -exec hgit $op "$@" - diff -Nru mercurial-1.5.4/contrib/git-viz/git-rev-tree mercurial-1.6/contrib/git-viz/git-rev-tree --- mercurial-1.5.4/contrib/git-viz/git-rev-tree 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/contrib/git-viz/git-rev-tree 1970-01-01 01:00:00.000000000 +0100 @@ -1,5 +0,0 @@ -#!/bin/sh - -op=`basename $0 | sed -e 's/^git-//'` -exec hgit $op "$@" - diff -Nru mercurial-1.5.4/contrib/git-viz/hg-viz mercurial-1.6/contrib/git-viz/hg-viz --- mercurial-1.5.4/contrib/git-viz/hg-viz 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/contrib/git-viz/hg-viz 1970-01-01 01:00:00.000000000 +0100 @@ -1,26 +0,0 @@ -#!/bin/sh - -set -e - -if test x"$1" != x ; then - cd $1 -fi - -if [ ! -d ".hg" ]; then - echo "${1:-.} is not a mercurial repository" 1>&2 - echo "Aborting" 1>&2 - exit 1 -fi -if [ ! -d ".git" ]; then - mkdir -v ".git" -fi -if [ -e ".git/HEAD" ]; then - if [ ! -e ".git/HEAD.hg-viz-save" ]; then - mv -v ".git/HEAD" ".git/HEAD.hg-viz-save" - else - rm -vf ".git/HEAD" - fi -fi -hg history | head -1 | awk -F: '{print $3}' > .git/HEAD -git-viz - diff -Nru mercurial-1.5.4/contrib/hgdiff mercurial-1.6/contrib/hgdiff --- mercurial-1.5.4/contrib/hgdiff 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/contrib/hgdiff 1970-01-01 01:00:00.000000000 +0100 @@ -1,105 +0,0 @@ -#!/usr/bin/env python - -import os, sys, struct, stat -import difflib -import re -from optparse import OptionParser -from mercurial.bdiff import bdiff, blocks -from mercurial.mdiff import bunidiff, diffopts - -VERSION="0.3" -usage = "usage: %prog [options] file1 file2" -parser = OptionParser(usage=usage) - -parser.add_option("-d", "--difflib", action="store_true", default=False) -parser.add_option('-x', '--count', default=1) -parser.add_option('-c', '--context', type="int", default=3) -parser.add_option('-p', '--show-c-function', action="store_true", default=False) -parser.add_option('-w', '--ignore-all-space', action="store_true", - default=False) - -(options, args) = parser.parse_args() - -if not args: - parser.print_help() - sys.exit(1) - -# simple utility function to put all the -# files from a directory tree into a dict -def buildlist(names, top): - tlen = len(top) - for root, dirs, files in os.walk(top): - l = root[tlen + 1:] - for x in files: - p = os.path.join(root, x) - st = os.lstat(p) - if stat.S_ISREG(st.st_mode): - names[os.path.join(l, x)] = (st.st_dev, st.st_ino) - -def diff_files(file1, file2): - if file1 is None: - b = file(file2).read().splitlines(True) - l1 = "--- %s\n" % (file2) - l2 = "+++ %s\n" % (file2) - l3 = "@@ -0,0 +1,%d @@\n" % len(b) - l = [l1, l2, l3] + ["+" + e for e in b] - elif file2 is None: - a = file(file1).read().splitlines(True) - l1 = "--- %s\n" % (file1) - l2 = "+++ %s\n" % (file1) - l3 = "@@ -1,%d +0,0 @@\n" % len(a) - l = [l1, l2, l3] + ["-" + e for e in a] - else: - t1 = file(file1).read() - t2 = file(file2).read() - l1 = t1.splitlines(True) - l2 = t2.splitlines(True) - if options.difflib: - l = difflib.unified_diff(l1, l2, file1, file2) - else: - l = bunidiff(t1, t2, l1, l2, file1, file2, - diffopts(context=options.context, - showfunc=options.show_c_function, - ignorews=options.ignore_all_space)) - for x in l: - if x[-1] != '\n': - x += "\n\ No newline at end of file\n" - print x, - -file1 = args[0] -file2 = args[1] - -if os.path.isfile(file1) and os.path.isfile(file2): - diff_files(file1, file2) -elif os.path.isdir(file1): - if not os.path.isdir(file2): - sys.stderr.write("file types don't match\n") - sys.exit(1) - - d1 = {} - d2 = {} - - buildlist(d1, file1) - buildlist(d2, file2) - keys = d1.keys() - keys.sort() - for x in keys: - if x not in d2: - f2 = None - else: - f2 = os.path.join(file2, x) - st1 = d1[x] - st2 = d2[x] - del d2[x] - if st1[0] == st2[0] and st1[1] == st2[1]: - sys.stderr.write("%s is a hard link\n" % x) - continue - x = os.path.join(file1, x) - diff_files(x, f2) - keys = d2.keys() - keys.sort() - for x in keys: - f1 = None - x = os.path.join(file2, x) - diff_files(f1, x) - diff -Nru mercurial-1.5.4/contrib/hgwebdir.fcgi mercurial-1.6/contrib/hgwebdir.fcgi --- mercurial-1.5.4/contrib/hgwebdir.fcgi 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/contrib/hgwebdir.fcgi 1970-01-01 01:00:00.000000000 +0100 @@ -1,62 +0,0 @@ -#!/usr/bin/env python -# -# An example CGI script to export multiple hgweb repos, edit as necessary - -# adjust python path if not a system-wide install: -#import sys -#sys.path.insert(0, "/path/to/python/lib") - -# enable demandloading to reduce startup time -from mercurial import demandimport; demandimport.enable() - -# Uncomment to send python tracebacks to the browser if an error occurs: -#import cgitb -#cgitb.enable() - -# If you'd like to serve pages with UTF-8 instead of your default -# locale charset, you can do so by uncommenting the following lines. -# Note that this will cause your .hgrc files to be interpreted in -# UTF-8 and all your repo files to be displayed using UTF-8. -# -#import os -#os.environ["HGENCODING"] = "UTF-8" - -from mercurial.hgweb.hgwebdir_mod import hgwebdir -from flup.server.fcgi import WSGIServer - -# The config file looks like this. You can have paths to individual -# repos, collections of repos in a directory tree, or both. -# -# [paths] -# virtual/path1 = /real/path1 -# virtual/path2 = /real/path2 -# virtual/root = /real/root/* -# / = /real/root2/* -# -# [collections] -# /prefix/to/strip/off = /root/of/tree/full/of/repos -# -# paths example: -# -# * First two lines mount one repository into one virtual path, like -# '/real/path1' into 'virtual/path1'. -# -# * The third entry tells every mercurial repository found in -# '/real/root', recursively, should be mounted in 'virtual/root'. This -# format is preferred over the [collections] one, using absolute paths -# as configuration keys is not supported on every platform (including -# Windows). -# -# * The last entry is a special case mounting all repositories in -# '/real/root2' in the root of the virtual directory. -# -# collections example: say directory tree /foo contains repos /foo/bar, -# /foo/quux/baz. Give this config section: -# [collections] -# /foo = /foo -# Then repos will list as bar and quux/baz. -# -# Alternatively you can pass a list of ('virtual/path', '/real/path') tuples -# or use a dictionary with entries like 'virtual/path': '/real/path' - -WSGIServer(hgwebdir('hgweb.config')).run() diff -Nru mercurial-1.5.4/contrib/hgwebdir.wsgi mercurial-1.6/contrib/hgwebdir.wsgi --- mercurial-1.5.4/contrib/hgwebdir.wsgi 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/contrib/hgwebdir.wsgi 1970-01-01 01:00:00.000000000 +0100 @@ -1,51 +0,0 @@ -# An example WSGI (use with mod_wsgi) script to export multiple hgweb repos - -# adjust python path if not a system-wide install: -#import sys -#sys.path.insert(0, "/path/to/python/lib") - -# enable demandloading to reduce startup time -from mercurial import demandimport; demandimport.enable() -from mercurial.hgweb.hgwebdir_mod import hgwebdir - -# If you'd like to serve pages with UTF-8 instead of your default -# locale charset, you can do so by uncommenting the following lines. -# Note that this will cause your .hgrc files to be interpreted in -# UTF-8 and all your repo files to be displayed using UTF-8. -# -#import os -#os.environ["HGENCODING"] = "UTF-8" - -# The config file looks like this. You can have paths to individual -# repos, collections of repos in a directory tree, or both. -# -# [paths] -# virtual/path1 = /real/path1 -# virtual/path2 = /real/path2 -# virtual/root = /real/root/* -# / = /real/root2/* -# -# paths example: -# -# * First two lines mount one repository into one virtual path, like -# '/real/path1' into 'virtual/path1'. -# -# * The third entry tells every mercurial repository found in -# '/real/root', recursively, should be mounted in 'virtual/root'. This -# format is preferred over the [collections] one, using absolute paths -# as configuration keys is not supported on every platform (including -# Windows). -# -# * The last entry is a special case mounting all repositories in -# '/real/root2' in the root of the virtual directory. -# -# collections example: say directory tree /foo contains repos /foo/bar, -# /foo/quux/baz. Give this config section: -# [collections] -# /foo = /foo -# Then repos will list as bar and quux/baz. -# -# Alternatively you can pass a list of ('virtual/path', '/real/path') tuples -# or use a dictionary with entries like 'virtual/path': '/real/path' - -application = hgwebdir('hgweb.config') diff -Nru mercurial-1.5.4/contrib/hgweb.fcgi mercurial-1.6/contrib/hgweb.fcgi --- mercurial-1.5.4/contrib/hgweb.fcgi 1970-01-01 01:00:00.000000000 +0100 +++ mercurial-1.6/contrib/hgweb.fcgi 2010-07-01 18:06:26.000000000 +0100 @@ -0,0 +1,18 @@ +#!/usr/bin/env python +# +# An example FastCGI script for use with flup, edit as necessary + +# Path to repo or hgweb config to serve (see 'hg help hgweb') +config = "/path/to/repo/or/config" + +# Uncomment and adjust if Mercurial is not installed system-wide: +#import sys; sys.path.insert(0, "/path/to/python/lib") + +# Uncomment to send python tracebacks to the browser if an error occurs: +#import cgitb; cgitb.enable() + +from mercurial import demandimport; demandimport.enable() +from mercurial.hgweb import hgweb +from flup.server.fcgi import WSGIServer +application = hgweb(config) +WSGIServer(application).run() diff -Nru mercurial-1.5.4/contrib/hgweb.wsgi mercurial-1.6/contrib/hgweb.wsgi --- mercurial-1.5.4/contrib/hgweb.wsgi 1970-01-01 01:00:00.000000000 +0100 +++ mercurial-1.6/contrib/hgweb.wsgi 2010-07-01 18:06:26.000000000 +0100 @@ -0,0 +1,16 @@ +# An example WSGI for use with mod_wsgi, edit as necessary + +# Path to repo or hgweb config to serve (see 'hg help hgweb') +config = "/path/to/repo/or/config" + +# Uncomment and adjust if Mercurial is not installed system-wide: +#import sys; sys.path.insert(0, "/path/to/python/lib") + +# Uncomment to send python tracebacks to the browser if an error occurs: +#import cgitb; cgitb.enable() + +# enable demandloading to reduce startup time +from mercurial import demandimport; demandimport.enable() + +from mercurial.hgweb import hgweb +application = hgweb(config) diff -Nru mercurial-1.5.4/contrib/logo-droplets.svg mercurial-1.6/contrib/logo-droplets.svg --- mercurial-1.5.4/contrib/logo-droplets.svg 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/contrib/logo-droplets.svg 2010-07-01 18:06:26.000000000 +0100 @@ -1,624 +1,5 @@ -image/svg+xmlMercurial "droplets" logoCali Mastny and Matt MackallFeb 12 2008 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file +image/svg+xmlMercurial "droplets" logoCali Mastny and Matt MackallFeb 12 2008 + + diff -Nru mercurial-1.5.4/contrib/mercurial.spec mercurial-1.6/contrib/mercurial.spec --- mercurial-1.5.4/contrib/mercurial.spec 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/contrib/mercurial.spec 2010-07-01 18:06:26.000000000 +0100 @@ -38,14 +38,10 @@ %install rm -rf $RPM_BUILD_ROOT -python setup.py install --root $RPM_BUILD_ROOT --prefix %{_prefix} -make install-doc DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} +make install DESTDIR=$RPM_BUILD_ROOT PREFIX=%{_prefix} MANDIR=%{_mandir} install contrib/hgk $RPM_BUILD_ROOT%{_bindir} -install contrib/convert-repo $RPM_BUILD_ROOT%{_bindir}/mercurial-convert-repo install contrib/hg-ssh $RPM_BUILD_ROOT%{_bindir} -install contrib/git-viz/hg-viz $RPM_BUILD_ROOT%{_bindir} -install contrib/git-viz/git-rev-tree $RPM_BUILD_ROOT%{_bindir} bash_completion_dir=$RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d mkdir -p $bash_completion_dir @@ -77,9 +73,6 @@ %{_bindir}/hg %{_bindir}/hgk %{_bindir}/hg-ssh -%{_bindir}/hg-viz -%{_bindir}/git-rev-tree -%{_bindir}/mercurial-convert-repo %dir %{_sysconfdir}/bash_completion.d/ %dir %{_datadir}/zsh/site-functions/ %dir %{_sysconfdir}/mercurial diff -Nru mercurial-1.5.4/contrib/mergetools.hgrc mercurial-1.6/contrib/mergetools.hgrc --- mercurial-1.5.4/contrib/mergetools.hgrc 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/contrib/mergetools.hgrc 2010-07-01 18:06:26.000000000 +0100 @@ -6,6 +6,7 @@ kdiff3.regappend=\kdiff3.exe kdiff3.fixeol=True kdiff3.gui=True +kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child gvimdiff.args=--nofork -d -g -O $local $other $base gvimdiff.regkey=Software\Vim\GVim @@ -13,20 +14,23 @@ gvimdiff.priority=-9 merge.checkconflicts=True -merge.priority=-10 +merge.priority=-100 gpyfm.gui=True meld.gui=True meld.args=--label='local' $local --label='base' $base --label='other' $other +meld.diffargs=-a --label='$plabel1' $parent --label='$clabel' $child tkdiff.args=$local $other -a $base -o $output tkdiff.gui=True tkdiff.priority=-8 +tkdiff.diffargs=-L '$plabel1' $parent -L '$clabel' $child xxdiff.args=--show-merged-pane --exit-with-merge-status --title1 local --title2 base --title3 other --merged-filename $output --merge $local $base $other xxdiff.gui=True xxdiff.priority=-8 +xxdiff.diffargs=--title1 '$plabel1' $parent --title2 '$clabel' $child diffmerge.regkey=Software\SourceGear\SourceGear DiffMerge\ diffmerge.regname=Location @@ -34,6 +38,7 @@ diffmerge.args=-nosplash -merge -title1=local -title2=merged -title3=other $local $base $other -result=$output diffmerge.checkchanged=True diffmerge.gui=True +diffmerge.diffargs=--nosplash --title1='$plabel1' --title2='$clabel' $parent $child p4merge.args=$base $local $other $output p4merge.regkey=Software\Perforce\Environment @@ -41,16 +46,19 @@ p4merge.regappend=\p4merge.exe p4merge.gui=True p4merge.priority=-8 +p4merge.diffargs=$parent $child tortoisemerge.args=/base:$base /mine:$local /theirs:$other /merged:$output tortoisemerge.regkey=Software\TortoiseSVN tortoisemerge.checkchanged=True tortoisemerge.gui=True tortoisemerge.priority=-8 +tortoisemerge.diffargs=/base:$parent /mine:$child /basename:'$plabel1' /minename:'$clabel' ecmerge.args=$base $local $other --mode=merge3 --title0=base --title1=local --title2=other --to=$output ecmerge.regkey=Software\Elli\xc3\xa9 Computing\Merge ecmerge.gui=True +ecmerge.diffargs=$parent $child --mode=diff2 --title1='$plabel1' --title2='$clabel' filemerge.executable=/Developer/Applications/Utilities/FileMerge.app/Contents/MacOS/FileMerge filemerge.args=-left $other -right $local -ancestor $base -merge $output @@ -62,12 +70,14 @@ beyondcompare3.regname=ExePath beyondcompare3.gui=True beyondcompare3.priority=-2 +beyondcompare3.diffargs=/lro /lefttitle='$plabel1' /righttitle='$clabel' /solo /expandall $parent $child ; Linux version of Beyond Compare bcompare.args=$local $other $base -mergeoutput=$output -ro -lefttitle=parent1 -centertitle=base -righttitle=parent2 -outputtitle=merged -automerge -reviewconflicts -solo bcompare.premerge=False bcompare.gui=True bcompare.priority=-1 +bcompare.diffargs=-lro -lefttitle='$plabel1' -righttitle='$clabel' -solo -expandall $parent $child winmerge.args=/e /x /wl /ub /dl other /dr local $other $local $output winmerge.regkey=Software\Thingamahoochie\WinMerge @@ -75,6 +85,7 @@ winmerge.checkchanged=True winmerge.gui=True winmerge.priority=-10 +winmerge.diffargs=/r /e /x /ub /wl /dl '$plabel1' /dr '$clabel' $parent $child araxis.regkey=SOFTWARE\Classes\TypeLib\{46799e0a-7bd1-4330-911c-9660bb964ea2}\7.0\HELPDIR araxis.regappend=\ConsoleCompare.exe @@ -84,3 +95,18 @@ araxis.checkconflict=True araxis.binary=True araxis.gui=True +araxis.diffargs=/2 /wait /title1:"$plabel1" /title2:"$clabel" $parent $child + +diffuse.priority=-3 +diffuse.args=$local $base $other +diffuse.gui=True +diffuse.diffargs=$parent $child + +UltraCompare.regkey=Software\Microsoft\Windows\CurrentVersion\App Paths\UC.exe +UltraCompare.args = $base $local $other -title1 base -title3 other +UltraCompare.priority = -2 +UltraCompare.gui = True +UltraCompare.binary = True +UltraCompare.checkconflicts = True +UltraCompare.checkchanged = True +UltraCompare.diffargs=$child $parent -title1 $clabel -title2 $plabel1 diff -Nru mercurial-1.5.4/contrib/rewrite-log mercurial-1.6/contrib/rewrite-log --- mercurial-1.5.4/contrib/rewrite-log 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/contrib/rewrite-log 1970-01-01 01:00:00.000000000 +0100 @@ -1,23 +0,0 @@ -#!/usr/bin/env python -import sys, os -from mercurial import revlog, transaction, node, util - -f = sys.argv[1] - -r1 = revlog.revlog(util.opener(os.getcwd(), audit=False), f + ".i", f + ".d") -r2 = revlog.revlog(util.opener(os.getcwd(), audit=False), f + ".i2", f + ".d2") - -tr = transaction.transaction(sys.stderr.write, open, "journal") - -for i in xrange(r1.count()): - n = r1.node(i) - p1, p2 = r1.parents(n) - l = r1.linkrev(n) - t = r1.revision(n) - n2 = r2.addrevision(t, tr, l, p1, p2) -tr.close() - -os.rename(f + ".i", f + ".i.old") -os.rename(f + ".d", f + ".d.old") -os.rename(f + ".i2", f + ".i") -os.rename(f + ".d2", f + ".d") diff -Nru mercurial-1.5.4/contrib/sample.hgrc mercurial-1.6/contrib/sample.hgrc --- mercurial-1.5.4/contrib/sample.hgrc 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/contrib/sample.hgrc 2010-07-01 18:06:26.000000000 +0100 @@ -73,9 +73,9 @@ # hgext.churn = /home/user/hg/hg/contrib/churn.py -### win32text - line ending conversion filters for the Windows platform +### eol - automatic management of line endings -# hgext.win32text = +# hgext.eol = ### --- hgk additional configuration diff -Nru mercurial-1.5.4/contrib/shrink-revlog.py mercurial-1.6/contrib/shrink-revlog.py --- mercurial-1.5.4/contrib/shrink-revlog.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/contrib/shrink-revlog.py 2010-07-01 18:06:26.000000000 +0100 @@ -24,50 +24,81 @@ from mercurial import changegroup from mercurial.i18n import _ -def toposort(ui, rl): - children = {} - root = [] - # build children and roots +def postorder(start, edges): + result = [] + visit = list(start) + finished = set() + + while visit: + cur = visit[-1] + for p in edges[cur]: + if p not in finished: + visit.append(p) + break + else: + result.append(cur) + finished.add(cur) + visit.pop() + + return result + +def toposort_reversepostorder(ui, rl): + # postorder of the reverse directed graph + + # map rev to list of parent revs (p2 first) + parents = {} + heads = set() ui.status(_('reading revs\n')) try: - for i in rl: - ui.progress(_('reading'), i, total=len(rl)) - children[i] = [] - parents = [p for p in rl.parentrevs(i) if p != node.nullrev] - # in case of duplicate parents - if len(parents) == 2 and parents[0] == parents[1]: - del parents[1] - for p in parents: - assert p in children - children[p].append(i) + for rev in rl: + ui.progress(_('reading'), rev, total=len(rl)) + (p1, p2) = rl.parentrevs(rev) + if p1 == p2 == node.nullrev: + parents[rev] = () # root node + elif p1 == p2 or p2 == node.nullrev: + parents[rev] = (p1,) # normal node + else: + parents[rev] = (p2, p1) # merge node + heads.add(rev) + for p in parents[rev]: + heads.discard(p) + finally: + ui.progress(_('reading'), None) + + heads = list(heads) + heads.sort(reverse=True) - if len(parents) == 0: - root.append(i) + ui.status(_('sorting revs\n')) + return postorder(heads, parents) + +def toposort_postorderreverse(ui, rl): + # reverse-postorder of the reverse directed graph + + children = {} + roots = set() + ui.status(_('reading revs\n')) + try: + for rev in rl: + ui.progress(_('reading'), rev, total=len(rl)) + (p1, p2) = rl.parentrevs(rev) + if p1 == p2 == node.nullrev: + roots.add(rev) + children[rev] = [] + if p1 != node.nullrev: + children[p1].append(rev) + if p2 != node.nullrev: + children[p2].append(rev) finally: - ui.progress(_('reading'), None, total=len(rl)) + ui.progress(_('reading'), None) + + roots = list(roots) + roots.sort() - # XXX this is a reimplementation of the 'branchsort' topo sort - # algorithm in hgext.convert.convcmd... would be nice not to duplicate - # the algorithm ui.status(_('sorting revs\n')) - visit = root - ret = [] - while visit: - i = visit.pop(0) - ret.append(i) - if i not in children: - # This only happens if some node's p1 == p2, which can - # happen in the manifest in certain circumstances. - continue - next = [] - for c in children.pop(i): - parents_unseen = [p for p in rl.parentrevs(c) - if p != node.nullrev and p in children] - if len(parents_unseen) == 0: - next.append(c) - visit = next + visit - return ret + result = postorder(roots, children) + result.reverse() + return result def writerevs(ui, r1, r2, order, tr): @@ -89,7 +120,7 @@ chunkiter = changegroup.chunkiter(group) r2.addgroup(chunkiter, unlookup, tr) finally: - ui.progress(_('writing'), None, len(order)) + ui.progress(_('writing'), None) def report(ui, r1, r2): def getsize(r): @@ -118,9 +149,15 @@ % (shrink_percent, shrink_factor)) def shrink(ui, repo, **opts): + """shrink a revlog by reordering revisions + + Rewrites all the entries in some revlog of the current repository + (by default, the manifest log) to save space. + + Different sort algorithms have different performance + characteristics. Use ``--sort`` to select a sort algorithm so you + can determine which works best for your data. """ - Shrink revlog by re-ordering revisions. Will operate on manifest for - the given repository if no other revlog is specified.""" if not repo.local(): raise util.Abort(_('not a local repository: %s') % repo.root) @@ -139,6 +176,12 @@ raise util.Abort(_('--revlog option must specify a revlog in %s, ' 'not %s') % (store, indexfn)) + sortname = opts['sort'] + try: + toposort = globals()['toposort_' + sortname] + except KeyError: + raise util.Abort(_('no such toposort algorithm: %s') % sortname) + if not os.path.exists(indexfn): raise util.Abort(_('no such file: %s') % indexfn) if '00changelog' in indexfn: @@ -147,10 +190,7 @@ ui.write(_('shrinking %s\n') % indexfn) prefix = os.path.basename(indexfn)[:-1] - (tmpfd, tmpindexfn) = tempfile.mkstemp(dir=os.path.dirname(indexfn), - prefix=prefix, - suffix='.i') - os.close(tmpfd) + tmpindexfn = util.mktempcopy(indexfn, emptyok=True) r1 = revlog.revlog(util.opener(os.getcwd(), audit=False), indexfn) r2 = revlog.revlog(util.opener(os.getcwd(), audit=False), tmpindexfn) @@ -187,6 +227,15 @@ try: try: order = toposort(ui, r1) + + suboptimal = 0 + for i in xrange(1, len(order)): + parents = [p for p in r1.parentrevs(order[i]) + if p != node.nullrev] + if parents and order[i - 1] not in parents: + suboptimal += 1 + ui.note(_('%d suboptimal nodes\n') % suboptimal) + writerevs(ui, r1, r2, order, tr) report(ui, r1, r2) tr.close() @@ -202,9 +251,11 @@ # copy files util.os_link(indexfn, oldindexfn) ignoremissing(util.os_link)(datafn, olddatafn) + # rename util.rename(tmpindexfn, indexfn) try: + os.chmod(tmpdatafn, os.stat(datafn).st_mode) util.rename(tmpdatafn, datafn) except OSError, inst: if inst.errno != errno.ENOENT: @@ -229,6 +280,7 @@ 'shrink': (shrink, [('', 'revlog', '', _('index (.i) file of the revlog to shrink')), ('n', 'dry-run', None, _('do not shrink, simulate only')), + ('', 'sort', 'reversepostorder', 'name of sort algorithm to use'), ], _('hg shrink [--revlog PATH]')) } diff -Nru mercurial-1.5.4/contrib/tcsh_completion mercurial-1.6/contrib/tcsh_completion --- mercurial-1.5.4/contrib/tcsh_completion 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/contrib/tcsh_completion 2010-07-01 18:06:26.000000000 +0100 @@ -2,7 +2,7 @@ # tcsh completion for Mercurial # # This file has been auto-generated by tcsh_completion_build.sh for -# Mercurial Distributed SCM (version 1.3.1+269-5d8125bbbbf4) +# Mercurial Distributed SCM (version 1.5.4+154-8b452fe4bf50) # # Copyright (C) 2005 TK Soh. # @@ -32,18 +32,19 @@ 'p/1/(add addremove annotate blame archive \ backout bisect branch branches bundle \ cat clone commit ci copy \ - cp debugancestor debugcheckstate debugcommands debugcomplete \ - debugdata debugdate debugfsinfo debugindex debugindexdot \ - debuginstall debugrebuildstate debugrename debugsetparents debugstate \ - debugsub debugwalk diff export forget \ - grep heads help identify id \ - import patch incoming in init \ - locate log history manifest merge \ - outgoing out parents paths pull \ - push recover remove rm rename \ - mv resolve revert rollback root \ - serve showconfig debugconfig status st \ - summary sum tag tags tip \ - unbundle update up checkout co \ - verify version)/' + cp debugancestor debugbuilddag debugcheckstate debugcommands \ + debugcomplete debugdag debugdata debugdate debugfsinfo \ + debugindex debugindexdot debuginstall debugpushkey debugrebuildstate \ + debugrename debugrevspec debugsetparents debugstate debugsub \ + debugwalk diff export forget grep \ + heads help identify id import \ + patch incoming in init locate \ + log history manifest merge outgoing \ + out parents paths pull push \ + recover remove rm rename mv \ + resolve revert rollback root serve \ + showconfig debugconfig status st summary \ + sum tag tags tip unbundle \ + update up checkout co verify \ + version)/' diff -Nru mercurial-1.5.4/contrib/win32/mercurial.ini mercurial-1.6/contrib/win32/mercurial.ini --- mercurial-1.5.4/contrib/win32/mercurial.ini 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/contrib/win32/mercurial.ini 2010-07-01 18:06:26.000000000 +0100 @@ -43,6 +43,7 @@ ;churn = ;color = ;convert = +;eol = ;extdiff = ;fetch = ;gpg = @@ -63,39 +64,8 @@ ;record = ;transplant = ;win32mbcs = -;win32text = ;zeroconf = -; To use cleverencode/cleverdecode, you must enable win32text extension - -[encode] -; Encode files that don't contain NUL characters. - -; ** = cleverencode: - -; Alternatively, you can explicitly specify each file extension that -; you want encoded (any you omit will be left untouched), like this: - -; *.txt = dumbencode: - - -[decode] -; Decode files that don't contain NUL characters. - -; ** = cleverdecode: - -; Alternatively, you can explicitly specify each file extension that -; you want decoded (any you omit will be left untouched), like this: - -; **.txt = dumbdecode: - -[patch] -; If you enable win32text filtering, you will want to enable this -; line as well to allow patching to work correctly. - -; eol = crlf - - ; ; Define external diff commands ; diff -Nru mercurial-1.5.4/contrib/win32/win32-build.txt mercurial-1.6/contrib/win32/win32-build.txt --- mercurial-1.5.4/contrib/win32/win32-build.txt 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/contrib/win32/win32-build.txt 2010-07-01 18:06:26.000000000 +0100 @@ -82,16 +82,10 @@ Microsoft.VC90.MFC.manifest) Before building the installer, you have to build Mercurial HTML documentation -(or fix mercurial.iss to not reference the doc directory). Docutils does not -come with a ready-made script for rst2html.py, so you will have to write your -own and put it in %PATH% like: - - @python c:\pythonXX\scripts\rst2html.py %* - -Then build the documentation with: +(or fix mercurial.iss to not reference the doc directory): cd doc - mingw32-make RST2HTML=rst2html.bat html + mingw32-make html cd .. If you use ISTool, you open the C:\hg\hg-release\contrib\win32\mercurial.iss @@ -113,7 +107,7 @@ echo compiler=mingw32 >> setup.cfg python setup.py py2exe -b 1 cd doc - mingw32-make RST2HTML=rst2html.bat html + mingw32-make html cd .. iscc contrib\win32\mercurial.iss /DVERSION=snapshot diff -Nru mercurial-1.5.4/contrib/wix/contrib.wxs mercurial-1.6/contrib/wix/contrib.wxs --- mercurial-1.5.4/contrib/wix/contrib.wxs 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/contrib/wix/contrib.wxs 2010-07-01 18:06:26.000000000 +0100 @@ -1,218 +1,42 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru mercurial-1.5.4/contrib/wix/doc.wxs mercurial-1.6/contrib/wix/doc.wxs --- mercurial-1.5.4/contrib/wix/doc.wxs 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/contrib/wix/doc.wxs 2010-07-01 18:06:26.000000000 +0100 @@ -1,33 +1,49 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru mercurial-1.5.4/contrib/wix/guids.wxi mercurial-1.6/contrib/wix/guids.wxi --- mercurial-1.5.4/contrib/wix/guids.wxi 1970-01-01 01:00:00.000000000 +0100 +++ mercurial-1.6/contrib/wix/guids.wxi 2010-07-01 18:06:26.000000000 +0100 @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru mercurial-1.5.4/contrib/wix/help.wxs mercurial-1.6/contrib/wix/help.wxs --- mercurial-1.5.4/contrib/wix/help.wxs 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/contrib/wix/help.wxs 2010-07-01 18:06:26.000000000 +0100 @@ -1,72 +1,25 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff -Nru mercurial-1.5.4/contrib/wix/i18n.wxs mercurial-1.6/contrib/wix/i18n.wxs --- mercurial-1.5.4/contrib/wix/i18n.wxs 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/contrib/wix/i18n.wxs 2010-07-01 18:06:26.000000000 +0100 @@ -1,78 +1,25 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff -Nru mercurial-1.5.4/contrib/wix/locale.wxs mercurial-1.6/contrib/wix/locale.wxs --- mercurial-1.5.4/contrib/wix/locale.wxs 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/contrib/wix/locale.wxs 2010-07-01 18:06:26.000000000 +0100 @@ -1,172 +1,32 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru mercurial-1.5.4/contrib/wix/mercurial.wxs mercurial-1.6/contrib/wix/mercurial.wxs --- mercurial-1.5.4/contrib/wix/mercurial.wxs 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/contrib/wix/mercurial.wxs 2010-07-01 18:06:26.000000000 +0100 @@ -6,24 +6,31 @@ This software may be used and distributed according to the terms of the GNU General Public License version 2 or any later version. --> - - + - + Language='1033' Codepage='1252' Version='$(var.Version)' + Manufacturer='Matt Mackall and others'> - - + - VersionNT >= 501 + VersionNT >= 501 - + @@ -37,30 +44,35 @@ amus + + 1 + - - - + + + - - + + - - + + - - + + - - + + @@ -68,17 +80,16 @@ - + - + - - + - + diff -Nru mercurial-1.5.4/contrib/wix/templates.wxs mercurial-1.6/contrib/wix/templates.wxs --- mercurial-1.5.4/contrib/wix/templates.wxs 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/contrib/wix/templates.wxs 2010-07-01 18:06:26.000000000 +0100 @@ -1,801 +1,206 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru mercurial-1.5.4/debian/changelog mercurial-1.6/debian/changelog --- mercurial-1.5.4/debian/changelog 2010-07-05 23:00:44.000000000 +0100 +++ mercurial-1.6/debian/changelog 2010-07-05 23:00:45.000000000 +0100 @@ -1,3 +1,63 @@ +mercurial (1.6-1ppa1) lucid; urgency=low + + * Merge Debian, remaining changes: + - Update Maintainer field. + - Add version to python-docutils build-dep for correctness. + - Drop version from python-all-dev build-dep and add compatibility code to + debian/rules. + - Revert to source format 1.0. + + -- Max Bowsher Mon, 05 Jul 2010 22:45:32 +0100 + +mercurial (1.6-1) unstable; urgency=low + + [ Javi Merino ] + * New upstream release (1.6). Many bug fixes and improvements. Among + them: + - push: break infinite http recursion bug with Python 2.6.5 + (issue2179 and issue2255) (Closes: #586907) + - zeroconf: Don't use string exceptions (Closes: #585250) + * Removed patch for_upstream__bashism_in_examples.patch since a fix for + #581122 is included upstream. + * Updated Standards-Version to 3.9 (no change needed) + + [ Vincent Danjean ] + * debian/control: + + Use Breaks instead of Conflicts + + Use a fixed version in Replaces + I put 1.4 but it has been a long time since nothing has been moved + from mercurial to mercurial-common + + -- Vincent Danjean Sun, 04 Jul 2010 09:55:28 +0200 + +mercurial (1.5.4-2) unstable; urgency=low + + * Fix regression in python 2.6.5 (Closes: #586907) + + -- Javi Merino Thu, 24 Jun 2010 12:46:57 +0200 + +mercurial (1.5.4-1) unstable; urgency=low + + * New upstream release (1.5.3). Fixes: + * fix Issue2181 (commit generates traceback on Nonetype) + * various improvements to SVN conversion support + * minor doc improvements + * New upstream release (1.5.4) (Closes: #586322). Fixes: + * dispatch: include Python version in traceback + * push: update help + * status: avoid performance regression when no .hgsub is present + * clone: fix performance issue with hardlinks and Windows shares + * hgweb: fix race in refreshing repo list (issue2188) + * hgrc: clarify that hgrc keys can be overridden and sections can be split + * eol: new extension for managing file newlines based on a version + controlled configuration file + * pager: fork and exec pager as parent process with /bin/sh -c + * rebase: stress that only local changesets should be rebased + * convert/svn: close gettags() log stream (issue2196) + * record: check that we are not committing a merge before patch selection + + -- Javi Merino Wed, 16 Jun 2010 09:51:21 +0200 + mercurial (1.5.4-0ppa1) lucid; urgency=low * New upstream release. diff -Nru mercurial-1.5.4/debian/control mercurial-1.6/debian/control --- mercurial-1.5.4/debian/control 2010-07-05 23:00:44.000000000 +0100 +++ mercurial-1.6/debian/control 2010-07-05 23:00:45.000000000 +0100 @@ -4,12 +4,13 @@ Maintainer: Max Bowsher XSBC-Original-Maintainer: Python Applications Packaging Team Uploaders: Vincent Danjean , - Vernon Tang + Vernon Tang , + Javi Merino Build-Depends: debhelper (>= 7.0.50), quilt (>= 0.46-7~), patchutils (>= 0.2.25), gettext, python-support (>= 0.5.3), python-all-dev, python-docutils (>= 0.5), zip, unzip -Standards-Version: 3.8.4 +Standards-Version: 3.9.0 Homepage: http://www.selenic.com/mercurial/ Vcs-Svn: svn://svn.debian.org/python-apps/packages/mercurial/trunk Vcs-Browser: http://svn.debian.org/viewsvn/python-apps/packages/mercurial/trunk/ @@ -22,8 +23,8 @@ python-mysqldb, python-pygments, python-openssl -Conflicts: mercurial (<< ${binary:Version}) -Replaces: mercurial (<< ${binary:Version}) +Breaks: mercurial (<< ${binary:Version}) +Replaces: mercurial (<< 1.4) Description: scalable distributed version control system (common files) Mercurial is a fast, lightweight Source Control Management system designed for efficient handling of very large distributed projects. diff -Nru mercurial-1.5.4/debian/mercurial-common.examples mercurial-1.6/debian/mercurial-common.examples --- mercurial-1.5.4/debian/mercurial-common.examples 2010-07-05 23:00:44.000000000 +0100 +++ mercurial-1.6/debian/mercurial-common.examples 2010-07-05 23:00:45.000000000 +0100 @@ -1,14 +1,11 @@ hgeditor contrib/dumprevlog -contrib/git-viz -contrib/hgdiff contrib/hgsh -contrib/hgwebdir.fcgi -contrib/hgwebdir.wsgi +contrib/hgweb.fcgi +contrib/hgweb.wsgi contrib/mercurial.el contrib/perf.py contrib/python-hook-examples.py -contrib/rewrite-log contrib/sample.hgrc contrib/shrink-revlog.py contrib/simplemerge @@ -19,4 +16,3 @@ contrib/vim contrib/zsh_completion hgweb.cgi -hgwebdir.cgi diff -Nru mercurial-1.5.4/debian/patches/deb_specific__install-help-separately mercurial-1.6/debian/patches/deb_specific__install-help-separately --- mercurial-1.5.4/debian/patches/deb_specific__install-help-separately 2010-07-05 23:00:44.000000000 +0100 +++ mercurial-1.6/debian/patches/deb_specific__install-help-separately 2010-07-05 23:00:45.000000000 +0100 @@ -1,5 +1,17 @@ Support installation of help topics handled by mercurial-common.install. +--- a/setup.py ++++ b/setup.py +@@ -280,8 +280,7 @@ + extmodules.append(inotify) + packages.extend(['hgext.inotify', 'hgext.inotify.linux']) + +-packagedata = {'mercurial': ['locale/*/LC_MESSAGES/hg.mo', +- 'help/*.txt']} ++packagedata = {'mercurial': ['locale/*/LC_MESSAGES/hg.mo']} + + def ordinarypath(p): + return p and p[0] != '.' and p[-1] != '~' --- a/mercurial/help.py +++ b/mercurial/help.py @@ -73,9 +73,11 @@ @@ -10,21 +22,9 @@ for dir in ('.', '..'): - docdir = os.path.join(base, dir, 'help') - if os.path.isdir(docdir): -+ path = os.path.join(base, dir, 'help') -+ if os.path.isdir(path): -+ docdir = path ++ tmpdocdir = os.path.join(base, dir, 'help') ++ if os.path.isdir(tmpdocdir): ++ docdir = tmpdocdir break path = os.path.join(docdir, topic + ".txt") ---- a/setup.py -+++ b/setup.py -@@ -263,8 +263,7 @@ - ['hgext/inotify/linux/_inotify.c'])) - packages.extend(['hgext.inotify', 'hgext.inotify.linux']) - --packagedata = {'mercurial': ['locale/*/LC_MESSAGES/hg.mo', -- 'help/*.txt']} -+packagedata = {'mercurial': ['locale/*/LC_MESSAGES/hg.mo']} - - def ordinarypath(p): - return p and p[0] != '.' and p[-1] != '~' diff -Nru mercurial-1.5.4/debian/patches/deb_specific__install-mo-fhs.patch mercurial-1.6/debian/patches/deb_specific__install-mo-fhs.patch --- mercurial-1.5.4/debian/patches/deb_specific__install-mo-fhs.patch 2010-07-05 23:00:44.000000000 +0100 +++ mercurial-1.6/debian/patches/deb_specific__install-mo-fhs.patch 2010-07-05 23:00:45.000000000 +0100 @@ -12,8 +12,8 @@ break --- a/setup.py +++ b/setup.py -@@ -263,7 +263,7 @@ - ['hgext/inotify/linux/_inotify.c'])) +@@ -280,7 +280,7 @@ + extmodules.append(inotify) packages.extend(['hgext.inotify', 'hgext.inotify.linux']) -packagedata = {'mercurial': ['locale/*/LC_MESSAGES/hg.mo']} diff -Nru mercurial-1.5.4/debian/patches/deb_specific__install-templates-separately mercurial-1.6/debian/patches/deb_specific__install-templates-separately --- mercurial-1.5.4/debian/patches/deb_specific__install-templates-separately 2010-07-05 23:00:44.000000000 +0100 +++ mercurial-1.6/debian/patches/deb_specific__install-templates-separately 2010-07-05 23:00:45.000000000 +0100 @@ -3,17 +3,17 @@ --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -9,7 +9,7 @@ - import re, sys, os + import sys, os import util, config, templatefilters -path = ['templates', '../templates'] +path = ['templates', '../templates', '/usr/share/mercurial/templates'] stringify = templatefilters.stringify - def parsestring(s, quoted=True): + def _flatten(thing): --- a/setup.py +++ b/setup.py -@@ -269,14 +269,6 @@ +@@ -286,14 +286,6 @@ def ordinarypath(p): return p and p[0] != '.' and p[-1] != '~' diff -Nru mercurial-1.5.4/debian/patches/deb_specific__mergetools mercurial-1.6/debian/patches/deb_specific__mergetools --- mercurial-1.5.4/debian/patches/deb_specific__mergetools 2010-07-05 23:00:44.000000000 +0100 +++ mercurial-1.6/debian/patches/deb_specific__mergetools 2010-07-05 23:00:45.000000000 +0100 @@ -2,7 +2,7 @@ --- a/contrib/mergetools.hgrc +++ b/contrib/mergetools.hgrc -@@ -12,8 +12,11 @@ +@@ -13,6 +13,9 @@ gvimdiff.regname=path gvimdiff.priority=-9 @@ -10,8 +10,5 @@ +vimdiff.priority=-10 + merge.checkconflicts=True --merge.priority=-10 -+merge.priority=-11 - - gpyfm.gui=True + merge.priority=-100 diff -Nru mercurial-1.5.4/debian/patches/deb_specific__optional-dependencies mercurial-1.6/debian/patches/deb_specific__optional-dependencies --- mercurial-1.5.4/debian/patches/deb_specific__optional-dependencies 2010-07-05 23:00:44.000000000 +0100 +++ mercurial-1.6/debian/patches/deb_specific__optional-dependencies 2010-07-05 23:00:45.000000000 +0100 @@ -139,7 +139,7 @@ self.lastrevs = {} -@@ -966,6 +970,9 @@ +@@ -953,6 +957,9 @@ return self.join('hg-authormap') def __init__(self, ui, path): @@ -151,13 +151,13 @@ self.delete = [] --- a/mercurial/hgweb/server.py +++ b/mercurial/hgweb/server.py -@@ -260,7 +260,8 @@ - from OpenSSL import SSL - ctx = SSL.Context(SSL.SSLv23_METHOD) - except ImportError: -- raise util.Abort(_("SSL support is unavailable")) -+ raise util.Abort(_("SSL support is unavailable") + -+ _(" (try installing the %s package)") % 'python-openssl') - ctx.use_privatekey_file(ssl_cert) - ctx.use_certificate_file(ssl_cert) - sock = socket.socket(self.address_family, self.socket_type) +@@ -225,7 +225,8 @@ + from OpenSSL import SSL + ctx = SSL.Context(SSL.SSLv23_METHOD) + except ImportError: +- raise util.Abort(_("SSL support is unavailable")) ++ raise util.Abort(_("SSL support is unavailable") + ++ _(" (try installing the %s package)") % 'python-openssl') + ctx.use_privatekey_file(ssl_cert) + ctx.use_certificate_file(ssl_cert) + sock = socket.socket(self.address_family, self.socket_type) diff -Nru mercurial-1.5.4/debian/patches/deb_specific__use_sensible-editor.patch mercurial-1.6/debian/patches/deb_specific__use_sensible-editor.patch --- mercurial-1.5.4/debian/patches/deb_specific__use_sensible-editor.patch 2010-07-05 23:00:44.000000000 +0100 +++ mercurial-1.6/debian/patches/deb_specific__use_sensible-editor.patch 2010-07-05 23:00:45.000000000 +0100 @@ -2,7 +2,7 @@ --- a/doc/hgrc.5.txt +++ b/doc/hgrc.5.txt -@@ -768,7 +768,8 @@ +@@ -829,7 +829,8 @@ ``debug`` Print debugging information. True or False. Default is False. ``editor`` @@ -25,7 +25,7 @@ EDITOR="$EDITOR -nw" --- a/mercurial/commands.py +++ b/mercurial/commands.py -@@ -1054,8 +1054,8 @@ +@@ -1348,8 +1348,8 @@ editor = ui.geteditor() cmdpath = util.find_exe(editor) or util.find_exe(editor.split()[0]) if not cmdpath: @@ -38,7 +38,7 @@ ui.write(_(" Can't find editor '%s' in PATH\n") % editor) --- a/mercurial/ui.py +++ b/mercurial/ui.py -@@ -384,7 +384,7 @@ +@@ -557,7 +557,7 @@ return (os.environ.get("HGEDITOR") or self.config("ui", "editor") or os.environ.get("VISUAL") or @@ -49,7 +49,7 @@ '''show a progress message --- a/i18n/da.po +++ b/i18n/da.po -@@ -5750,7 +5750,7 @@ +@@ -7103,7 +7103,7 @@ msgid "Checking commit editor...\n" msgstr "" @@ -58,27 +58,27 @@ msgstr "" msgid " (specify a commit editor in your .hgrc file)\n" -@@ -8423,7 +8423,7 @@ +@@ -10199,7 +10199,7 @@ " editor it uses is determined by looking at the environment\n" " variables HGEDITOR, VISUAL and EDITOR, in that order. The first\n" " non-empty one is chosen. If all of them are empty, the editor\n" --" defaults to 'vi'.\n" -+" defaults to 'sensible-editor'.\n" - "\n" - "PYTHONPATH\n" - " This is used by Python to find imported modules and may need to be\n" +-" defaults to 'vi'." ++" defaults to 'sensible-editor'." + msgstr "" + + msgid "" --- a/i18n/de.po +++ b/i18n/de.po -@@ -314,7 +314,7 @@ +@@ -340,7 +340,7 @@ " editor it uses is determined by looking at the environment\n" " variables HGEDITOR, VISUAL and EDITOR, in that order. The first\n" " non-empty one is chosen. If all of them are empty, the editor\n" --" defaults to 'vi'.\n" -+" defaults to 'sensible-editor'.\n" - "\n" - "PYTHONPATH\n" - " This is used by Python to find imported modules and may need to be\n" -@@ -6749,8 +6749,8 @@ +-" defaults to 'vi'." ++" defaults to 'sensible-editor'." + msgstr "" + + msgid "" +@@ -16177,8 +16177,8 @@ msgid "Checking commit editor...\n" msgstr "Prüfe Editor für Versionsmeldungen...\n" @@ -91,16 +91,16 @@ msgstr " (Gib einen Editor in der .hgrc Datei an!)\n" --- a/i18n/el.po +++ b/i18n/el.po -@@ -225,7 +225,7 @@ +@@ -274,7 +274,7 @@ " editor it uses is determined by looking at the environment\n" " variables HGEDITOR, VISUAL and EDITOR, in that order. The first\n" " non-empty one is chosen. If all of them are empty, the editor\n" --" defaults to 'vi'.\n" -+" defaults to 'sensible-editor'.\n" - "\n" - "PYTHONPATH\n" - " This is used by Python to find imported modules and may need to be\n" -@@ -5630,7 +5630,7 @@ +-" defaults to 'vi'." ++" defaults to 'sensible-editor'." + msgstr "" + + msgid "" +@@ -11500,7 +11500,7 @@ msgid "Checking commit editor...\n" msgstr "" @@ -111,16 +111,16 @@ msgid " (specify a commit editor in your .hgrc file)\n" --- a/i18n/fr.po +++ b/i18n/fr.po -@@ -260,7 +260,7 @@ +@@ -299,7 +299,7 @@ " editor it uses is determined by looking at the environment\n" " variables HGEDITOR, VISUAL and EDITOR, in that order. The first\n" " non-empty one is chosen. If all of them are empty, the editor\n" --" defaults to 'vi'.\n" -+" defaults to 'sensible-editor'.\n" - "\n" - "PYTHONPATH\n" - " This is used by Python to find imported modules and may need to be\n" -@@ -5803,7 +5803,7 @@ +-" defaults to 'vi'." ++" defaults to 'sensible-editor'." + msgstr "" + + msgid "" +@@ -8228,7 +8228,7 @@ msgid "Checking commit editor...\n" msgstr "" @@ -131,16 +131,16 @@ msgid " (specify a commit editor in your .hgrc file)\n" --- a/i18n/it.po +++ b/i18n/it.po -@@ -181,7 +181,7 @@ +@@ -218,7 +218,7 @@ " editor it uses is determined by looking at the environment\n" " variables HGEDITOR, VISUAL and EDITOR, in that order. The first\n" " non-empty one is chosen. If all of them are empty, the editor\n" --" defaults to 'vi'.\n" -+" defaults to 'sensible-editor'.\n" - "\n" - "PYTHONPATH\n" - " This is used by Python to find imported modules and may need to be\n" -@@ -5553,8 +5553,8 @@ +-" defaults to 'vi'." ++" defaults to 'sensible-editor'." + msgstr "" + + msgid "" +@@ -6230,8 +6230,8 @@ msgid "Checking commit editor...\n" msgstr "Sto controllando l'editor per il commit...\n" @@ -153,7 +153,7 @@ msgstr " (specificare un editore per il commit nel proprio file .hgrc)\n" --- a/i18n/ja.po +++ b/i18n/ja.po -@@ -6171,8 +6171,8 @@ +@@ -7364,8 +7364,8 @@ msgid "Checking commit editor...\n" msgstr "メッセージ入力用エディタの検証中...\n" @@ -164,60 +164,57 @@ msgid " (specify a commit editor in your .hgrc file)\n" msgstr " (コミットメッセージ用エディタを設定ファイルで設定してください)\n" -@@ -9136,7 +9136,7 @@ +@@ -10735,14 +10735,14 @@ " editor it uses is determined by looking at the environment\n" " variables HGEDITOR, VISUAL and EDITOR, in that order. The first\n" " non-empty one is chosen. If all of them are empty, the editor\n" --" defaults to 'vi'.\n" -+" defaults to 'sensible-editor'.\n" - "\n" - "PYTHONPATH\n" - " This is used by Python to find imported modules and may need to be\n" -@@ -9228,7 +9228,7 @@ +-" defaults to 'vi'." ++" defaults to 'sensible-editor'." + msgstr "" + "EDITOR\n" + " コミット時のメッセージのように、エディタでファイルを開き、ユーザによる\n" " 編集を促す状況があります。そこで使用されるエディタは、HGEDITOR、VISUAL\n" " あるいは EDITOR 環境変数に設定されたものを(この順序で)使用します。\n" " 最初の空で無い値に設定された環境変数の値を使用します。いずれも未設定\n" --" (あるいは空)の場合は、'vi' が使用されます。\n" -+" (あるいは空)の場合は、'sensible-editor' が使用されます。\n" - "\n" +-" (あるいは空)の場合は、'vi' が使用されます。" ++" (あるいは空)の場合は、'sensible-editor' が使用されます。" + + msgid "" "PYTHONPATH\n" - " Mercurial が当該システムの共有領域にインストールされていない場合、\n" --- a/i18n/pt_BR.po +++ b/i18n/pt_BR.po -@@ -7323,10 +7323,10 @@ +@@ -8169,8 +8169,8 @@ msgid "Checking commit editor...\n" msgstr "Verificando editor para consolidação...\n" -msgid " No commit editor set and can't find vi in PATH\n" +-msgstr " Nenhum editor para consolidação configurado, e não foi possível encontrar 'vi' no PATH\n" +msgid " No commit editor set and can't find sensible-editor in PATH\n" - msgstr "" - " Nenhum editor para consolidação configurado, e não foi possível encontrar " --"'vi' no PATH\n" -+"'sensible-editor' no PATH\n" ++msgstr " Nenhum editor para consolidação configurado, e não foi possível encontrar 'sensible-editor' no PATH\n" msgid " (specify a commit editor in your .hgrc file)\n" msgstr " (especifique um editor para consolidação em seu arquivo .hgrc)\n" -@@ -10391,7 +10391,7 @@ +@@ -11608,7 +11608,7 @@ " editor it uses is determined by looking at the environment\n" " variables HGEDITOR, VISUAL and EDITOR, in that order. The first\n" " non-empty one is chosen. If all of them are empty, the editor\n" --" defaults to 'vi'.\n" -+" defaults to 'sensible-editor'.\n" - "\n" - "PYTHONPATH\n" - " This is used by Python to find imported modules and may need to be\n" -@@ -10483,7 +10483,7 @@ +-" defaults to 'vi'." ++" defaults to 'sensible-editor'." + msgstr "" + "EDITOR\n" + " Algumas vezes o Mercurial precisa abrir em um editor um arquivo\n" +@@ -11616,7 +11616,7 @@ " mensagens de consolidação. O editor usado é determinado pela\n" " consulta às variáveis de ambiente HGEDITOR, VISUAL e EDITOR,\n" " nessa ordem. O primeiro valor não vazio é escolhido. Se todos\n" --" estiverem vazios, o editor será o 'vi'.\n" -+" estiverem vazios, o editor será o 'sensible-editor'.\n" - "\n" +-" estiverem vazios, o editor será o 'vi'." ++" estiverem vazios, o editor será o 'sensible-editor'." + + msgid "" "PYTHONPATH\n" - " Isto é usado pelo Python para localizar módulos importados, e\n" --- a/i18n/sv.po +++ b/i18n/sv.po -@@ -5459,7 +5459,7 @@ +@@ -6784,7 +6784,7 @@ msgid "Checking commit editor...\n" msgstr "" @@ -226,18 +223,18 @@ msgstr "" msgid " (specify a commit editor in your .hgrc file)\n" -@@ -8373,7 +8373,7 @@ +@@ -10043,7 +10043,7 @@ " editor it uses is determined by looking at the environment\n" " variables HGEDITOR, VISUAL and EDITOR, in that order. The first\n" " non-empty one is chosen. If all of them are empty, the editor\n" --" defaults to 'vi'.\n" -+" defaults to 'sensible-editor'.\n" - "\n" - "PYTHONPATH\n" - " This is used by Python to find imported modules and may need to be\n" +-" defaults to 'vi'." ++" defaults to 'sensible-editor'." + msgstr "" + + msgid "" --- a/i18n/zh_CN.po +++ b/i18n/zh_CN.po -@@ -5190,7 +5190,7 @@ +@@ -5880,7 +5880,7 @@ msgid "Checking commit editor...\n" msgstr "" @@ -246,27 +243,27 @@ msgstr "" msgid " (specify a commit editor in your .hgrc file)\n" -@@ -7565,7 +7565,7 @@ +@@ -8768,7 +8768,7 @@ " editor it uses is determined by looking at the environment\n" " variables HGEDITOR, VISUAL and EDITOR, in that order. The first\n" " non-empty one is chosen. If all of them are empty, the editor\n" --" defaults to 'vi'.\n" -+" defaults to 'sensible-editor'.\n" - "\n" - "PYTHONPATH\n" - " This is used by Python to find imported modules and may need to be\n" +-" defaults to 'vi'." ++" defaults to 'sensible-editor'." + msgstr "" + + msgid "" --- a/i18n/zh_TW.po +++ b/i18n/zh_TW.po -@@ -182,7 +182,7 @@ +@@ -219,7 +219,7 @@ " editor it uses is determined by looking at the environment\n" " variables HGEDITOR, VISUAL and EDITOR, in that order. The first\n" " non-empty one is chosen. If all of them are empty, the editor\n" --" defaults to 'vi'.\n" -+" defaults to 'sensible-editor'.\n" - "\n" - "PYTHONPATH\n" - " This is used by Python to find imported modules and may need to be\n" -@@ -5501,7 +5501,7 @@ +-" defaults to 'vi'." ++" defaults to 'sensible-editor'." + msgstr "" + + msgid "" +@@ -6828,7 +6828,7 @@ msgid "Checking commit editor...\n" msgstr "" diff -Nru mercurial-1.5.4/debian/patches/for_upstream__add_doc_url_in_example_files.patch mercurial-1.6/debian/patches/for_upstream__add_doc_url_in_example_files.patch --- mercurial-1.5.4/debian/patches/for_upstream__add_doc_url_in_example_files.patch 2010-07-05 23:00:44.000000000 +0100 +++ mercurial-1.6/debian/patches/for_upstream__add_doc_url_in_example_files.patch 2010-07-05 23:00:45.000000000 +0100 @@ -1,11 +1,11 @@ Add a pointer (URL) on top of the hgwebdir.wsgi file for the corresponding wifi documentation. ---- a/contrib/hgwebdir.wsgi -+++ b/contrib/hgwebdir.wsgi +--- a/contrib/hgweb.wsgi ++++ b/contrib/hgweb.wsgi @@ -1,4 +1,5 @@ - # An example WSGI (use with mod_wsgi) script to export multiple hgweb repos + # An example WSGI for use with mod_wsgi, edit as necessary +# See http://mercurial.selenic.com/wiki/modwsgi for more information - # adjust python path if not a system-wide install: - #import sys + # Path to repo or hgweb config to serve (see 'hg help hgweb') + config = "/path/to/repo/or/config" diff -Nru mercurial-1.5.4/debian/patches/for_upstream__bashism_in_examples.patch mercurial-1.6/debian/patches/for_upstream__bashism_in_examples.patch --- mercurial-1.5.4/debian/patches/for_upstream__bashism_in_examples.patch 2010-07-05 23:00:44.000000000 +0100 +++ mercurial-1.6/debian/patches/for_upstream__bashism_in_examples.patch 1970-01-01 01:00:00.000000000 +0100 @@ -1,10 +0,0 @@ -Fix bashism in hgeditor -Close: #581122 ---- a/hgeditor -+++ b/hgeditor -@@ -1,4 +1,4 @@ --#!/bin/sh -+#!/bin/bash - # - # This is an example of using HGEDITOR to create of diff to review the - # changes while commiting. diff -Nru mercurial-1.5.4/debian/patches/series mercurial-1.6/debian/patches/series --- mercurial-1.5.4/debian/patches/series 2010-07-05 23:00:44.000000000 +0100 +++ mercurial-1.6/debian/patches/series 2010-07-05 23:00:45.000000000 +0100 @@ -8,4 +8,3 @@ deb_specific__optional-dependencies proposed_upstream__correct-zeroconf-doc deb_specific__install-mo-fhs.patch -for_upstream__bashism_in_examples.patch diff -Nru mercurial-1.5.4/debian/rules mercurial-1.6/debian/rules --- mercurial-1.5.4/debian/rules 2010-07-05 23:00:44.000000000 +0100 +++ mercurial-1.6/debian/rules 2010-07-05 23:00:45.000000000 +0100 @@ -41,7 +41,6 @@ install -m 644 \ contrib/bash_completion \ $(CURDIR)/debian/mercurial/etc/bash_completion.d/mercurial - # Install system-wide conffiles echo "# system-wide mercurial configuration file" \ > $(CURDIR)/debian/mercurial/etc/mercurial/hgrc @@ -50,7 +49,6 @@ install -m 644 \ contrib/mergetools.hgrc \ $(CURDIR)/debian/mercurial/etc/mercurial/hgrc.d/mergetools.rc - # remove arch-independent python stuff find debian/mercurial/usr/lib \ ! -name '*.so' ! -type d -delete , \ @@ -62,7 +60,7 @@ -name '*.so' ! -type d -delete , \ -type d -empty -delete -override_dh_auto_clean: +override_dh_auto_clean: mercurial/__version__.py cp -a mercurial/__version__.py mercurial/__version__.py.save $(MAKE) clean mv mercurial/__version__.py.save mercurial/__version__.py diff -Nru mercurial-1.5.4/doc/gendoc.py mercurial-1.6/doc/gendoc.py --- mercurial-1.5.4/doc/gendoc.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/doc/gendoc.py 2010-07-01 18:06:26.000000000 +0100 @@ -25,7 +25,11 @@ return (shortdesc, desc) def get_opts(opts): - for shortopt, longopt, default, desc in 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) diff -Nru mercurial-1.5.4/doc/hg.1 mercurial-1.6/doc/hg.1 --- mercurial-1.5.4/doc/hg.1 2010-06-01 16:54:09.000000000 +0100 +++ mercurial-1.6/doc/hg.1 2010-07-01 18:06:34.000000000 +0100 @@ -30,20 +30,20 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.SH SYNOPSIS +.SH Synopsis .sp \fBhg\fP \fIcommand\fP [\fIoption\fP]... [\fIargument\fP]... -.SH DESCRIPTION +.SH Description .sp The \fBhg\fP command provides a command line interface to the Mercurial system. -.SH COMMAND ELEMENTS +.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 +\fI\%File Name Patterns\fP for information on pattern matching .TP .B path . @@ -60,7 +60,7 @@ either the pathname of a local repository or the URI of a remote repository. .UNINDENT -.SH OPTIONS +.SH Options .INDENT 0.0 .TP .B \-R, \-\-repository @@ -123,21 +123,21 @@ . display help and exit .UNINDENT -.SH COMMANDS +.SH Commands .INDENT 0.0 .TP -.B \fBadd [OPTION]... [FILE]...\fP +.B \fCadd [OPTION]... [FILE]...\fP .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 hg forget. +undo an add before that, see \fI\%\fChg forget\fP\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: +automatically by \fI\%\fChg add\fP\fP: .sp .nf .ft C @@ -170,7 +170,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBaddremove [OPTION]... [FILE]...\fP +.B \fCaddremove [OPTION]... [FILE]...\fP .sp Add all new files and remove all missing files from the repository. @@ -186,6 +186,8 @@ be identical) as its parameter. Detecting renamed files this way can be expensive. .sp +Returns 0 if all files are successfully added. +.sp options: .INDENT 7.0 .TP @@ -208,7 +210,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBannotate [\-r REV] [\-f] [\-a] [\-u] [\-d] [\-n] [\-c] [\-l] FILE...\fP +.B \fCannotate [\-r REV] [\-f] [\-a] [\-u] [\-d] [\-n] [\-c] [\-l] FILE...\fP .sp List changes in files, showing the revision id responsible for each line @@ -221,6 +223,8 @@ anyway, although the results will probably be neither useful nor desirable. .sp +Returns 0 on success. +.sp options: .INDENT 7.0 .TP @@ -277,48 +281,52 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBarchive [OPTION]... DEST\fP +.B \fCarchive [OPTION]... DEST\fP .sp By default, the revision used is the parent of the working directory; use \-r/\-\-rev to specify a different revision. .sp -To specify the type of archive to create, use \-t/\-\-type. Valid -types are: +The archive type is automatically detected based on file +extension (or override using \-t/\-\-type). +.sp +Valid types are: .INDENT 7.0 .TP -.B \fBfiles\fP +.B \fCfiles\fP .sp a directory full of files (default) .TP -.B \fBtar\fP +.B \fCtar\fP .sp tar archive, uncompressed .TP -.B \fBtbz2\fP +.B \fCtbz2\fP .sp tar archive, compressed using bzip2 .TP -.B \fBtgz\fP +.B \fCtgz\fP .sp tar archive, compressed using gzip .TP -.B \fBuzip\fP +.B \fCuzip\fP .sp zip archive, uncompressed .TP -.B \fBzip\fP +.B \fCzip\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 \(aqhg help export\(aq for details. +using a format string; see \fI\%\fChg help export\fP\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 7.0 .TP @@ -349,7 +357,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBbackout [OPTION]... [\-r] REV\fP +.B \fCbackout [OPTION]... [\-r] REV\fP .sp Commit the backed out changes as a new changeset. The new changeset is a child of the backed out changeset. @@ -363,7 +371,9 @@ changeset afterwards. This saves you from doing the merge by hand. The result of this merge is not committed, as with a normal merge. .sp -See \(aqhg help dates\(aq for a list of formats valid for \-d/\-\-date. +See \fI\%\fChg help dates\fP\fP for a list of formats valid for \-d/\-\-date. +.sp +Returns 0 on success. .sp options: .INDENT 7.0 @@ -390,11 +400,11 @@ .TP .B \-m, \-\-message . -use as commit message +use text as commit message .TP .B \-l, \-\-logfile . -read commit message from +read commit message from file .TP .B \-d, \-\-date . @@ -407,7 +417,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBbisect [\-gbsr] [\-U] [\-c CMD] [REV]\fP +.B \fCbisect [\-gbsr] [\-U] [\-c CMD] [REV]\fP .sp This command helps to find changesets which introduce problems. To use, mark the earliest changeset you know exhibits the problem as @@ -427,6 +437,8 @@ (command not found) will abort the bisection, and any other non\-zero exit status means the revision is bad. .sp +Returns 0 on success. +.sp options: .INDENT 7.0 .TP @@ -457,7 +469,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBbranch [\-fC] [NAME]\fP +.B \fCbranch [\-fC] [NAME]\fP .sp With no argument, show the current branch name. With one argument, set the working directory branch name (the branch will not exist @@ -472,8 +484,10 @@ the parent of the working directory, negating a previous branch change. .sp -Use the command \(aqhg update\(aq to switch to an existing branch. Use -\(aqhg commit \-\-close\-branch\(aq to mark this branch as closed. +Use the command \fI\%\fChg update\fP\fP to switch to an existing branch. Use +\fI\%\fChg commit \-\-close\-branch\fP\fP to mark this branch as closed. +.sp +Returns 0 on success. .sp options: .INDENT 7.0 @@ -489,16 +503,18 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBbranches [\-ac]\fP +.B \fCbranches [\-ac]\fP .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 hg commit \-\-close\-branch). +been marked closed (see \fI\%\fChg commit \-\-close\-branch\fP\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 \(aqhg update\(aq to switch to an existing branch. +Use the command \fI\%\fChg update\fP\fP to switch to an existing branch. +.sp +Returns 0. .sp options: .INDENT 7.0 @@ -514,7 +530,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBbundle [\-f] [\-t TYPE] [\-a] [\-r REV]... [\-\-base REV]... FILE [DEST]\fP +.B \fCbundle [\-f] [\-t TYPE] [\-a] [\-r REV]... [\-\-base REV]... FILE [DEST]\fP .sp Generate a compressed changegroup file collecting changesets not known to be in another repository. @@ -536,6 +552,8 @@ 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 7.0 .TP @@ -574,7 +592,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBcat [OPTION]... FILE...\fP +.B \fCcat [OPTION]... FILE...\fP .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, @@ -585,19 +603,21 @@ for the export command, with the following additions: .INDENT 7.0 .TP -.B \fB%s\fP +.B \fC%s\fP .sp basename of file being printed .TP -.B \fB%d\fP +.B \fC%d\fP .sp dirname of file being printed, or \(aq.\(aq if in repository root .TP -.B \fB%p\fP +.B \fC%p\fP .sp root\-relative path name of file being printed .UNINDENT .sp +Returns 0 on success. +.sp options: .INDENT 7.0 .TP @@ -624,7 +644,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBclone [OPTION]... SOURCE [DEST]\fP +.B \fCclone [OPTION]... SOURCE [DEST]\fP .sp Create a copy of an existing repository in a new directory. .sp @@ -634,11 +654,11 @@ The location of the source is added to the new repository\(aqs .hg/hgrc file, as the default to be used for future pulls. .sp -See \(aqhg help urls\(aq for valid source format details. +See \fI\%\fChg help urls\fP\fP for valid source format details. .sp -It is possible to specify an \fBssh://\fP URL as the destination, but no +It is possible to specify an \fCssh://\fP URL as the destination, but no .hg/hgrc and working directory will be created on the remote side. -Please see \(aqhg help urls\(aq for important details about \fBssh://\fP URLs. +Please see \fI\%\fChg help urls\fP\fP for important details about \fCssh://\fP URLs. .sp A set of changesets (tags, or branch names) to pull may be specified by listing each changeset (tag, or branch name) with \-r/\-\-rev. @@ -706,6 +726,8 @@ tip .UNINDENT .sp +Returns 0 on success. +.sp options: .INDENT 7.0 .TP @@ -744,13 +766,13 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBcommit [OPTION]... [FILE]...\fP +.B \fCcommit [OPTION]... [FILE]...\fP .sp Commit changes to the given files into the repository. Unlike a -centralized RCS, this operation is a local operation. See hg push -for a way to actively distribute your changes. +centralized RCS, this operation is a local operation. See +\fI\%\fChg push\fP\fP for a way to actively distribute your changes. .sp -If a list of files is omitted, all changes reported by "hg status" +If a list of files is omitted, all changes reported by \fI\%\fChg status\fP\fP will be committed. .sp If you are committing the result of a merge, do not provide any @@ -759,7 +781,9 @@ If no commit message is specified, the configured editor is started to prompt you for a message. .sp -See \(aqhg help dates\(aq for a list of formats valid for \-d/\-\-date. +See \fI\%\fChg help dates\fP\fP for a list of formats valid for \-d/\-\-date. +.sp +Returns 0 on success, 1 if nothing changed. .sp options: .INDENT 7.0 @@ -782,11 +806,11 @@ .TP .B \-m, \-\-message . -use as commit message +use text as commit message .TP .B \-l, \-\-logfile . -read commit message from +read commit message from file .TP .B \-d, \-\-date . @@ -801,7 +825,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBcopy [OPTION]... [SOURCE]... DEST\fP +.B \fCcopy [OPTION]... [SOURCE]... DEST\fP .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, @@ -812,7 +836,9 @@ operation is recorded, but no copying is performed. .sp This command takes effect with the next commit. To undo a copy -before that, see hg revert. +before that, see \fI\%\fChg revert\fP\fP. +.sp +Returns 0 on success, 1 if errors are encountered. .sp options: .INDENT 7.0 @@ -842,7 +868,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBdiff [OPTION]... ([\-c REV] | [\-r REV1 [\-r REV2]]) [FILE]...\fP +.B \fCdiff [OPTION]... ([\-c REV] | [\-r REV1 [\-r REV2]]) [FILE]...\fP .sp Show differences between revisions for the specified files. .sp @@ -866,7 +892,9 @@ anyway, probably with undesirable results. .sp Use the \-g/\-\-git option to generate diffs in the git extended diff -format. For more information, read \(aqhg help diffs\(aq. +format. For more information, read \fI\%\fChg help diffs\fP\fP. +.sp +Returns 0 on success. .sp options: .INDENT 7.0 @@ -930,7 +958,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBexport [OPTION]... [\-o OUTFILESPEC] REV...\fP +.B \fCexport [OPTION]... [\-o OUTFILESPEC] REV...\fP .sp Print the changeset header and diffs for one or more revisions. .sp @@ -946,35 +974,35 @@ given using a format string. The formatting rules are as follows: .INDENT 7.0 .TP -.B \fB%%\fP +.B \fC%%\fP .sp literal "%" character .TP -.B \fB%H\fP +.B \fC%H\fP .sp changeset hash (40 bytes of hexadecimal) .TP -.B \fB%N\fP +.B \fC%N\fP .sp number of patches being generated .TP -.B \fB%R\fP +.B \fC%R\fP .sp changeset revision number .TP -.B \fB%b\fP +.B \fC%b\fP .sp basename of the exporting repository .TP -.B \fB%h\fP +.B \fC%h\fP .sp short\-form changeset hash (12 bytes of hexadecimal) .TP -.B \fB%n\fP +.B \fC%n\fP .sp zero\-padded sequence number, starting at 1 .TP -.B \fB%r\fP +.B \fC%r\fP .sp zero\-padded changeset revision number .UNINDENT @@ -984,11 +1012,13 @@ diff anyway, probably with undesirable results. .sp Use the \-g/\-\-git option to generate diffs in the git extended diff -format. See \(aqhg help diffs\(aq for more information. +format. See \fI\%\fChg help diffs\fP\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 +Returns 0 on success. +.sp options: .INDENT 7.0 .TP @@ -1019,7 +1049,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBforget [OPTION]... FILE...\fP +.B \fCforget [OPTION]... FILE...\fP .sp Mark the specified files so they will no longer be tracked after the next commit. @@ -1028,7 +1058,9 @@ entire project history, and it does not delete them from the working directory. .sp -To undo a forget before the next commit, see hg add. +To undo a forget before the next commit, see \fI\%\fChg add\fP\fP. +.sp +Returns 0 on success. .sp options: .INDENT 7.0 @@ -1044,7 +1076,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBgrep [OPTION]... PATTERN [FILE]...\fP +.B \fCgrep [OPTION]... PATTERN [FILE]...\fP .sp Search revisions of files for a regular expression. .sp @@ -1059,6 +1091,8 @@ 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 7.0 .TP @@ -1109,7 +1143,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBheads [\-ac] [\-r STARTREV] [REV]...\fP +.B \fCheads [\-ac] [\-r REV] [REV]...\fP .sp With no arguments, show all repository branch heads. .sp @@ -1122,7 +1156,7 @@ associated with the specified changesets are shown. .sp If \-c/\-\-closed is specified, also show branch heads marked closed -(see hg commit \-\-close\-branch). +(see \fI\%\fChg commit \-\-close\-branch\fP\fP). .sp If STARTREV is specified, only those heads that are descendants of STARTREV will be displayed. @@ -1130,6 +1164,8 @@ 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 7.0 .TP @@ -1160,16 +1196,18 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBhelp [TOPIC]\fP +.B \fChelp [TOPIC]\fP .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. .UNINDENT .INDENT 0.0 .TP -.B \fBidentify [\-nibt] [\-r REV] [SOURCE]\fP +.B \fCidentify [\-nibt] [\-r REV] [SOURCE]\fP .sp With no revision, print a summary of the current state of the repository. @@ -1182,6 +1220,8 @@ uncommitted changes in the working directory, a list of tags for this revision and a branch name for non\-default branches. .sp +Returns 0 if successful. +.sp options: .INDENT 7.0 .TP @@ -1210,7 +1250,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBimport [OPTION]... PATCH...\fP +.B \fCimport [OPTION]... PATCH...\fP .sp Import a list of patches and commit them individually (unless \-\-no\-commit is specified). @@ -1225,7 +1265,7 @@ text/plain body parts before first diff are added to commit message. .sp -If the imported patch was generated by hg export, user and +If the imported patch was generated by \fI\%\fChg export\fP\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. @@ -1241,7 +1281,9 @@ .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 \(aqhg help dates\(aq for a list of formats valid for \-d/\-\-date. +See \fI\%\fChg help dates\fP\fP for a list of formats valid for \-d/\-\-date. +.sp +Returns 0 on success. .sp options: .INDENT 7.0 @@ -1272,11 +1314,11 @@ .TP .B \-m, \-\-message . -use as commit message +use text as commit message .TP .B \-l, \-\-logfile . -read commit message from +read commit message from file .TP .B \-d, \-\-date . @@ -1295,7 +1337,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBincoming [\-p] [\-n] [\-M] [\-f] [\-r REV]... [\-\-bundle FILENAME] [SOURCE]\fP +.B \fCincoming [\-p] [\-n] [\-M] [\-f] [\-r REV]... [\-\-bundle FILENAME] [SOURCE]\fP .sp Show new changesets found in the specified path/URL or the default pull location. These are the changesets that would have been pulled @@ -1306,6 +1348,8 @@ .sp See pull for valid source format details. .sp +Returns 0 if there are incoming changes, 1 otherwise. +.sp options: .INDENT 7.0 .TP @@ -1345,6 +1389,10 @@ . do not show merges .TP +.B \-\-stat +. +output diffstat\-style summary of changes +.TP .B \-\-style . display using template map file @@ -1366,15 +1414,17 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBinit [\-e CMD] [\-\-remotecmd CMD] [DEST]\fP +.B \fCinit [\-e CMD] [\-\-remotecmd CMD] [DEST]\fP .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 \(aqhg help urls\(aq for more information. +It is possible to specify an \fCssh://\fP URL as the destination. +See \fI\%\fChg help urls\fP\fP for more information. +.sp +Returns 0 on success. .sp options: .INDENT 7.0 @@ -1390,7 +1440,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBlocate [OPTION]... [PATTERN]...\fP +.B \fClocate [OPTION]... [PATTERN]...\fP .sp Print files under Mercurial control in the working directory whose names match the given patterns. @@ -1407,6 +1457,8 @@ 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 7.0 .TP @@ -1433,7 +1485,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBlog [OPTION]... [FILE]\fP +.B \fClog [OPTION]... [FILE]\fP .sp Print the revision history of the specified files or the entire project. @@ -1444,11 +1496,12 @@ ancestors or descendants of the starting revision. \-\-follow\-first only follows the first parent of merge revisions. .sp -If no revision range is specified, the default is \%tip:0\: unless +If no revision range is specified, the default is \fI\%tip:0\fP unless \-\-follow is set, in which case the working directory parent is -used as the starting revision. +used as the starting revision. You can specify a revision set for +log, see \fI\%\fChg help revsets\fP\fP for more information. .sp -See \(aqhg help dates\(aq for a list of formats valid for \-d/\-\-date. +See \fI\%\fChg help dates\fP\fP for a list of formats valid for \-d/\-\-date. .sp By default this command prints revision number and changeset id, tags, non\-trivial parents, user, date and time, and a summary for @@ -1460,6 +1513,8 @@ its first parent. Also, only files different from BOTH parents will appear in files:. .sp +Returns 0 on success. +.sp options: .INDENT 7.0 .TP @@ -1481,7 +1536,7 @@ .TP .B \-k, \-\-keyword . -do case\-insensitive search for a keyword +do case\-insensitive search for a given text .TP .B \-r, \-\-rev . @@ -1499,9 +1554,13 @@ . revisions committed by user .TP -.B \-b, \-\-only\-branch +.B \-\-only\-branch . -show only changesets within the given named 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 . @@ -1523,6 +1582,10 @@ . do not show merges .TP +.B \-\-stat +. +output diffstat\-style summary of changes +.TP .B \-\-style . display using template map file @@ -1544,7 +1607,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBmanifest [\-r REV]\fP +.B \fCmanifest [\-r REV]\fP .sp Print a list of version controlled files for the given revision. If no revision is given, the first parent of the working directory @@ -1553,6 +1616,8 @@ With \-v, print file permissions, symlink and executable bits. With \-\-debug, print file revision hashes. .sp +Returns 0 on success. +.sp options: .INDENT 7.0 .TP @@ -1563,7 +1628,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBmerge [\-P] [\-f] [[\-r] REV]\fP +.B \fCmerge [\-P] [\-f] [[\-r] REV]\fP .sp The current working directory is updated with all changes made in the requested revision since the last common predecessor revision. @@ -1578,6 +1643,12 @@ head, the other head is merged with by default. Otherwise, an explicit revision with which to merge with must be provided. .sp +To undo an uncommitted merge, use \fI\%\fChg update \-\-clean .\fP\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 7.0 .TP @@ -1596,7 +1667,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBoutgoing [\-M] [\-p] [\-n] [\-f] [\-r REV]... [DEST]\fP +.B \fCoutgoing [\-M] [\-p] [\-n] [\-f] [\-r REV]... [DEST]\fP .sp Show changesets not found in the specified destination repository or the default push location. These are the changesets that would @@ -1604,6 +1675,8 @@ .sp See pull for details of valid destination formats. .sp +Returns 0 if there are outgoing changes, 1 otherwise. +.sp options: .INDENT 7.0 .TP @@ -1639,6 +1712,10 @@ . do not show merges .TP +.B \-\-stat +. +output diffstat\-style summary of changes +.TP .B \-\-style . display using template map file @@ -1660,7 +1737,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBparents [\-r REV] [FILE]\fP +.B \fCparents [\-r REV] [FILE]\fP .sp Print the working directory\(aqs parent revisions. If a revision is given via \-r/\-\-rev, the parent of that revision will be printed. @@ -1668,6 +1745,8 @@ last changed (before the working directory revision or the argument to \-\-rev if given) is printed. .sp +Returns 0 on success. +.sp options: .INDENT 7.0 .TP @@ -1686,30 +1765,31 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBpaths [NAME]\fP +.B \fCpaths [NAME]\fP .sp Show definition of symbolic path name NAME. If no name is given, show definition of all available names. .sp -Path names are defined in the [paths] section of /etc/mercurial/hgrc -and $HOME/.hgrc. If run inside a repository, .hg/hgrc is used, too. +Path names are defined in the [paths] section of +\fC/etc/mercurial/hgrc\fP and \fC$HOME/.hgrc\fP. If run inside a +repository, \fC.hg/hgrc\fP is used, too. .sp -The path names \fBdefault\fP and \fBdefault\-push\fP have a special +The path names \fCdefault\fP and \fCdefault\-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 +When \fCdefault\-push\fP is set, it will be used for push and +\fCdefault\fP will be used for pull; otherwise \fCdefault\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. +source is written as \fCdefault\fP in \fC.hg/hgrc\fP. Note that +\fCdefault\fP and \fCdefault\-push\fP apply to all inbound (e.g. +\fI\%\fChg incoming\fP\fP) and outbound (e.g. \fI\%\fChg outgoing\fP\fP, \fI\%\fChg email\fP\fP and +\fI\%\fChg bundle\fP\fP) operations. .sp -See \(aqhg help urls\(aq for more information. +See \fI\%\fChg help urls\fP\fP for more information. .UNINDENT .INDENT 0.0 .TP -.B \fBpull [\-u] [\-f] [\-r REV]... [\-e CMD] [\-\-remotecmd CMD] [SOURCE]\fP +.B \fCpull [\-u] [\-f] [\-r REV]... [\-e CMD] [\-\-remotecmd CMD] [SOURCE]\fP .sp Pull changes from a remote repository to a local one. .sp @@ -1718,13 +1798,15 @@ \-R is specified). By default, this does not update the copy of the project in the working directory. .sp -Use hg incoming 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 -added those changes to the repository, you should use pull \-r X -where X is the last changeset listed by hg incoming. +Use \fI\%\fChg incoming\fP\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 \fI\%\fChg pull +\-r X\fP\fP where \fCX\fP is the last changeset listed by \fI\%\fChg incoming\fP\fP. .sp If SOURCE is omitted, the \(aqdefault\(aq path will be used. -See \(aqhg help urls\(aq for more information. +See \fI\%\fChg help urls\fP\fP for more information. +.sp +Returns 0 on success, 1 if an update had unresolved files. .sp options: .INDENT 7.0 @@ -1756,7 +1838,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBpush [\-f] [\-r REV]... [\-e CMD] [\-\-remotecmd CMD] [DEST]\fP +.B \fCpush [\-f] [\-r REV]... [\-e CMD] [\-\-remotecmd CMD] [DEST]\fP .sp Push changesets from the local repository to the specified destination. @@ -1769,15 +1851,21 @@ 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 -Please see \(aqhg help urls\(aq for important details about \fBssh://\fP +Please see \fI\%\fChg help urls\fP\fP for important details about \fCssh://\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 7.0 .TP @@ -1793,6 +1881,10 @@ . 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 @@ -1804,17 +1896,19 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBrecover\fP +.B \fCrecover\fP .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. .UNINDENT .INDENT 0.0 .TP -.B \fBremove [OPTION]... FILE...\fP +.B \fCremove [OPTION]... FILE...\fP .sp Schedule the indicated files for removal from the repository. .sp @@ -1827,8 +1921,8 @@ 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 hg status). The actions are Warn, Remove (from branch) -and Delete (from disk): +reported by \fI\%\fChg status\fP\fP). The actions are Warn, Remove (from +branch) and Delete (from disk): .sp .nf .ft C @@ -1841,7 +1935,9 @@ .fi .sp This command schedules the files to be removed at the next commit. -To undo a remove before that, see hg revert. +To undo a remove before that, see \fI\%\fChg revert\fP\fP. +.sp +Returns 0 on success, 1 if any warnings encountered. .sp options: .INDENT 7.0 @@ -1867,7 +1963,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBrename [OPTION]... SOURCE... DEST\fP +.B \fCrename [OPTION]... SOURCE... DEST\fP .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 @@ -1878,7 +1974,9 @@ operation is recorded, but no copying is performed. .sp This command takes effect at the next commit. To undo a rename -before that, see hg revert. +before that, see \fI\%\fChg revert\fP\fP. +.sp +Returns 0 on success, 1 if errors are encountered. .sp options: .INDENT 7.0 @@ -1908,14 +2006,14 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBresolve [OPTION]... [FILE]...\fP +.B \fCresolve [OPTION]... [FILE]...\fP .sp This command includes several actions that are often useful while -performing a merge, after running \fBmerge\fP but before running -\fBcommit\fP. (It is only meaningful if your working directory has +performing a merge, after running \fCmerge\fP but before running +\fCcommit\fP. (It is only meaningful if your working directory has two parents.) It is most relevant for merges with unresolved conflicts, which are typically a result of non\-interactive merging with -\fBinternal:merge\fP or a command\-line merge tool like \fBdiff3\fP. +\fCinternal:merge\fP or a command\-line merge tool like \fCdiff3\fP. .sp The available actions are: .INDENT 7.0 @@ -1924,29 +2022,31 @@ .IP 1. 3 . list files that were merged with conflicts (U, for unresolved) -and without conflicts (R, for resolved): \fBhg resolve \-l\fP -(this is like \fBstatus\fP for merges) +and without conflicts (R, for resolved): \fChg resolve \-l\fP +(this is like \fCstatus\fP for merges) .IP 2. 3 . record that you have resolved conflicts in certain files: -\fBhg resolve \-m [file ...]\fP (default: mark all unresolved files) +\fChg resolve \-m [file ...]\fP (default: mark all unresolved files) .IP 3. 3 . forget that you have resolved conflicts in certain files: -\fBhg resolve \-u [file ...]\fP (default: unmark all resolved files) +\fChg resolve \-u [file ...]\fP (default: unmark all resolved files) .IP 4. 3 . discard your current attempt(s) at resolving conflicts and -restart the merge from scratch: \fBhg resolve file...\fP -(or \fB\-a\fP for all unresolved files) +restart the merge from scratch: \fChg resolve file...\fP +(or \fC\-a\fP for all unresolved files) .UNINDENT .UNINDENT .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 +conflicts. You must use \fChg 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 7.0 .TP @@ -1981,10 +2081,13 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBrevert [OPTION]... [\-r REV] [NAME]...\fP +.B \fCrevert [OPTION]... [\-r REV] [NAME]...\fP .sp -(Use update \-r to check out earlier revisions, revert does not -change the working directory parents.) +NOTE: This command is most likely not what you are looking for. revert +will partially overwrite content in the working directory without changing +the working directory parents. Use \fI\%\fChg update \-r rev\fP\fP to check out earlier +revisions, or \fI\%\fChg update \-\-clean .\fP\fP to undo a merge which has added +another parent. .sp With no revision specified, revert the named files or directories to the contents they had in the parent of the working directory. @@ -1995,8 +2098,8 @@ .sp Using the \-r/\-\-rev option, revert the given files or directories to their contents as of a specific revision. This can be helpful -to "roll back" some or all of an earlier change. See \(aqhg help -dates\(aq for a list of formats valid for \-d/\-\-date. +to "roll back" some or all of an earlier change. See \fI\%\fChg help +dates\fP\fP for a list of formats valid for \-d/\-\-date. .sp Revert modifies the working directory. It does not commit any changes, or change the parent of the working directory. If you @@ -2013,6 +2116,8 @@ Modified files are saved with a .orig suffix before reverting. To disable these backups, use \-\-no\-backup. .sp +Returns 0 on success. +.sp options: .INDENT 7.0 .TP @@ -2047,7 +2152,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBrollback\fP +.B \fCrollback\fP .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 @@ -2083,16 +2188,28 @@ 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 7.0 +.TP +.B \-n, \-\-dry\-run +. +do not perform actions, just print output +.UNINDENT .UNINDENT .INDENT 0.0 .TP -.B \fBroot\fP +.B \fCroot\fP .sp Print the root directory of the current repository. +.sp +Returns 0 on success. .UNINDENT .INDENT 0.0 .TP -.B \fBserve [OPTION]...\fP +.B \fCserve [OPTION]...\fP .sp Start a local HTTP repository browser and pull server. You can use this for ad\-hoc sharing and browing of repositories. It is @@ -2101,14 +2218,20 @@ .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 +nobody can write to it by default. Set the \fCweb.allow_push\fP +option to \fC*\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 7.0 .TP @@ -2144,9 +2267,13 @@ . name to show in web pages (default: working directory) .TP +.B \-\-web\-conf +. +name of the hgweb config file (serve more than one repository) +.TP .B \-\-webdir\-conf . -name of the webdir config file (serve more than one repository) +name of the hgweb config file (DEPRECATED) .TP .B \-\-pid\-file . @@ -2175,7 +2302,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBshowconfig [\-u] [NAME]...\fP +.B \fCshowconfig [\-u] [NAME]...\fP .sp With no arguments, print names and values of all config items. .sp @@ -2188,6 +2315,8 @@ With \-\-debug, the source (filename and line number) is printed for each config item. .sp +Returns 0 on success. +.sp options: .INDENT 7.0 .TP @@ -2200,7 +2329,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBstatus [OPTION]... [FILE]...\fP +.B \fCstatus [OPTION]... [FILE]...\fP .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 @@ -2237,6 +2366,8 @@ .ft P .fi .sp +Returns 0 on success. +.sp options: .INDENT 7.0 .TP @@ -2305,7 +2436,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBsummary [\-\-remote]\fP +.B \fCsummary [\-\-remote]\fP .sp This generates a brief summary of the working directory state, including parents, branch, commit status, and available updates. @@ -2313,6 +2444,8 @@ 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 7.0 .TP @@ -2325,7 +2458,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBtag [\-f] [\-l] [\-m TEXT] [\-d DATE] [\-u USER] [\-r REV] NAME...\fP +.B \fCtag [\-f] [\-l] [\-m TEXT] [\-d DATE] [\-u USER] [\-r REV] NAME...\fP .sp Name a particular revision using . .sp @@ -2342,7 +2475,12 @@ necessary. The file \(aq.hg/localtags\(aq is used for local tags (not shared among repositories). .sp -See \(aqhg help dates\(aq for a list of formats valid for \-d/\-\-date. +See \fI\%\fChg help dates\fP\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 7.0 @@ -2363,6 +2501,10 @@ . remove a tag .TP +.B \-e, \-\-edit +. +edit commit message +.TP .B \-m, \-\-message . use as commit message @@ -2378,14 +2520,16 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBtags\fP +.B \fCtags\fP .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. .UNINDENT .INDENT 0.0 .TP -.B \fBtip [\-p] [\-g]\fP +.B \fCtip [\-p] [\-g]\fP .sp The tip revision (usually just called the tip) is the changeset most recently added to the repository (and therefore the most @@ -2396,6 +2540,8 @@ 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 7.0 .TP @@ -2418,11 +2564,13 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBunbundle [\-u] FILE...\fP +.B \fCunbundle [\-u] FILE...\fP .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 7.0 .TP @@ -2433,7 +2581,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBupdate [\-c] [\-C] [\-d DATE] [[\-r] REV]\fP +.B \fCupdate [\-c] [\-C] [\-d DATE] [[\-r] REV]\fP .sp Update the repository\(aqs working directory to the specified changeset. @@ -2465,12 +2613,14 @@ the working directory is updated to the requested changeset. .UNINDENT .sp -Use null as the changeset to remove the working directory (like \(aqhg -clone \-U\(aq). +Use null as the changeset to remove the working directory (like +\fI\%\fChg clone \-U\fP\fP). .sp -If you want to update just one file to an older changeset, use \(aqhg revert\(aq. +If you want to update just one file to an older changeset, use \fI\%\fChg revert\fP\fP. .sp -See \(aqhg help dates\(aq for a list of formats valid for \-d/\-\-date. +See \fI\%\fChg help dates\fP\fP for a list of formats valid for \-d/\-\-date. +.sp +Returns 0 on success, 1 if there are unresolved files. .sp options: .INDENT 7.0 @@ -2496,7 +2646,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \fBverify\fP +.B \fCverify\fP .sp Verify the integrity of the current repository. .sp @@ -2504,14 +2654,16 @@ 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. .UNINDENT .INDENT 0.0 .TP -.B \fBversion\fP +.B \fCversion\fP .sp output version and copyright information .UNINDENT -.SH CONFIGURATION FILES +.SH Configuration Files .sp Mercurial reads configuration data from several files, if they exist. Below we list the most specific file first. @@ -2520,55 +2672,82 @@ .INDENT 0.0 .IP \(bu 2 . -\fB\e.hg\ehgrc\fP +\fC\e.hg\ehgrc\fP +.IP \(bu 2 +. +\fC%USERPROFILE%\e.hgrc\fP .IP \(bu 2 . -\fB%USERPROFILE%\e.hgrc\fP +\fC%USERPROFILE%\emercurial.ini\fP .IP \(bu 2 . -\fB%USERPROFILE%\eMercurial.ini\fP +\fC%HOME%\e.hgrc\fP .IP \(bu 2 . -\fB%HOME%\e.hgrc\fP +\fC%HOME%\emercurial.ini\fP .IP \(bu 2 . -\fB%HOME%\eMercurial.ini\fP +\fCC:\emercurial\emercurial.ini\fP (unless regkey or hgrc.dor mercurial.ini found) .IP \(bu 2 . -\fBC:\eMercurial\eMercurial.ini\fP +\fCHKEY_LOCAL_MACHINE\eSOFTWARE\eMercurial\fP (unless hgrc.dor mercurial.ini found) .IP \(bu 2 . -\fBHKEY_LOCAL_MACHINE\eSOFTWARE\eMercurial\fP +\fC\ehgrc.d\e*.rc\fP (unless mercurial.ini found) .IP \(bu 2 . -\fB\eMercurial.ini\fP +\fC\emercurial.ini\fP .UNINDENT .sp On Unix, these files are read: .INDENT 0.0 .IP \(bu 2 . -\fB/.hg/hgrc\fP +\fC/.hg/hgrc\fP +.IP \(bu 2 +. +\fC$HOME/.hgrc\fP .IP \(bu 2 . -\fB$HOME/.hgrc\fP +\fC/etc/mercurial/hgrc\fP .IP \(bu 2 . -\fB/etc/mercurial/hgrc\fP +\fC/etc/mercurial/hgrc.d/*.rc\fP +.IP \(bu 2 +. +\fC/etc/mercurial/hgrc\fP +.IP \(bu 2 +. +\fC/etc/mercurial/hgrc.d/*.rc\fP +.UNINDENT +.sp +If there is a per\-repository configuration file which is not owned by +the active user, Mercurial will warn you that the file is skipped: +.sp +.nf +.ft C +not trusting file /.hg/hgrc from untrusted user USER, group GROUP +.ft P +.fi +.sp +If this bothers you, the warning can be silenced (the file would still +be ignored) or trust can be established. Use one of the following +settings, the syntax is explained below: +.INDENT 0.0 .IP \(bu 2 . -\fB/etc/mercurial/hgrc.d/*.rc\fP +\fCui.report_untrusted = False\fP .IP \(bu 2 . -\fB/etc/mercurial/hgrc\fP +\fCtrusted.users = USER\fP .IP \(bu 2 . -\fB/etc/mercurial/hgrc.d/*.rc\fP +\fCtrusted.groups = GROUP\fP .UNINDENT .sp The configuration files for Mercurial 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: +configuration file consists of sections, led by a \fC[section]\fP header +and followed by \fCname = value\fP entries: .sp .nf .ft C @@ -2578,18 +2757,18 @@ .ft P .fi .sp -This above entries will be referred to as \fBui.username\fP and -\fBui.verbose\fP, respectively. Please see the hgrc man page for a full +The above entries will be referred to as \fCui.username\fP and +\fCui.verbose\fP, respectively. Please see the hgrc man page for a full description of the possible configuration values: .INDENT 0.0 .IP \(bu 2 . -on Unix\-like systems: \fBman hgrc\fP +on Unix\-like systems: \fCman hgrc\fP .IP \(bu 2 . -online: \%http://www.selenic.com/mercurial/hgrc.5.html\: +online: \fI\%http://www.selenic.com/mercurial/hgrc.5.html\fP .UNINDENT -.SH DATE FORMATS +.SH Date Formats .sp Some commands allow the user to specify a date, e.g.: .INDENT 0.0 @@ -2605,50 +2784,50 @@ .INDENT 0.0 .IP \(bu 2 . -\fBWed Dec 6 13:18:29 2006\fP (local timezone assumed) +\fCWed Dec 6 13:18:29 2006\fP (local timezone assumed) .IP \(bu 2 . -\fBDec 6 13:18 \-0600\fP (year assumed, time offset provided) +\fCDec 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) +\fCDec 6 13:18 UTC\fP (UTC and GMT are aliases for +0000) .IP \(bu 2 . -\fBDec 6\fP (midnight) +\fCDec 6\fP (midnight) .IP \(bu 2 . -\fB13:18\fP (today assumed) +\fC13:18\fP (today assumed) .IP \(bu 2 . -\fB3:39\fP (3:39AM assumed) +\fC3:39\fP (3:39AM assumed) .IP \(bu 2 . -\fB3:39pm\fP (15:39) +\fC3:39pm\fP (15:39) .IP \(bu 2 . -\fB2006\-12\-06 13:18:29\fP (ISO 8601 format) +\fC2006\-12\-06 13:18:29\fP (ISO 8601 format) .IP \(bu 2 . -\fB2006\-12\-6 13:18\fP +\fC2006\-12\-6 13:18\fP .IP \(bu 2 . -\fB2006\-12\-6\fP +\fC2006\-12\-6\fP .IP \(bu 2 . -\fB12\-6\fP +\fC12\-6\fP .IP \(bu 2 . -\fB12/6\fP +\fC12/6\fP .IP \(bu 2 . -\fB12/6/6\fP (Dec 6 2006) +\fC12/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) +\fC1165432709 0\fP (Wed Dec 6 13:18:29 2006 UTC) .UNINDENT .sp This is the internal representation format for dates. unixtime is the @@ -2660,18 +2839,18 @@ .INDENT 0.0 .IP \(bu 2 . -\fB<{datetime}\fP \- at or before a given date/time +\fC<{datetime}\fP \- at or before a given date/time .IP \(bu 2 . -\fB>{datetime}\fP \- on or after a given date/time +\fC>{datetime}\fP \- on or after a given date/time .IP \(bu 2 . -\fB{datetime} to {datetime}\fP \- a date range, inclusive +\fC{datetime} to {datetime}\fP \- a date range, inclusive .IP \(bu 2 . -\fB\-{days}\fP \- within a given number of days of today +\fC\-{days}\fP \- within a given number of days of today .UNINDENT -.SH FILE NAME PATTERNS +.SH File Name Patterns .sp Mercurial accepts several notations for identifying one or more files at a time. @@ -2682,17 +2861,17 @@ Alternate pattern notations must be specified explicitly. .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 +\fCpath:\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. +To use an extended glob, start a name with \fCglob:\fP. Globs are rooted +at the current directory; a glob such as \fC*.c\fP will only match files +in the current directory ending with \fC.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". +The supported glob syntax extensions are \fC**\fP to match any string +across path separators and \fC{a,b}\fP to mean "a or b". .sp -To use a Perl/Python regular expression, start a name with \fBre:\fP. +To use a Perl/Python regular expression, start a name with \fCre:\fP. Regexp pattern matching is anchored at the root of the repository. .sp Plain examples: @@ -2726,7 +2905,7 @@ re:.*\e.c$ any name ending in ".c", anywhere in the repository .ft P .fi -.SH ENVIRONMENT VARIABLES +.SH Environment Variables .INDENT 0.0 .TP .B HG @@ -2814,7 +2993,7 @@ interactive prompt .IP \(bu 2 . -LOGNAME (with \fB@hostname\fP appended) +LOGNAME (with \fC@hostname\fP appended) .UNINDENT .sp (deprecated, use .hgrc) @@ -2845,7 +3024,7 @@ 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 SPECIFYING SINGLE REVISIONS +.SH Specifying Single Revisions .sp Mercurial supports several ways to specify individual revisions. .sp @@ -2876,7 +3055,7 @@ 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 MULTIPLE REVISIONS +.SH Specifying Multiple Revisions .sp When Mercurial accepts more than one revision, they may be specified individually, or provided as a topologically continuous range, @@ -2891,7 +3070,237 @@ .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 DIFF FORMATS +.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 must be quoted with single or double +quotes if they contain characters outside of +\fC[._a\-zA\-Z0\-9\ex80\-\exff]\fP or if they match one of the predefined +predicates. Special characters can be used in quoted identifiers by +escaping them, e.g., \fC\en\fP is interpreted as a newline. +.sp +There is a single prefix operator: +.INDENT 0.0 +.TP +.B \fCnot x\fP +.sp +Changesets not in x. Short form is \fC! x\fP. +.UNINDENT +.sp +These are the supported infix operators: +.INDENT 0.0 +.TP +.B \fCx::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 \fCancestors(y)\fP, if the second +is left out it is equivalent to \fCdescendants(x)\fP. +.sp +An alternative syntax is \fCx..y\fP. +.TP +.B \fCx: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 \fCx and y\fP +.sp +The intersection of changesets in x and y. Short form is \fCx & y\fP. +.TP +.B \fCx or y\fP +.sp +The union of changesets in x and y. There are two alternative short +forms: \fCx | y\fP and \fCx + y\fP. +.TP +.B \fCx \- y\fP +.sp +Changesets in x but not in y. +.UNINDENT +.sp +The following predicates are supported: +.INDENT 0.0 +.TP +.B \fCadds(pattern)\fP +.sp +Changesets that add a file matching pattern. +.TP +.B \fCall()\fP +.sp +All changesets, the same as \fC0:tip\fP. +.TP +.B \fCancestor(single, single)\fP +.sp +Greatest common ancestor of the two changesets. +.TP +.B \fCancestors(set)\fP +.sp +Changesets that are ancestors of a changeset in set. +.TP +.B \fCauthor(string)\fP +.sp +Alias for \fCuser(string)\fP. +.TP +.B \fCbranch(set)\fP +.sp +The branch names are found for changesets in set, and the result is +all changesets belonging to one those branches. +.TP +.B \fCchildren(set)\fP +.sp +Child changesets of changesets in set. +.TP +.B \fCclosed()\fP +.sp +Changeset is closed. +.TP +.B \fCcontains(pattern)\fP +.sp +Revision contains pattern. +.TP +.B \fCdate(interval)\fP +.sp +Changesets within the interval, see \fI\%\fChg help dates\fP\fP. +.TP +.B \fCdescendants(set)\fP +.sp +Changesets which are decendants of changesets in set. +.TP +.B \fCfile(pattern)\fP +.sp +Changesets which manually affected files matching pattern. +.TP +.B \fCfollow()\fP +.sp +An alias for \fC::.\fP (ancestors of the working copy\(aqs first parent). +.TP +.B \fCgrep(regex)\fP +.sp +Like \fCkeyword(string)\fP but accepts a regex. +.TP +.B \fChead()\fP +.sp +Changeset is a head. +.TP +.B \fCheads(set)\fP +.sp +Members of set with no children in set. +.TP +.B \fCkeyword(string)\fP +.sp +Search commit message, user name, and names of changed files for +string. +.TP +.B \fClimit(set, n)\fP +.sp +First n members of set. +.TP +.B \fCmax(set)\fP +.sp +Changeset with highest revision number in set. +.TP +.B \fCmerge()\fP +.sp +Changeset is a merge changeset. +.TP +.B \fCmodifies(pattern)\fP +.sp +Changesets which modify files matching pattern. +.TP +.B \fCoutgoing([path])\fP +.sp +Changesets missing in path. +.TP +.B \fCp1(set)\fP +.sp +First parent of changesets in set. +.TP +.B \fCp2(set)\fP +.sp +Second parent of changesets in set. +.TP +.B \fCparents(set)\fP +.sp +The set of all parents for all changesets in set. +.TP +.B \fCremoves(pattern)\fP +.sp +Changesets which remove files matching pattern. +.TP +.B \fCreverse(set)\fP +.sp +Reverse order of set. +.TP +.B \fCroots(set)\fP +.sp +Changesets with no parent changeset in set. +.TP +.B \fCsort(set[, [\-]key...])\fP +.sp +Sort set by keys. The default sort order is ascending, specify a key +as \fC\-key\fP to sort in descending order. +.sp +The keys can be: +.INDENT 7.0 +.IP \(bu 2 +. +\fCrev\fP for the revision number, +.IP \(bu 2 +. +\fCbranch\fP for the branch name, +.IP \(bu 2 +. +\fCdesc\fP for the commit message (description), +.IP \(bu 2 +. +\fCuser\fP for user name (\fCauthor\fP can be used as an alias), +.IP \(bu 2 +. +\fCdate\fP for the commit date +.UNINDENT +.TP +.B \fCtagged()\fP +.sp +Changeset is tagged. +.TP +.B \fCuser(string)\fP +.sp +User name is string. +.UNINDENT +.sp +Command line equivalents for \fI\%\fChg log\fP\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: +.sp +.nf +.ft C +hg log \-r \(aqbranch(default)\(aq +hg log \-r \(aqbranch(default) and 1.5:: and not merge()\(aq +hg log \-r \(aq1.3::1.5 and keyword(bug) and file("hgext/*")\(aq +hg log \-r \(aqsort(date("May 2008"), user)\(aq +hg log \-r \(aq(keyword(bug) or keyword(issue)) and not ancestors(tagged())\(aq +.ft P +.fi +.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 @@ -2920,7 +3329,7 @@ format. .sp This means that when generating diffs from a Mercurial repository -(e.g. with "hg export"), you should be careful about things like file +(e.g. with \fI\%\fChg export\fP\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 @@ -2931,7 +3340,7 @@ option available for many commands, or set \(aqgit = True\(aq in the [diff] section of your hgrc. You do not need to set this option when importing diffs in this format or using them in the mq extension. -.SH TEMPLATE USAGE +.SH Template Usage .sp Mercurial allows you to customize output of commands through templates. You can either pass in a template from the command @@ -3090,14 +3499,14 @@ .B domain . Any text. Finds the first string that looks like an email -address, and extracts just the domain component. Example: \fBUser -\fP becomes \fBexample.com\fP. +address, and extracts just the domain component. Example: \fCUser +\fP becomes \fCexample.com\fP. .TP .B email . Any text. Extracts the first string that looks like an email -address. Example: \fBUser \fP becomes -\fBuser@example.com\fP. +address. Example: \fCUser \fP becomes +\fCuser@example.com\fP. .TP .B escape . @@ -3186,7 +3595,7 @@ . Any text. Returns the user portion of an email address. .UNINDENT -.SH URL PATHS +.SH URL Paths .sp Valid URLs are of the form: .sp @@ -3201,14 +3610,14 @@ .fi .sp Paths in the local filesystem can either point to Mercurial -repositories or to bundle files (as created by \(aqhg bundle\(aq or \(aqhg -incoming \-\-bundle\(aq). +repositories or to bundle files (as created by \fI\%\fChg bundle\fP\fP or :hg:\(ga +incoming \-\-bundle\(ga). .sp An optional identifier after # indicates a particular branch, tag, or -changeset to use from the remote repository. See also \(aqhg help -revisions\(aq. +changeset to use from the remote repository. See also \fI\%\fChg help +revisions\fP\fP. .sp -Some features, such as pushing to \%http://\: and \%https://\: URLs are only +Some features, such as pushing to \fI\%http://\fP and \fI\%https://\fP URLs are only possible if the feature is explicitly enabled on the remote Mercurial server. .sp @@ -3259,7 +3668,7 @@ .fi .sp You can then use the alias for any command that uses a URL (for -example \(aqhg pull alias1\(aq will be treated as \(aqhg pull URL1\(aq). +example \fI\%\fChg pull alias1\fP\fP will be treated as \fI\%\fChg pull URL1\fP\fP). .sp Two path aliases are special because they are used as defaults when you do not provide the URL to a command: @@ -3277,7 +3686,7 @@ The push command will look for a path named \(aqdefault\-push\(aq, and prefer it over \(aqdefault\(aq if both are defined. .UNINDENT -.SH USING ADDITIONAL FEATURES +.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 @@ -3468,51 +3877,548 @@ .UNINDENT .UNINDENT .UNINDENT -.SH FILES +.SH Configuring hgweb +.sp +Mercurial\(aqs internal web server, hgweb, can serve either a single +repository, or a collection of them. In the latter case, a special +configuration file can be used to specify the repository paths to use +and global web configuration options. +.sp +This file uses the same syntax as hgrc configuration files, but only +the following sections are recognized: +.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 \fCweb\fP section can specify all the settings described in the web +section of the hgrc documentation. +.sp +The \fCpaths\fP section provides mappings of physical repository +paths to virtual ones. For instance: +.sp +.nf +.ft C +[paths] +projects/a = /foo/bar +projects/b = /baz/quux +web/root = /real/root/* +/ = /real/root2/* +virtual/root2 = /real/root2/** +.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 maps every Mercurial repository found in \(aq/real/root\(aq +into \(aqweb/root\(aq. This format is preferred over the [collections] one, +since using absolute paths as configuration keys is not supported on every +platform (especially on Windows). +.IP \(bu 2 +. +The fourth entry is a special case mapping all repositories in +\(aq/real/root2\(aq in the root of the virtual directory. +.IP \(bu 2 +. +The fifth entry recursively finds all repositories under the real +root, and maps their relative paths under the virtual root. +.UNINDENT +.sp +The \fCcollections\fP section provides mappings of trees of physical +repositories paths to virtual ones, though the paths syntax is generally +preferred. For instance: +.sp +.nf +.ft C +[collections] +/foo = /foo +.ft P +.fi +.sp +Here, the left side will be stripped off all repositories found in the +right side. Thus \fC/foo/bar\fP and \fCfoo/quux/baz\fP will be listed as +\fCbar\fP and \fCquux/baz\fP respectively. +.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 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, 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 \fI\%\fChg help branch\fP\fP, \fI\%\fChg help branches\fP\fP and +\fI\%\fChg commit \-\-close\-branch\fP\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\-byte hexadecimal string, or a +"short" 12\-byte hexadecimal 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 +\fI\%\fChg help update\fP\fP. +.sp +Example: "I\(aqm going to check out changeset X." +.TP +.B Child changeset +. +See \(aqChangeset, child\(aq. +.TP +.B Close changeset +. +See \(aqChangeset, close\(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 \fI\%\fChg clone\fP\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 \fI\%\fChg glog\fP\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 +\(aqParents, 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 Graph +. +See DAG and \fI\%\fChg help graphlog\fP\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 \fI\%\fChg heads\fP\fP. A branch is considered +closed when all its heads are closed and consequently is not +listed by \fI\%\fChg branches\fP\fP. +.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 \fI\%\fChg parents\fP\fP. This is changed with +\fI\%\fChg update\fP\fP. Other commands to see the working directory parent +are \fI\%\fChg summary\fP\fP and \fI\%\fChg id\fP\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 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 \fI\%\fChg help pull\fP\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 \fI\%\fChg help push\fP\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 \fC.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 \fI\%\fChg update\fP\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 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 +\fI\%\fChg help update\fP\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 Files .INDENT 0.0 .TP -.B \fB.hgignore\fP +.B \fC.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)\:. +see \fI\%\fBhgignore\fP(5)\fP. .TP -.B \fB.hgtags\fP +.B \fC.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. .TP -.B \fB/etc/mercurial/hgrc\fP, \fB$HOME/.hgrc\fP, \fB.hg/hgrc\fP +.B \fC/etc/mercurial/hgrc\fP, \fC$HOME/.hgrc\fP, \fC.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 +\fC.hg/hgrc\fP override those in \fC$HOME/.hgrc\fP, and these override +settings made in the global \fC/etc/mercurial/hgrc\fP configuration. +See \fI\%\fBhgrc\fP(5)\fP for details of the contents and format of these files. .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, +Some commands (e.g. revert) produce backup files ending in \fC.orig\fP, +if the \fC.orig\fP file already exists and is not tracked by Mercurial, it will be overwritten. -.SH BUGS +.SH Bugs .sp -Probably lots, please post them to the mailing list (see \%Resources\: +Probably lots, please post them to the mailing list (see \fI\%Resources\fP below) when you find them. -.SH SEE ALSO +.SH See Also .sp -\%\fBhgignore\fP(5)\:, \%\fBhgrc\fP(5)\: -.SH AUTHOR +\fI\%\fBhgignore\fP(5)\fP, \fI\%\fBhgrc\fP(5)\fP +.SH Author .sp -Written by Matt Mackall <\%mpm@selenic.com\:> -.SH RESOURCES +Written by Matt Mackall <\fI\%mpm@selenic.com\fP> +.SH Resources .sp -Main Web Site: \%http://mercurial.selenic.com/\: +Main Web Site: \fI\%http://mercurial.selenic.com/\fP .sp -Source code repository: \%http://selenic.com/hg\: +Source code repository: \fI\%http://selenic.com/hg\fP .sp -Mailing list: \%http://selenic.com/mailman/listinfo/mercurial\: -.SH COPYING +Mailing list: \fI\%http://selenic.com/mailman/listinfo/mercurial\fP +.SH Copying .sp Copyright (C) 2005\-2010 Matt Mackall. Free use of this software is granted under the terms of the GNU General diff -Nru mercurial-1.5.4/doc/hg.1.gendoc.txt mercurial-1.6/doc/hg.1.gendoc.txt --- mercurial-1.5.4/doc/hg.1.gendoc.txt 2010-06-01 16:54:03.000000000 +0100 +++ mercurial-1.6/doc/hg.1.gendoc.txt 2010-07-01 18:06:32.000000000 +0100 @@ -56,14 +56,14 @@ repository. The files will be added to the repository at the next commit. To - undo an add before that, see hg forget. + undo an add before that, see :hg:`forget`. If no names are given, add all files to the repository. .. container:: verbose An example showing how new (unknown) files are added - automatically by ``hg add``:: + automatically by :hg:`add`:: $ ls foo.c @@ -97,6 +97,8 @@ be identical) as its parameter. Detecting renamed files this way can be expensive. + Returns 0 if all files are successfully added. + options: -s, --similarity guess renamed files by similarity (0<=s<=100) @@ -118,6 +120,8 @@ anyway, although the results will probably be neither useful nor desirable. + Returns 0 on success. + options: -r, --rev annotate the specified revision @@ -141,8 +145,10 @@ By default, the revision used is the parent of the working directory; use -r/--rev to specify a different revision. - To specify the type of archive to create, use -t/--type. Valid - types are: + The archive type is automatically detected based on file + extension (or override using -t/--type). + + Valid types are: :``files``: a directory full of files (default) :``tar``: tar archive, uncompressed @@ -152,13 +158,15 @@ :``zip``: zip archive, compressed using deflate The exact name of the destination archive or directory is given - using a format string; see 'hg help export' for details. + using a format string; see :hg:`help export` for details. 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. + Returns 0 on success. + options: --no-decode do not pass files through decoders @@ -183,7 +191,9 @@ changeset afterwards. This saves you from doing the merge by hand. The result of this merge is not committed, as with a normal merge. - See 'hg help dates' for a list of formats valid for -d/--date. + See :hg:`help dates` for a list of formats valid for -d/--date. + + Returns 0 on success. options: @@ -192,8 +202,8 @@ -r, --rev revision to backout -I, --include include names matching the given patterns -X, --exclude exclude names matching the given patterns - -m, --message use as commit message - -l, --logfile read commit message from + -m, --message use text as commit message + -l, --logfile read commit message from file -d, --date record datecode as commit date -u, --user record the specified user as committer @@ -218,6 +228,8 @@ (command not found) will abort the bisection, and any other non-zero exit status means the revision is bad. + Returns 0 on success. + options: -r, --reset reset bisect state @@ -243,8 +255,10 @@ the parent of the working directory, negating a previous branch change. - Use the command 'hg update' to switch to an existing branch. Use - 'hg commit --close-branch' to mark this branch as closed. + Use the command :hg:`update` to switch to an existing branch. Use + :hg:`commit --close-branch` to mark this branch as closed. + + Returns 0 on success. options: @@ -256,12 +270,14 @@ ``branches [-ac]`` 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 hg commit --close-branch). + been marked closed (see :hg:`commit --close-branch`). If -a/--active is specified, only show active branches. A branch is considered active if it contains repository heads. - Use the command 'hg update' to switch to an existing branch. + Use the command :hg:`update` to switch to an existing branch. + + Returns 0. options: @@ -291,6 +307,8 @@ Applying bundles preserves all changeset contents including permissions, copy/rename information, and revision history. + Returns 0 on success, 1 if no changes found. + options: -f, --force run even when the destination is unrelated @@ -317,6 +335,8 @@ :``%d``: dirname of file being printed, or '.' if in repository root :``%p``: root-relative path name of file being printed + Returns 0 on success. + options: -o, --output print output to file with formatted name @@ -336,11 +356,11 @@ The location of the source is added to the new repository's .hg/hgrc file, as the default to be used for future pulls. - See 'hg help urls' for valid source format details. + See :hg:`help urls` for valid source format details. It is possible to specify an ``ssh://`` URL as the destination, but no .hg/hgrc and working directory will be created on the remote side. - Please see 'hg help urls' for important details about ``ssh://`` URLs. + Please see :hg:`help urls` for important details about ``ssh://`` URLs. A set of changesets (tags, or branch names) to pull may be specified by listing each changeset (tag, or branch name) with -r/--rev. @@ -387,6 +407,8 @@ g) the tipmost head of the default branch h) tip + Returns 0 on success. + options: -U, --noupdate the clone will include an empty working copy (only a repository) @@ -402,10 +424,10 @@ ``commit [OPTION]... [FILE]...`` Commit changes to the given files into the repository. Unlike a - centralized RCS, this operation is a local operation. See hg push - for a way to actively distribute your changes. + centralized RCS, this operation is a local operation. See + :hg:`push` for a way to actively distribute your changes. - If a list of files is omitted, all changes reported by "hg status" + If a list of files is omitted, all changes reported by :hg:`status` will be committed. If you are committing the result of a merge, do not provide any @@ -414,7 +436,9 @@ If no commit message is specified, the configured editor is started to prompt you for a message. - See 'hg help dates' for a list of formats valid for -d/--date. + See :hg:`help dates` for a list of formats valid for -d/--date. + + Returns 0 on success, 1 if nothing changed. options: @@ -422,8 +446,8 @@ --close-branch mark a branch as closed, hiding it from the branch list -I, --include include names matching the given patterns -X, --exclude exclude names matching the given patterns - -m, --message use as commit message - -l, --logfile read commit message from + -m, --message use text as commit message + -l, --logfile read commit message from file -d, --date record datecode as commit date -u, --user record the specified user as committer @@ -441,7 +465,9 @@ operation is recorded, but no copying is performed. This command takes effect with the next commit. To undo a copy - before that, see hg revert. + before that, see :hg:`revert`. + + Returns 0 on success, 1 if errors are encountered. options: @@ -478,7 +504,9 @@ anyway, probably with undesirable results. Use the -g/--git option to generate diffs in the git extended diff - format. For more information, read 'hg help diffs'. + format. For more information, read :hg:`help diffs`. + + Returns 0 on success. options: @@ -527,11 +555,13 @@ diff anyway, probably with undesirable results. Use the -g/--git option to generate diffs in the git extended diff - format. See 'hg help diffs' for more information. + format. See :hg:`help diffs` for more information. With the --switch-parent option, the diff will be against the second parent. It can be useful to review a merge. + Returns 0 on success. + options: -o, --output print output to file with formatted name @@ -551,7 +581,9 @@ entire project history, and it does not delete them from the working directory. - To undo a forget before the next commit, see hg add. + To undo a forget before the next commit, see :hg:`add`. + + Returns 0 on success. options: @@ -574,6 +606,8 @@ becomes a non-match, or "+" for a non-match that becomes a match), use the --all flag. + Returns 0 if a match is found, 1 otherwise. + options: -0, --print0 end fields with NUL @@ -590,7 +624,7 @@ .. _heads: -``heads [-ac] [-r STARTREV] [REV]...`` +``heads [-ac] [-r REV] [REV]...`` With no arguments, show all repository branch heads. Repository "heads" are changesets with no child changesets. They are @@ -602,7 +636,7 @@ associated with the specified changesets are shown. If -c/--closed is specified, also show branch heads marked closed - (see hg commit --close-branch). + (see :hg:`commit --close-branch`). If STARTREV is specified, only those heads that are descendants of STARTREV will be displayed. @@ -610,6 +644,8 @@ If -t/--topo is specified, named branch mechanics will be ignored and only changesets without children will be shown. + Returns 0 if matching heads are found, 1 if not. + options: -r, --rev show only heads which are descendants of REV @@ -627,6 +663,8 @@ Given a topic, extension, or command name, print help for that topic. + Returns 0 if successful. + .. _identify: ``identify [-nibt] [-r REV] [SOURCE]`` @@ -641,6 +679,8 @@ uncommitted changes in the working directory, a list of tags for this revision and a branch name for non-default branches. + Returns 0 if successful. + options: -r, --rev identify the specified revision @@ -667,7 +707,7 @@ text/plain body parts before first diff are added to commit message. - If the imported patch was generated by hg export, user and + If the imported patch was generated by :hg:`export`, 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. @@ -683,7 +723,9 @@ 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 'hg help dates' for a list of formats valid for -d/--date. + See :hg:`help dates` for a list of formats valid for -d/--date. + + Returns 0 on success. options: @@ -693,8 +735,8 @@ --no-commit don't commit, just update the working directory --exact apply patch to the nodes from which it was generated --import-branch use any branch information in patch (implied by --exact) - -m, --message use as commit message - -l, --logfile read commit message from + -m, --message use text as commit message + -l, --logfile read commit message from file -d, --date record datecode as commit date -u, --user record the specified user as committer -s, --similarity guess renamed files by similarity (0<=s<=100) @@ -713,6 +755,8 @@ See pull for valid source format details. + Returns 0 if there are incoming changes, 1 otherwise. + options: -f, --force run even if remote repository is unrelated @@ -724,6 +768,7 @@ -g, --git use git extended diff format -l, --limit limit number of changes displayed -M, --no-merges do not show merges + --stat output diffstat-style summary of changes --style display using template map file --template display with template -e, --ssh specify ssh command to use @@ -740,7 +785,9 @@ If no directory is given, the current directory is used. It is possible to specify an ``ssh://`` URL as the destination. - See 'hg help urls' for more information. + See :hg:`help urls` for more information. + + Returns 0 on success. options: @@ -765,6 +812,8 @@ will avoid the problem of "xargs" treating single filenames that contain whitespace as multiple filenames. + Returns 0 if a match is found, 1 otherwise. + options: -r, --rev search the repository as it is in REV @@ -787,9 +836,10 @@ If no revision range is specified, the default is tip:0 unless --follow is set, in which case the working directory parent is - used as the starting revision. + used as the starting revision. You can specify a revision set for + log, see :hg:`help revsets` for more information. - See 'hg help dates' for a list of formats valid for -d/--date. + See :hg:`help dates` for a list of formats valid for -d/--date. By default this command prints revision number and changeset id, tags, non-trivial parents, user, date and time, and a summary for @@ -801,23 +851,27 @@ its first parent. Also, only files different from BOTH parents will appear in files:. + Returns 0 on success. + options: -f, --follow follow changeset history, or file history across copies and renames --follow-first only follow the first parent of merge changesets -d, --date show revisions matching date spec -C, --copies show copied files - -k, --keyword do case-insensitive search for a keyword + -k, --keyword do case-insensitive search for a given text -r, --rev show the specified revision or range --removed include revisions where files were removed -m, --only-merges show only merges -u, --user revisions committed by user - -b, --only-branch show only changesets within the given named branch + --only-branch show only changesets within the given named branch (DEPRECATED) + -b, --branch show changesets within the given named branch -P, --prune do not display revision or any of its ancestors -p, --patch show patch -g, --git use git extended diff format -l, --limit limit number of changes displayed -M, --no-merges do not show merges + --stat output diffstat-style summary of changes --style display using template map file --template display with template -I, --include include names matching the given patterns @@ -835,6 +889,8 @@ With -v, print file permissions, symlink and executable bits. With --debug, print file revision hashes. + Returns 0 on success. + options: -r, --rev revision to display @@ -855,6 +911,12 @@ head, the other head is merged with by default. Otherwise, an explicit revision with which to merge with must be provided. + To undo an uncommitted merge, use :hg:`update --clean .` which + will check out a clean copy of the original merge parent, losing + all changes. + + Returns 0 on success, 1 if there are unresolved files. + options: -f, --force force a merge with outstanding changes @@ -870,6 +932,8 @@ See pull for details of valid destination formats. + Returns 0 if there are outgoing changes, 1 otherwise. + options: -f, --force run even when the destination is unrelated @@ -880,6 +944,7 @@ -g, --git use git extended diff format -l, --limit limit number of changes displayed -M, --no-merges do not show merges + --stat output diffstat-style summary of changes --style display using template map file --template display with template -e, --ssh specify ssh command to use @@ -896,6 +961,8 @@ last changed (before the working directory revision or the argument to --rev if given) is printed. + Returns 0 on success. + options: -r, --rev show parents of the specified revision @@ -908,8 +975,9 @@ Show definition of symbolic path name NAME. If no name is given, show definition of all available names. - Path names are defined in the [paths] section of /etc/mercurial/hgrc - and $HOME/.hgrc. If run inside a repository, .hg/hgrc is used, too. + Path names are defined in the [paths] section of + ``/etc/mercurial/hgrc`` and ``$HOME/.hgrc``. If run inside a + repository, ``.hg/hgrc`` is used, too. The path names ``default`` and ``default-push`` have a special meaning. When performing a push or pull operation, they are used @@ -918,11 +986,11 @@ ``default`` will be used for pull; otherwise ``default`` is used as the fallback for both. When cloning a repository, the clone source is written as ``default`` in ``.hg/hgrc``. Note that - ``default`` and ``default-push`` apply to all inbound (e.g. ``hg - incoming``) and outbound (e.g. ``hg outgoing``, ``hg email`` and - ``hg bundle``) operations. + ``default`` and ``default-push`` apply to all inbound (e.g. + :hg:`incoming`) and outbound (e.g. :hg:`outgoing`, :hg:`email` and + :hg:`bundle`) operations. - See 'hg help urls' for more information. + See :hg:`help urls` for more information. .. _pull: @@ -934,13 +1002,15 @@ -R is specified). By default, this does not update the copy of the project in the working directory. - Use hg incoming 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 - added those changes to the repository, you should use pull -r X - where X is the last changeset listed by hg incoming. + Use :hg:`incoming` 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 :hg:`pull + -r X` where ``X`` is the last changeset listed by :hg:`incoming`. If SOURCE is omitted, the 'default' path will be used. - See 'hg help urls' for more information. + See :hg:`help urls` for more information. + + Returns 0 on success, 1 if an update had unresolved files. options: @@ -965,20 +1035,27 @@ to use. In this situation, it is recommended to pull and merge before pushing. + 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. + Use -f/--force to override the default behavior and push all changesets on all branches. If -r/--rev is used, the specified revision and all its ancestors will be pushed to the remote repository. - Please see 'hg help urls' for important details about ``ssh://`` + Please see :hg:`help urls` for important details about ``ssh://`` URLs. If DESTINATION is omitted, a default path will be used. + Returns 0 if push was successful, 1 if nothing to push. + options: -f, --force force push -r, --rev a changeset intended to be included in the destination -b, --branch a specific branch you would like to push + --new-branch allow pushing a new branch -e, --ssh specify ssh command to use --remotecmd specify hg command to run on the remote side @@ -991,6 +1068,8 @@ interrupted operation. It should only be necessary when Mercurial suggests it. + Returns 0 if successful, 1 if nothing to recover or verify fails. + .. _remove: ``remove [OPTION]... FILE...`` @@ -1005,8 +1084,8 @@ 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 hg status). The actions are Warn, Remove (from branch) - and Delete (from disk):: + reported by :hg:`status`). The actions are Warn, Remove (from + branch) and Delete (from disk):: A C M ! none W RD W R @@ -1015,7 +1094,9 @@ -Af R R R R This command schedules the files to be removed at the next commit. - To undo a remove before that, see hg revert. + To undo a remove before that, see :hg:`revert`. + + Returns 0 on success, 1 if any warnings encountered. options: @@ -1038,7 +1119,9 @@ operation is recorded, but no copying is performed. This command takes effect at the next commit. To undo a rename - before that, see hg revert. + before that, see :hg:`revert`. + + Returns 0 on success, 1 if errors are encountered. options: @@ -1077,6 +1160,8 @@ conflicts. You must use ``hg resolve -m ...`` before you can commit after a conflicting merge. + Returns 0 on success, 1 if any files fail a resolve attempt. + options: -a, --all select all unresolved files @@ -1090,8 +1175,11 @@ .. _revert: ``revert [OPTION]... [-r REV] [NAME]...`` - (Use update -r to check out earlier revisions, revert does not - change the working directory parents.) + NOTE: This command is most likely not what you are looking for. revert + will partially overwrite content in the working directory without changing + the working directory parents. Use :hg:`update -r rev` to check out earlier + revisions, or :hg:`update --clean .` to undo a merge which has added + another parent. With no revision specified, revert the named files or directories to the contents they had in the parent of the working directory. @@ -1102,8 +1190,8 @@ Using the -r/--rev option, revert the given files or directories to their contents as of a specific revision. This can be helpful - to "roll back" some or all of an earlier change. See 'hg help - dates' for a list of formats valid for -d/--date. + to "roll back" some or all of an earlier change. See :hg:`help + dates` for a list of formats valid for -d/--date. Revert modifies the working directory. It does not commit any changes, or change the parent of the working directory. If you @@ -1120,6 +1208,8 @@ Modified files are saved with a .orig suffix before reverting. To disable these backups, use --no-backup. + Returns 0 on success. + options: -a, --all revert all changes when no arguments given @@ -1157,11 +1247,19 @@ repository; for example an in-progress pull from the repository may fail if a rollback is performed. + Returns 0 on success, 1 if no rollback data is available. + + options: + + -n, --dry-run do not perform actions, just print output + .. _root: ``root`` Print the root directory of the current repository. + Returns 0 on success. + .. _serve: ``serve [OPTION]...`` @@ -1180,6 +1278,12 @@ stderr. Use the -A/--accesslog and -E/--errorlog options to log to files. + 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. + + Returns 0 on success. + options: -A, --accesslog name of access log file to write to @@ -1190,7 +1294,8 @@ -a, --address address to listen on (default: all interfaces) --prefix prefix path to serve from (default: server root) -n, --name name to show in web pages (default: working directory) - --webdir-conf name of the webdir config file (serve more than one repository) + --web-conf name of the hgweb config file (serve more than one repository) + --webdir-conf name of the hgweb config file (DEPRECATED) --pid-file name of file to write process ID to --stdio for remote clients -t, --templates web templates to use @@ -1212,6 +1317,8 @@ With --debug, the source (filename and line number) is printed for each config item. + Returns 0 on success. + options: -u, --untrusted show untrusted configuration options @@ -1252,6 +1359,8 @@ I = ignored = origin of the previous file listed as A (added) + Returns 0 on success. + options: -A, --all show status of all files @@ -1281,6 +1390,8 @@ With the --remote option, this will check the default paths for incoming and outgoing changes. This can be time-consuming. + Returns 0 on success. + options: --remote check for push and pull @@ -1305,7 +1416,12 @@ necessary. The file '.hg/localtags' is used for local tags (not shared among repositories). - See 'hg help dates' for a list of formats valid for -d/--date. + See :hg:`help dates` for a list of formats valid for -d/--date. + + Since tag names have priority over branch names during revision + lookup, using an existing branch name as a tag name is discouraged. + + Returns 0 on success. options: @@ -1313,6 +1429,7 @@ -l, --local make the tag local -r, --rev revision to tag --remove remove a tag + -e, --edit edit commit message -m, --message use as commit message -d, --date record datecode as commit date -u, --user record the specified user as committer @@ -1323,6 +1440,8 @@ This lists both regular and local tags. When the -v/--verbose switch is used, a third column "local" is printed for local tags. + Returns 0 on success. + .. _tip: ``tip [-p] [-g]`` @@ -1335,6 +1454,8 @@ that repository becomes the current tip. The "tip" tag is special and cannot be renamed or assigned to a different changeset. + Returns 0 on success. + options: -p, --patch show patch @@ -1348,6 +1469,8 @@ Apply one or more compressed changegroup files generated by the bundle command. + Returns 0 on success, 1 if an update has unresolved files. + options: -u, --update update to new branch head if changesets were unbundled @@ -1380,12 +1503,14 @@ 3. With the -C/--clean option, uncommitted changes are discarded and the working directory is updated to the requested changeset. - Use null as the changeset to remove the working directory (like 'hg - clone -U'). + Use null as the changeset to remove the working directory (like + :hg:`clone -U`). + + If you want to update just one file to an older changeset, use :hg:`revert`. - If you want to update just one file to an older changeset, use 'hg revert'. + See :hg:`help dates` for a list of formats valid for -d/--date. - See 'hg help dates' for a list of formats valid for -d/--date. + Returns 0 on success, 1 if there are unresolved files. options: @@ -1406,6 +1531,8 @@ the changelog, manifest, and tracked files, as well as the integrity of their crosslinks and indices. + Returns 0 on success, 1 if errors are encountered. + .. _version: ``version`` @@ -1423,12 +1550,13 @@ - ``\.hg\hgrc`` - ``%USERPROFILE%\.hgrc`` -- ``%USERPROFILE%\Mercurial.ini`` +- ``%USERPROFILE%\mercurial.ini`` - ``%HOME%\.hgrc`` -- ``%HOME%\Mercurial.ini`` -- ``C:\Mercurial\Mercurial.ini`` -- ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial`` -- ``\Mercurial.ini`` +- ``%HOME%\mercurial.ini`` +- ``C:\mercurial\mercurial.ini`` (unless regkey or hgrc.d\ or mercurial.ini found) +- ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial`` (unless hgrc.d\ or mercurial.ini found) +- ``\hgrc.d\*.rc`` (unless mercurial.ini found) +- ``\mercurial.ini`` On Unix, these files are read: @@ -1439,6 +1567,19 @@ - ``/etc/mercurial/hgrc`` - ``/etc/mercurial/hgrc.d/*.rc`` +If there is a per-repository configuration file which is not owned by +the active user, Mercurial will warn you that the file is skipped:: + + not trusting file /.hg/hgrc from untrusted user USER, group GROUP + +If this bothers you, the warning can be silenced (the file would still +be ignored) or trust can be established. Use one of the following +settings, the syntax is explained below: + +- ``ui.report_untrusted = False`` +- ``trusted.users = USER`` +- ``trusted.groups = GROUP`` + The configuration files for Mercurial use a simple ini-file format. A configuration file consists of sections, led by a ``[section]`` header and followed by ``name = value`` entries:: @@ -1447,7 +1588,7 @@ username = Firstname Lastname verbose = True -This above entries will be referred to as ``ui.username`` and +The above entries will be referred to as ``ui.username`` and ``ui.verbose``, respectively. Please see the hgrc man page for a full description of the possible configuration values: @@ -1692,6 +1833,178 @@ 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. +.. _revsets: + +Specifying Revision Sets +------------------------ + +Mercurial supports a functional language for selecting a set of +revisions. + +The language supports a number of predicates which are joined by infix +operators. Parenthesis can be used for grouping. + +Identifiers such as branch names must be quoted with single or double +quotes if they contain characters outside of +``[._a-zA-Z0-9\x80-\xff]`` or if they match one of the predefined +predicates. Special characters can be used in quoted identifiers by +escaping them, e.g., ``\n`` is interpreted as a newline. + +There is a single prefix operator: + +``not x`` + Changesets not in x. Short form is ``! x``. + +These are the supported infix operators: + +``x::y`` + 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 ``ancestors(y)``, if the second + is left out it is equivalent to ``descendants(x)``. + + An alternative syntax is ``x..y``. + +``x:y`` + All changesets with revision numbers between x and y, both + inclusive. Either endpoint can be left out, they default to 0 and + tip. + +``x and y`` + The intersection of changesets in x and y. Short form is ``x & y``. + +``x or y`` + The union of changesets in x and y. There are two alternative short + forms: ``x | y`` and ``x + y``. + +``x - y`` + Changesets in x but not in y. + +The following predicates are supported: + +``adds(pattern)`` + Changesets that add a file matching pattern. + +``all()`` + All changesets, the same as ``0:tip``. + +``ancestor(single, single)`` + Greatest common ancestor of the two changesets. + +``ancestors(set)`` + Changesets that are ancestors of a changeset in set. + +``author(string)`` + Alias for ``user(string)``. + +``branch(set)`` + The branch names are found for changesets in set, and the result is + all changesets belonging to one those branches. + +``children(set)`` + Child changesets of changesets in set. + +``closed()`` + Changeset is closed. + +``contains(pattern)`` + Revision contains pattern. + +``date(interval)`` + Changesets within the interval, see :hg:`help dates`. + +``descendants(set)`` + Changesets which are decendants of changesets in set. + +``file(pattern)`` + Changesets which manually affected files matching pattern. + +``follow()`` + An alias for ``::.`` (ancestors of the working copy's first parent). + +``grep(regex)`` + Like ``keyword(string)`` but accepts a regex. + +``head()`` + Changeset is a head. + +``heads(set)`` + Members of set with no children in set. + +``keyword(string)`` + Search commit message, user name, and names of changed files for + string. + +``limit(set, n)`` + First n members of set. + +``max(set)`` + Changeset with highest revision number in set. + +``merge()`` + Changeset is a merge changeset. + +``modifies(pattern)`` + Changesets which modify files matching pattern. + +``outgoing([path])`` + Changesets missing in path. + +``p1(set)`` + First parent of changesets in set. + +``p2(set)`` + Second parent of changesets in set. + +``parents(set)`` + The set of all parents for all changesets in set. + +``removes(pattern)`` + Changesets which remove files matching pattern. + +``reverse(set)`` + Reverse order of set. + +``roots(set)`` + Changesets with no parent changeset in set. + +``sort(set[, [-]key...])`` + Sort set by keys. The default sort order is ascending, specify a key + as ``-key`` to sort in descending order. + + The keys can be: + + - ``rev`` for the revision number, + - ``branch`` for the branch name, + - ``desc`` for the commit message (description), + - ``user`` for user name (``author`` can be used as an alias), + - ``date`` for the commit date + +``tagged()`` + Changeset is tagged. + +``user(string)`` + User name is string. + +Command line equivalents for :hg:`log`:: + + -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) + +Some sample queries:: + + hg log -r 'branch(default)' + hg log -r 'branch(default) and 1.5:: and not merge()' + hg log -r '1.3::1.5 and keyword(bug) and file("hgext/*")' + hg log -r 'sort(date("May 2008"), user)' + hg log -r '(keyword(bug) or keyword(issue)) and not ancestors(tagged())' + .. _diffs: Diff Formats @@ -1715,7 +2028,7 @@ format. This means that when generating diffs from a Mercurial repository -(e.g. with "hg export"), you should be careful about things like file +(e.g. with :hg:`export`), 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 @@ -1899,12 +2212,12 @@ ssh://[user[:pass]@]host[:port]/[path][#revision] Paths in the local filesystem can either point to Mercurial -repositories or to bundle files (as created by 'hg bundle' or 'hg -incoming --bundle'). +repositories or to bundle files (as created by :hg:`bundle` or :hg:` +incoming --bundle`). An optional identifier after # indicates a particular branch, tag, or -changeset to use from the remote repository. See also 'hg help -revisions'. +changeset to use from the remote repository. See also :hg:`help +revisions`. Some features, such as pushing to http:// and https:// URLs are only possible if the feature is explicitly enabled on the remote Mercurial @@ -1939,7 +2252,7 @@ ... You can then use the alias for any command that uses a URL (for -example 'hg pull alias1' will be treated as 'hg pull URL1'). +example :hg:`pull alias1` will be treated as :hg:`pull URL1`). Two path aliases are special because they are used as defaults when you do not provide the URL to a command: @@ -2030,3 +2343,418 @@ :win32text: perform automatic newline conversion :zeroconf: discover and advertise repositories on the local network +.. _hgweb: + +Configuring hgweb +----------------- + +Mercurial's internal web server, hgweb, can serve either a single +repository, or a collection of them. In the latter case, a special +configuration file can be used to specify the repository paths to use +and global web configuration options. + +This file uses the same syntax as hgrc configuration files, but only +the following sections are recognized: + + - web + - paths + - collections + +The ``web`` section can specify all the settings described in the web +section of the hgrc documentation. + +The ``paths`` section provides mappings of physical repository +paths to virtual ones. For instance:: + + [paths] + projects/a = /foo/bar + projects/b = /baz/quux + web/root = /real/root/* + / = /real/root2/* + virtual/root2 = /real/root2/** + +- The first two entries make two repositories in different directories + appear under the same directory in the web interface +- The third entry maps every Mercurial repository found in '/real/root' + into 'web/root'. This format is preferred over the [collections] one, + since using absolute paths as configuration keys is not supported on every + platform (especially on Windows). +- The fourth entry is a special case mapping all repositories in + '/real/root2' in the root of the virtual directory. +- The fifth entry recursively finds all repositories under the real + root, and maps their relative paths under the virtual root. + +The ``collections`` section provides mappings of trees of physical +repositories paths to virtual ones, though the paths syntax is generally +preferred. For instance:: + + [collections] + /foo = /foo + +Here, the left side will be stripped off all repositories found in the +right side. Thus ``/foo/bar`` and ``foo/quux/baz`` will be listed as +``bar`` and ``quux/baz`` respectively. + +.. _glossary: + +Glossary +-------- + +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: 'Descendant'. + +Branch + (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'. + + 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. + + Example: "The experimental branch". + + (Verb) The action of creating a child changeset which results in + its parent having more than one child. + + Example: "I'm going to branch at X". + +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. + +Branch, closed + A named branch whose branch heads have all been closed. + +Branch, default + The branch assigned to a changeset when no name has previously been + assigned. + +Branch head + See 'Head, branch'. + +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 :hg:`help branch`, :hg:`help branches` and + :hg:`commit --close-branch` for more information on managing + branches. + + 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. + +Branch tip + See 'Tip, branch'. + +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. + +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. + +Changeset + A snapshot of the state of the repository used to record a change. + +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. + +Changeset id + A SHA-1 hash that uniquely identifies a changeset. It may be + represented as either a "long" 40-byte hexadecimal string, or a + "short" 12-byte hexadecimal string. + +Changeset, merge + A changeset with two parents. This occurs when a merge is + committed. + +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. + +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. + + Example: "I'm using checkout X." + + (Verb) Updating the working directory to a specific changeset. See + :hg:`help update`. + + Example: "I'm going to check out changeset X." + +Child changeset + See 'Changeset, child'. + +Close changeset + See 'Changeset, close'. + +Closed branch + See 'Branch, closed'. + +Clone + (Noun) An entire or partial copy of a repository. The partial + clone must be in the form of a revision and its ancestors. + + Example: "Is your clone up to date?". + + (Verb) The process of creating a clone, using :hg:`clone`. + + Example: "I'm going to clone the repository". + +Closed branch head + See 'Head, closed branch'. + +Commit + (Noun) A synonym for changeset. + + Example: "Is the bug fixed in your recent commit?" + + (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. + + Example: "You should commit those changes now." + +Cset + A common abbreviation of the term changeset. + +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 :hg:`glog` + (graphlog). In Mercurial, the DAG is limited by the requirement + for children to have at most two parents. + +Default branch + See 'Branch, default'. + +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: 'Ancestor'. + +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". + + Example: "Did you see my correction in the diff?" + + (Verb) Diffing two changesets is the action of creating a diff or + patch. + + Example: "If you diff with changeset X, you will see what I mean." + +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 + 'Parents, 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. + +Graph + See DAG and :hg:`help graphlog`. + +Head + 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. + + Heads are where development generally takes place and are the + usual targets for update and merge operations. + +Head, branch + A changeset with no descendants on the same named branch. + +Head, closed branch + A changeset that marks a head as no longer interesting. The closed + head is no longer listed by :hg:`heads`. A branch is considered + closed when all its heads are closed and consequently is not + listed by :hg:`branches`. + +Head, repository + A topological head which has not been closed. + +Head, topological + A changeset with no children in the repository. + +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. + +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. + +Immutable history + See 'History, immutable'. + +Merge changeset + See 'Changeset, merge'. + +Manifest + Each changeset has a manifest, which is the list of files that are + tracked by the changeset. + +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. + +Named branch + See 'Branch, named'. + +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 'null' + or by the changeset ID '000000000000'. + +Parent + See 'Changeset, parent'. + +Parent changeset + See 'Changeset, parent'. + +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 :hg:`parents`. This is changed with + :hg:`update`. Other commands to see the working directory parent + are :hg:`summary` and :hg:`id`. Can be specified by the alias ".". + +Patch + (Noun) The product of a diff operation. + + Example: "I've sent you my patch." + + (Verb) The process of using a patch file to transform one + changeset into another. + + Example: "You will need to patch that revision." + +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 :hg:`help pull`. + +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 :hg:`help push`. + +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 ``.hg`` + subdirectory of a working directory. Any recorded state can be + recreated by "updating" a working directory to a specific + changeset. + +Repository head + See 'Head, repository'. + +Revision + A state of the repository at some point in time. Earlier revisions + can be updated to by using :hg:`update`. See also 'Revision + number'; See also 'Changeset'. + +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 + 'Changeset id'. + +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. + +Rewriting history + See 'History, rewriting'. + +Root + A changeset that has only the null changeset as its parent. Most + repositories have only a single root changeset. + +Tip + The changeset with the highest revision number. It is the changeset + most recently added in a repository. + +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 'Branch, head'. Note that because revision + numbers may be different in different repository clones, the + branch tip may be different in different cloned repositories. + +Update + (Noun) Another synonym of changeset. + + Example: "I've pushed an update". + + (Verb) This term is usually used to describe updating the state of + the working directory to that of a specific changeset. See + :hg:`help update`. + + Example: "You should update". + +Working directory + See 'Directory, working'. + +Working directory parent + See 'Parent, working directory'. + diff -Nru mercurial-1.5.4/doc/hg.1.html mercurial-1.6/doc/hg.1.html --- mercurial-1.5.4/doc/hg.1.html 2010-06-01 16:54:16.000000000 +0100 +++ mercurial-1.6/doc/hg.1.html 2010-07-01 18:06:38.000000000 +0100 @@ -3,7 +3,7 @@ - + hg @@ -30,27 +30,30 @@
@@ -138,15 +141,15 @@

Commands

-
add [OPTION]... [FILE]...
+
add [OPTION]... [FILE]...

Schedule files to be version controlled and added to the repository.

The files will be added to the repository at the next commit. To -undo an add before that, see hg forget.

+undo an add before that, see hg forget.

If no names are given, add all files to the repository.

An example showing how new (unknown) files are added -automatically by hg add:

+automatically by hg add:

 $ ls
 foo.c
@@ -177,7 +180,7 @@
 
-
addremove [OPTION]... [FILE]...
+
addremove [OPTION]... [FILE]...

Add all new files and remove all missing files from the repository.

New files are ignored if they match any of the patterns in @@ -189,6 +192,7 @@ option takes a percentage between 0 (disabled) and 100 (files must be identical) as its parameter. Detecting renamed files this way can be expensive.

+

Returns 0 if all files are successfully added.

options:

@@ -212,7 +216,7 @@
-
annotate [-r REV] [-f] [-a] [-u] [-d] [-n] [-c] [-l] FILE...
+
annotate [-r REV] [-f] [-a] [-u] [-d] [-n] [-c] [-l] FILE...

List changes in files, showing the revision id responsible for each line

This command is useful for discovering when a change was made and @@ -221,6 +225,7 @@ it detects as binary. With -a, annotate will annotate the file anyway, although the results will probably be neither useful nor desirable.

+

Returns 0 on success.

options:

@@ -270,35 +275,37 @@
-
archive [OPTION]... DEST
+
archive [OPTION]... DEST

By default, the revision used is the parent of the working directory; use -r/--rev to specify a different revision.

-

To specify the type of archive to create, use -t/--type. Valid -types are:

+

The archive type is automatically detected based on file +extension (or override using -t/--type).

+

Valid types are:

- + - + - + - + - + - +
files:a directory full of files (default)
files:a directory full of files (default)
tar:tar archive, uncompressed
tar:tar archive, uncompressed
tbz2:tar archive, compressed using bzip2
tbz2:tar archive, compressed using bzip2
tgz:tar archive, compressed using gzip
tgz:tar archive, compressed using gzip
uzip:zip archive, uncompressed
uzip:zip archive, uncompressed
zip:zip archive, compressed using deflate
zip:zip archive, compressed using deflate

The exact name of the destination archive or directory is given -using a format string; see 'hg help export' for details.

+using a format string; see hg help export for details.

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.

+

Returns 0 on success.

options:

@@ -327,7 +334,7 @@
-
backout [OPTION]... [-r] REV
+
backout [OPTION]... [-r] REV

Commit the backed out changes as a new changeset. The new changeset is a child of the backed out changeset.

If you backout a changeset other than the tip, a new head is @@ -337,7 +344,8 @@ before starting the backout, then merges the new head with that changeset afterwards. This saves you from doing the merge by hand. The result of this merge is not committed, as with a normal merge.

-

See 'hg help dates' for a list of formats valid for -d/--date.

+

See hg help dates for a list of formats valid for -d/--date.

+

Returns 0 on success.

options:

@@ -360,10 +368,10 @@ - + - + @@ -375,7 +383,7 @@
-
bisect [-gbsr] [-U] [-c CMD] [REV]
+
bisect [-gbsr] [-U] [-c CMD] [REV]

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 @@ -391,6 +399,7 @@ 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.

+

Returns 0 on success.

options:

exclude names matching the given patterns
-m, --messageuse <text> as commit message
use text as commit message
-l, --logfileread commit message from <file>
read commit message from file
-d, --date record datecode as commit date
@@ -419,7 +428,7 @@
-
branch [-fC] [NAME]
+
branch [-fC] [NAME]

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 @@ -430,8 +439,9 @@

Use -C/--clean to reset the working directory branch to that of the parent of the working directory, negating a previous branch change.

-

Use the command 'hg update' to switch to an existing branch. Use -'hg commit --close-branch' to mark this branch as closed.

+

Use the command hg update to switch to an existing branch. Use +hg commit --close-branch to mark this branch as closed.

+

Returns 0 on success.

options:

@@ -448,13 +458,14 @@
-
branches [-ac]
+
branches [-ac]

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 hg commit --close-branch).

+been marked closed (see hg commit --close-branch).

If -a/--active is specified, only show active branches. A branch is considered active if it contains repository heads.

-

Use the command 'hg update' to switch to an existing branch.

+

Use the command hg update to switch to an existing branch.

+

Returns 0.

options:

@@ -471,7 +482,7 @@
-
bundle [-f] [-t TYPE] [-a] [-r REV]... [--base REV]... FILE [DEST]
+
bundle [-f] [-t TYPE] [-a] [-r REV]... [--base REV]... FILE [DEST]

Generate a compressed changegroup file collecting changesets not known to be in another repository.

If you omit the destination repository, then hg assumes the @@ -487,6 +498,7 @@ available or when exporting an entire repository is undesirable.

Applying bundles preserves all changeset contents including permissions, copy/rename information, and revision history.

+

Returns 0 on success, 1 if no changes found.

options:

@@ -521,7 +533,7 @@
-
cat [OPTION]... FILE...
+
cat [OPTION]... FILE...

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.

@@ -532,14 +544,15 @@
- + - + - +
%s:basename of file being printed
%s:basename of file being printed
%d:dirname of file being printed, or '.' if in repository root
%d:dirname of file being printed, or '.' if in repository root
%p:root-relative path name of file being printed
%p:root-relative path name of file being printed
+

Returns 0 on success.

options:

@@ -565,16 +578,16 @@
-
clone [OPTION]... SOURCE [DEST]
+
clone [OPTION]... SOURCE [DEST]

Create a copy of an existing repository in a new directory.

If no destination directory name is specified, it defaults to the basename of the source.

The location of the source is added to the new repository's .hg/hgrc file, as the default to be used for future pulls.

-

See 'hg help urls' for valid source format details.

+

See hg help urls for valid source format details.

It is possible to specify an ssh:// URL as the destination, but no .hg/hgrc and working directory will be created on the remote side. -Please see 'hg help urls' for important details about ssh:// URLs.

+Please see hg help urls for important details about ssh:// URLs.

A set of changesets (tags, or branch names) to pull may be specified by listing each changeset (tag, or branch name) with -r/--rev. If -r/--rev is used, the cloned repository will contain only a subset @@ -616,6 +629,7 @@

  • the tipmost head of the default branch
  • tip
  • +

    Returns 0 on success.

    options:

    @@ -651,17 +665,18 @@
    -
    commit [OPTION]... [FILE]...
    +
    commit [OPTION]... [FILE]...

    Commit changes to the given files into the repository. Unlike a -centralized RCS, this operation is a local operation. See hg push -for a way to actively distribute your changes.

    -

    If a list of files is omitted, all changes reported by "hg status" +centralized RCS, this operation is a local operation. See +hg push for a way to actively distribute your changes.

    +

    If a list of files is omitted, all changes reported by hg status will be committed.

    If you are committing the result of a merge, do not provide any filenames or -I/-X filters.

    If no commit message is specified, the configured editor is started to prompt you for a message.

    -

    See 'hg help dates' for a list of formats valid for -d/--date.

    +

    See hg help dates for a list of formats valid for -d/--date.

    +

    Returns 0 on success, 1 if nothing changed.

    options:

    @@ -682,10 +697,10 @@ - + - + @@ -698,7 +713,7 @@
    -
    copy [OPTION]... [SOURCE]... DEST
    +
    copy [OPTION]... [SOURCE]... DEST

    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.

    @@ -706,7 +721,8 @@ exist in the working directory. If invoked with -A/--after, the operation is recorded, but no copying is performed.

    This command takes effect with the next commit. To undo a copy -before that, see hg revert.

    +before that, see hg revert.

    +

    Returns 0 on success, 1 if errors are encountered.

    options:

    exclude names matching the given patterns
    -m, --messageuse <text> as commit message
    use text as commit message
    -l, --logfileread commit message from <file>
    read commit message from file
    -d, --date record datecode as commit date
    @@ -733,7 +749,7 @@
    -
    diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
    +
    diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...

    Show differences between revisions for the specified files.

    Differences between files are shown using the unified diff format.

    NOTE: diff may generate unexpected results for merges, as it will @@ -750,7 +766,8 @@ files it detects as binary. With -a, diff will generate a diff anyway, probably with undesirable results.

    Use the -g/--git option to generate diffs in the git extended diff -format. For more information, read 'hg help diffs'.

    +format. For more information, read hg help diffs.

    +

    Returns 0 on success.

    options:

    @@ -807,7 +824,7 @@
    -
    export [OPTION]... [-o OUTFILESPEC] REV...
    +
    export [OPTION]... [-o OUTFILESPEC] REV...

    Print the changeset header and diffs for one or more revisions.

    The information shown in the changeset header is: author, date, branch name (if non-default), changeset hash, parent(s) and commit @@ -821,21 +838,21 @@

    - + - + - + - + - + - + - + - +
    %%:literal "%" character
    %%:literal "%" character
    %H:changeset hash (40 bytes of hexadecimal)
    %H:changeset hash (40 bytes of hexadecimal)
    %N:number of patches being generated
    %N:number of patches being generated
    %R:changeset revision number
    %R:changeset revision number
    %b:basename of the exporting repository
    %b:basename of the exporting repository
    %h:short-form changeset hash (12 bytes of hexadecimal)
    %h:short-form changeset hash (12 bytes of hexadecimal)
    %n:zero-padded sequence number, starting at 1
    %n:zero-padded sequence number, starting at 1
    %r:zero-padded changeset revision number
    %r:zero-padded changeset revision number
    @@ -843,9 +860,10 @@ of files it detects as binary. With -a, export will generate a diff anyway, probably with undesirable results.

    Use the -g/--git option to generate diffs in the git extended diff -format. See 'hg help diffs' for more information.

    +format. See hg help diffs for more information.

    With the --switch-parent option, the diff will be against the second parent. It can be useful to review a merge.

    +

    Returns 0 on success.

    options:

    @@ -875,13 +893,14 @@
    -
    forget [OPTION]... FILE...
    +
    forget [OPTION]... FILE...

    Mark the specified files so they will no longer be tracked after the next commit.

    This only removes files from the current branch, not from the entire project history, and it does not delete them from the working directory.

    -

    To undo a forget before the next commit, see hg add.

    +

    To undo a forget before the next commit, see hg add.

    +

    Returns 0 on success.

    options:

    @@ -898,7 +917,7 @@
    -
    grep [OPTION]... PATTERN [FILE]...
    +
    grep [OPTION]... PATTERN [FILE]...

    Search revisions of files for a regular expression.

    This command behaves differently than Unix grep. It only accepts Python/Perl regexps. It searches repository history, not the @@ -909,6 +928,7 @@ 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.

    +

    Returns 0 if a match is found, 1 otherwise.

    options:

    @@ -955,7 +975,7 @@
    -
    heads [-ac] [-r STARTREV] [REV]...
    +
    heads [-ac] [-r REV] [REV]...

    With no arguments, show all repository branch heads.

    Repository "heads" are changesets with no child changesets. They are where development generally takes place and are the usual targets @@ -964,11 +984,12 @@

    If one or more REVs are given, only branch heads on the branches associated with the specified changesets are shown.

    If -c/--closed is specified, also show branch heads marked closed -(see hg commit --close-branch).

    +(see hg commit --close-branch).

    If STARTREV is specified, only those heads that are descendants of STARTREV will be displayed.

    If -t/--topo is specified, named branch mechanics will be ignored and only changesets without children will be shown.

    +

    Returns 0 if matching heads are found, 1 if not.

    options:

    @@ -997,14 +1018,15 @@
    -
    help [TOPIC]
    +
    help [TOPIC]

    With no arguments, print a list of commands with short help messages.

    -

    Given a topic, extension, or command name, print help for that +

    Given a topic, extension, or command name, print help for that topic.

    +

    Returns 0 if successful.

    -
    identify [-nibt] [-r REV] [SOURCE]
    +
    identify [-nibt] [-r REV] [SOURCE]

    With no revision, print a summary of the current state of the repository.

    Specifying a path to a repository root or Mercurial bundle will @@ -1013,6 +1035,7 @@ parent hash identifiers, followed by a "+" if there are uncommitted changes in the working directory, a list of tags for this revision and a branch name for non-default branches.

    +

    Returns 0 if successful.

    options:

    @@ -1039,7 +1062,7 @@
    -
    import [OPTION]... PATCH...
    +
    import [OPTION]... PATCH...

    Import a list of patches and commit them individually (unless --no-commit is specified).

    If there are outstanding changes in the working directory, import @@ -1050,7 +1073,7 @@ message are used as default committer and commit message. All text/plain body parts before first diff are added to commit message.

    -

    If the imported patch was generated by hg export, user and +

    If the imported patch was generated by hg export, 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.

    @@ -1063,7 +1086,8 @@ copies in the patch in the same way as 'addremove'.

    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 'hg help dates' for a list of formats valid for -d/--date.

    +See hg help dates for a list of formats valid for -d/--date.

    +

    Returns 0 on success.

    options:

    @@ -1090,10 +1114,10 @@ - + - + @@ -1110,13 +1134,14 @@
    -
    incoming [-p] [-n] [-M] [-f] [-r REV]... [--bundle FILENAME] [SOURCE]
    +
    incoming [-p] [-n] [-M] [-f] [-r REV]... [--bundle FILENAME] [SOURCE]

    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.

    For remote repository, using --bundle avoids downloading the changesets twice if the incoming is followed by a pull.

    See pull for valid source format details.

    +

    Returns 0 if there are incoming changes, 1 otherwise.

    options:

     use any branch information in patch (implied by --exact)
    -m, --messageuse <text> as commit message
    use text as commit message
    -l, --logfileread commit message from <file>
    read commit message from file
    -d, --date record datecode as commit date
    @@ -1152,6 +1177,9 @@ + +
     do not show merges
    +--statoutput diffstat-style summary of changes
    --style display using template map file
    @@ -1169,12 +1197,13 @@
    -
    init [-e CMD] [--remotecmd CMD] [DEST]
    +
    init [-e CMD] [--remotecmd CMD] [DEST]

    Initialize a new repository in the given directory. If the given directory does not exist, it will be created.

    If no directory is given, the current directory is used.

    It is possible to specify an ssh:// URL as the destination. -See 'hg help urls' for more information.

    +See hg help urls for more information.

    +

    Returns 0 on success.

    options:

    @@ -1191,7 +1220,7 @@
    -
    locate [OPTION]... [PATTERN]...
    +
    locate [OPTION]... [PATTERN]...

    Print files under Mercurial control in the working directory whose names match the given patterns.

    By default, this command searches all directories in the working @@ -1203,6 +1232,7 @@ 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.

    +

    Returns 0 if a match is found, 1 otherwise.

    options:

    @@ -1228,7 +1258,7 @@
    -
    log [OPTION]... [FILE]
    +
    log [OPTION]... [FILE]

    Print the revision history of the specified files or the entire project.

    File history is shown without following rename or copy history of @@ -1238,8 +1268,9 @@ only follows the first parent of merge revisions.

    If no revision range is specified, the default is tip:0 unless --follow is set, in which case the working directory parent is -used as the starting revision.

    -

    See 'hg help dates' for a list of formats valid for -d/--date.

    +used as the starting revision. You can specify a revision set for +log, see hg help revsets for more information.

    +

    See hg help dates for a list of formats valid for -d/--date.

    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 @@ -1248,6 +1279,7 @@ changesets, as it will only compare the merge changeset against its first parent. Also, only files different from BOTH parents will appear in files:.

    +

    Returns 0 on success.

    options:

    @@ -1267,7 +1299,7 @@ - + @@ -1281,10 +1313,12 @@ - - - + + + + @@ -1302,6 +1336,9 @@ + +
    show copied files
    -k, --keyworddo case-insensitive search for a keyword
    do case-insensitive search for a given text
    -r, --rev show the specified revision or range
    -u, --user revisions committed by user
    --b, --only-branch
     show only changesets within the given named branch
    +--only-branchshow only changesets within the given named branch (DEPRECATED)
    +-b, --branchshow changesets within the given named branch
    -P, --prune do not display revision or any of its ancestors
     do not show merges
    +--statoutput diffstat-style summary of changes
    --style display using template map file
    @@ -1319,12 +1356,13 @@
    -
    manifest [-r REV]
    +
    manifest [-r REV]

    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.

    With -v, print file permissions, symlink and executable bits. With --debug, print file revision hashes.

    +

    Returns 0 on success.

    options:

    @@ -1338,7 +1376,7 @@
    -
    merge [-P] [-f] [[-r] REV]
    +
    merge [-P] [-f] [[-r] REV]

    The current working directory is updated with all changes made in the requested revision since the last common predecessor revision.

    Files that changed between either parent are marked as changed for @@ -1349,6 +1387,10 @@ 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.

    +

    To undo an uncommitted merge, use hg update --clean . which +will check out a clean copy of the original merge parent, losing +all changes.

    +

    Returns 0 on success, 1 if there are unresolved files.

    options:

    @@ -1368,11 +1410,12 @@
    -
    outgoing [-M] [-p] [-n] [-f] [-r REV]... [DEST]
    +
    outgoing [-M] [-p] [-n] [-f] [-r REV]... [DEST]

    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.

    See pull for details of valid destination formats.

    +

    Returns 0 if there are outgoing changes, 1 otherwise.

    options:

    @@ -1405,6 +1448,9 @@ + +
     do not show merges
    +--statoutput diffstat-style summary of changes
    --style display using template map file
    @@ -1422,12 +1468,13 @@
    -
    parents [-r REV] [FILE]
    +
    parents [-r REV] [FILE]

    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.

    +

    Returns 0 on success.

    options:

    @@ -1447,37 +1494,39 @@
    -
    paths [NAME]
    +
    paths [NAME]

    Show definition of symbolic path name NAME. If no name is given, show definition of all available names.

    -

    Path names are defined in the [paths] section of /etc/mercurial/hgrc -and $HOME/.hgrc. If run inside a repository, .hg/hgrc is used, too.

    -

    The path names default and default-push have a special +

    Path names are defined in the [paths] section of +/etc/mercurial/hgrc and $HOME/.hgrc. If run inside a +repository, .hg/hgrc is used, too.

    +

    The path names default and default-push 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 default-push is set, it will be used for push and -default will be used for pull; otherwise default is used +default will be used for pull; otherwise default is used as the fallback for both. When cloning a repository, the clone -source is written as default in .hg/hgrc. Note that -default and default-push apply to all inbound (e.g. hg -incoming) and outbound (e.g. hg outgoing, hg email and -hg bundle) operations.

    -

    See 'hg help urls' for more information.

    +source is written as default in .hg/hgrc. Note that +default and default-push apply to all inbound (e.g. +hg incoming) and outbound (e.g. hg outgoing, hg email and +hg bundle) operations.

    +

    See hg help urls for more information.

    -
    pull [-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [SOURCE]
    +
    pull [-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [SOURCE]

    Pull changes from a remote repository to a local one.

    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.

    -

    Use hg incoming 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 -added those changes to the repository, you should use pull -r X -where X is the last changeset listed by hg incoming.

    +

    Use hg incoming 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 hg pull +-r X where X is the last changeset listed by hg incoming.

    If SOURCE is omitted, the 'default' path will be used. -See 'hg help urls' for more information.

    +See hg help urls for more information.

    +

    Returns 0 on success, 1 if an update had unresolved files.

    options:

    @@ -1506,7 +1555,7 @@
    -
    push [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]
    +
    push [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]

    Push changesets from the local repository to the specified destination.

    This operation is symmetrical to pull: it is identical to a pull @@ -1515,12 +1564,16 @@ destination, since multiple heads would make it unclear which head to use. In this situation, it is recommended to pull and merge before pushing.

    +

    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.

    Use -f/--force to override the default behavior and push all changesets on all branches.

    If -r/--rev is used, the specified revision and all its ancestors will be pushed to the remote repository.

    -

    Please see 'hg help urls' for important details about ssh:// +

    Please see hg help urls for important details about ssh:// URLs. If DESTINATION is omitted, a default path will be used.

    +

    Returns 0 if push was successful, 1 if nothing to push.

    options:

    @@ -1536,6 +1589,9 @@ -b, --branch + +
    a specific branch you would like to push
    +--new-branchallow pushing a new branch
    -e, --ssh specify ssh command to use
    @@ -1546,15 +1602,16 @@
    -
    recover
    +
    recover

    Recover from an interrupted commit or pull.

    -

    This command tries to fix the repository status after an +

    This command tries to fix the repository status after an interrupted operation. It should only be necessary when Mercurial suggests it.

    +

    Returns 0 if successful, 1 if nothing to recover or verify fails.

    -
    remove [OPTION]... FILE...
    +
    remove [OPTION]... FILE...

    Schedule the indicated files for removal from the repository.

    This only removes files from the current branch, not from the entire project history. -A/--after can be used to remove only @@ -1564,8 +1621,8 @@

    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 hg status). The actions are Warn, Remove (from branch) -and Delete (from disk):

    +reported by hg status). The actions are Warn, Remove (from +branch) and Delete (from disk):

            A  C  M  !
     none   W  RD W  R
    @@ -1574,7 +1631,8 @@
     -Af    R  R  R  R
     

    This command schedules the files to be removed at the next commit. -To undo a remove before that, see hg revert.

    +To undo a remove before that, see hg revert.

    +

    Returns 0 on success, 1 if any warnings encountered.

    options:

    @@ -1598,7 +1656,7 @@
    -
    rename [OPTION]... SOURCE... DEST
    +
    rename [OPTION]... SOURCE... DEST

    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.

    @@ -1606,7 +1664,8 @@ exist in the working directory. If invoked with -A/--after, the operation is recorded, but no copying is performed.

    This command takes effect at the next commit. To undo a rename -before that, see hg revert.

    +before that, see hg revert.

    +

    Returns 0 on success, 1 if errors are encountered.

    options:

    @@ -1633,31 +1692,32 @@
    -
    resolve [OPTION]... [FILE]...
    +
    resolve [OPTION]... [FILE]...

    This command includes several actions that are often useful while -performing a merge, after running merge but before running -commit. (It is only meaningful if your working directory has +performing a merge, after running merge but before running +commit. (It is only meaningful if your working directory has two parents.) It is most relevant for merges with unresolved conflicts, which are typically a result of non-interactive merging with -internal:merge or a command-line merge tool like diff3.

    +internal:merge or a command-line merge tool like diff3.

    The available actions are:

    1. list files that were merged with conflicts (U, for unresolved) -and without conflicts (R, for resolved): hg resolve -l -(this is like status for merges)
    2. +and without conflicts (R, for resolved): hg resolve -l +(this is like status for merges)
    3. record that you have resolved conflicts in certain files: -hg resolve -m [file ...] (default: mark all unresolved files)
    4. +hg resolve -m [file ...] (default: mark all unresolved files)
    5. forget that you have resolved conflicts in certain files: -hg resolve -u [file ...] (default: unmark all resolved files)
    6. +hg resolve -u [file ...] (default: unmark all resolved files)
    7. discard your current attempt(s) at resolving conflicts and -restart the merge from scratch: hg resolve file... +restart the merge from scratch: hg resolve file... (or -a for all unresolved files)

    Note that Mercurial will not let you commit files with unresolved merge -conflicts. You must use hg resolve -m ... before you can commit +conflicts. You must use hg resolve -m ... before you can commit after a conflicting merge.

    +

    Returns 0 on success, 1 if any files fail a resolve attempt.

    options:

    @@ -1690,9 +1750,12 @@
    -
    revert [OPTION]... [-r REV] [NAME]...
    -

    (Use update -r to check out earlier revisions, revert does not -change the working directory parents.)

    +
    revert [OPTION]... [-r REV] [NAME]...
    +

    NOTE: This command is most likely not what you are looking for. revert +will partially overwrite content in the working directory without changing +the working directory parents. Use hg update -r rev to check out earlier +revisions, or hg update --clean . to undo a merge which has added +another parent.

    With no revision specified, revert the named files or directories to the contents they had in the parent of the working directory. This restores the contents of the affected files to an unmodified @@ -1701,8 +1764,8 @@ revision.

    Using the -r/--rev option, revert the given files or directories to their contents as of a specific revision. This can be helpful -to "roll back" some or all of an earlier change. See 'hg help -dates' for a list of formats valid for -d/--date.

    +to "roll back" some or all of an earlier change. See hg help +dates for a list of formats valid for -d/--date.

    Revert modifies the working directory. It does not commit any changes, or change the parent of the working directory. If you revert to a revision other than the parent of the working @@ -1714,6 +1777,7 @@ If no arguments are given, no files are reverted.

    Modified files are saved with a .orig suffix before reverting. To disable these backups, use --no-backup.

    +

    Returns 0 on success.

    options:

    @@ -1745,7 +1809,7 @@
    -
    rollback
    +
    rollback

    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 @@ -1762,32 +1826,49 @@

  • push (with this repository as the destination)
  • unbundle
  • -

    This command is not intended for use on public repositories. Once +

    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.

    +

    Returns 0 on success, 1 if no rollback data is available.

    +

    options:

    +
    +++ + + + +
    +-n, --dry-rundo not perform actions, just print output
    -
    root
    -
    Print the root directory of the current repository.
    +
    root
    +

    Print the root directory of the current repository.

    +

    Returns 0 on success.

    +
    -
    serve [OPTION]...
    +
    serve [OPTION]...

    Start a local HTTP repository browser and pull server. You can use this for ad-hoc sharing and browing of repositories. It is recommended to use a real web server to serve a repository for longer periods of time.

    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 web.allow_push -option to * to allow everybody to push to the server. You +nobody can write to it by default. Set the web.allow_push +option to * to allow everybody to push to the server. You should use a real web server if you need to authenticate users.

    By default, the server logs accesses to stdout and errors to stderr. Use the -A/--accesslog and -E/--errorlog options to log to files.

    +

    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.

    +

    Returns 0 on success.

    options:

    @@ -1820,8 +1901,11 @@ -n, --name + + - + @@ -1846,7 +1930,7 @@
    -
    showconfig [-u] [NAME]...
    +
    showconfig [-u] [NAME]...

    With no arguments, print names and values of all config items.

    With one argument of the form section.name, print just the value of that config item.

    @@ -1854,6 +1938,7 @@ items with matching section names.

    With --debug, the source (filename and line number) is printed for each config item.

    +

    Returns 0 on success.

    options:

    name to show in web pages (default: working directory)
    +--web-confname of the hgweb config file (serve more than one repository)
    --webdir-confname of the webdir config file (serve more than one repository)
    name of the hgweb config file (DEPRECATED)
    --pid-file name of file to write process ID to
    @@ -1869,7 +1954,7 @@
    -
    status [OPTION]... [FILE]...
    +
    status [OPTION]... [FILE]...

    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 @@ -1897,6 +1982,7 @@ I = ignored = origin of the previous file listed as A (added) +

    Returns 0 on success.

    options:

    @@ -1954,11 +2040,12 @@
    -
    summary [--remote]
    +
    summary [--remote]

    This generates a brief summary of the working directory state, including parents, branch, commit status, and available updates.

    With the --remote option, this will check the default paths for incoming and outgoing changes. This can be time-consuming.

    +

    Returns 0 on success.

    options:

    @@ -1973,7 +2060,7 @@
    -
    tag [-f] [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME...
    +
    tag [-f] [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME...

    Name a particular revision using <name>.

    Tags are used to name particular revisions of the repository and are very useful to compare different revisions, to go back to significant @@ -1985,7 +2072,10 @@ similarly to other project files and can be hand-edited if necessary. The file '.hg/localtags' is used for local tags (not shared among repositories).

    -

    See 'hg help dates' for a list of formats valid for -d/--date.

    +

    See hg help dates for a list of formats valid for -d/--date.

    +

    Since tag names have priority over branch names during revision +lookup, using an existing branch name as a tag name is discouraged.

    +

    Returns 0 on success.

    options:

    @@ -2004,6 +2094,9 @@ --remove + +
    remove a tag
    +-e, --editedit commit message
    -m, --message use <text> as commit message
    @@ -2017,12 +2110,14 @@
    -
    tags
    -
    This lists both regular and local tags. When the -v/--verbose -switch is used, a third column "local" is printed for local tags.
    +
    tags
    +

    This lists both regular and local tags. When the -v/--verbose +switch is used, a third column "local" is printed for local tags.

    +

    Returns 0 on success.

    +
    -
    tip [-p] [-g]
    +
    tip [-p] [-g]

    The tip revision (usually just called the tip) is the changeset most recently added to the repository (and therefore the most recently changed head).

    @@ -2030,6 +2125,7 @@ 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.

    +

    Returns 0 on success.

    options:

    @@ -2052,9 +2148,10 @@
    -
    unbundle [-u] FILE...
    +
    unbundle [-u] FILE...

    Apply one or more compressed changegroup files generated by the bundle command.

    +

    Returns 0 on success, 1 if an update has unresolved files.

    options:

    @@ -2068,7 +2165,7 @@
    -
    update [-c] [-C] [-d DATE] [[-r] REV]
    +
    update [-c] [-C] [-d DATE] [[-r] REV]

    Update the repository's working directory to the specified changeset.

    If no changeset is specified, attempt to update to the head of the @@ -2090,10 +2187,11 @@

  • With the -C/--clean option, uncommitted changes are discarded and the working directory is updated to the requested changeset.
  • -

    Use null as the changeset to remove the working directory (like 'hg -clone -U').

    -

    If you want to update just one file to an older changeset, use 'hg revert'.

    -

    See 'hg help dates' for a list of formats valid for -d/--date.

    +

    Use null as the changeset to remove the working directory (like +hg clone -U).

    +

    If you want to update just one file to an older changeset, use hg revert.

    +

    See hg help dates for a list of formats valid for -d/--date.

    +

    Returns 0 on success, 1 if there are unresolved files.

    options:

    @@ -2117,16 +2215,17 @@
    -
    verify
    +
    verify

    Verify the integrity of the current repository.

    -

    This will perform an extensive check of the repository's +

    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.

    +

    Returns 0 on success, 1 if errors are encountered.

    -
    version
    +
    version
    output version and copyright information
    @@ -2138,35 +2237,49 @@
    • <repo>\.hg\hgrc
    • %USERPROFILE%\.hgrc
    • -
    • %USERPROFILE%\Mercurial.ini
    • +
    • %USERPROFILE%\mercurial.ini
    • %HOME%\.hgrc
    • -
    • %HOME%\Mercurial.ini
    • -
    • C:\Mercurial\Mercurial.ini
    • -
    • HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial
    • -
    • <install-dir>\Mercurial.ini
    • +
    • %HOME%\mercurial.ini
    • +
    • C:\mercurial\mercurial.ini (unless regkey or hgrc.dor mercurial.ini found)
    • +
    • HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial (unless hgrc.dor mercurial.ini found)
    • +
    • <hg.exe-dir>\hgrc.d\*.rc (unless mercurial.ini found)
    • +
    • <hg.exe-dir>\mercurial.ini

    On Unix, these files are read:

    • <repo>/.hg/hgrc
    • $HOME/.hgrc
    • -
    • /etc/mercurial/hgrc
    • +
    • /etc/mercurial/hgrc
    • /etc/mercurial/hgrc.d/*.rc
    • <install-root>/etc/mercurial/hgrc
    • <install-root>/etc/mercurial/hgrc.d/*.rc
    +

    If there is a per-repository configuration file which is not owned by +the active user, Mercurial will warn you that the file is skipped:

    +
    +not trusting file <repo>/.hg/hgrc from untrusted user USER, group GROUP
    +
    +

    If this bothers you, the warning can be silenced (the file would still +be ignored) or trust can be established. Use one of the following +settings, the syntax is explained below:

    +
      +
    • ui.report_untrusted = False
    • +
    • trusted.users = USER
    • +
    • trusted.groups = GROUP
    • +

    The configuration files for Mercurial use a simple ini-file format. A -configuration file consists of sections, led by a [section] header -and followed by name = value entries:

    +configuration file consists of sections, led by a [section] header +and followed by name = value entries:

     [ui]
     username = Firstname Lastname <firstname.lastname@example.net>
     verbose = True
     
    -

    This above entries will be referred to as ui.username and -ui.verbose, respectively. Please see the hgrc man page for a full +

    The above entries will be referred to as ui.username and +ui.verbose, respectively. Please see the hgrc man page for a full description of the possible configuration values:

    @@ -2179,23 +2292,23 @@

    Many date formats are valid. Here are some examples:

      -
    • Wed Dec 6 13:18:29 2006 (local timezone assumed)
    • -
    • Dec 6 13:18 -0600 (year assumed, time offset provided)
    • -
    • Dec 6 13:18 UTC (UTC and GMT are aliases for +0000)
    • -
    • Dec 6 (midnight)
    • -
    • 13:18 (today assumed)
    • -
    • 3:39 (3:39AM assumed)
    • -
    • 3:39pm (15:39)
    • -
    • 2006-12-06 13:18:29 (ISO 8601 format)
    • -
    • 2006-12-6 13:18
    • +
    • Wed Dec 6 13:18:29 2006 (local timezone assumed)
    • +
    • Dec 6 13:18 -0600 (year assumed, time offset provided)
    • +
    • Dec 6 13:18 UTC (UTC and GMT are aliases for +0000)
    • +
    • Dec 6 (midnight)
    • +
    • 13:18 (today assumed)
    • +
    • 3:39 (3:39AM assumed)
    • +
    • 3:39pm (15:39)
    • +
    • 2006-12-06 13:18:29 (ISO 8601 format)
    • +
    • 2006-12-6 13:18
    • 2006-12-6
    • 12-6
    • -
    • 12/6
    • -
    • 12/6/6 (Dec 6 2006)
    • +
    • 12/6
    • +
    • 12/6/6 (Dec 6 2006)

    Lastly, there is Mercurial's internal format:

      -
    • 1165432709 0 (Wed Dec 6 13:18:29 2006 UTC)
    • +
    • 1165432709 0 (Wed Dec 6 13:18:29 2006 UTC)

    This is the internal representation format for dates. unixtime is the number of seconds since the epoch (1970-01-01 00:00 UTC). offset is @@ -2203,9 +2316,9 @@ the timezone is east of UTC).

    The log command also accepts date ranges:

      -
    • <{datetime} - at or before a given date/time
    • -
    • >{datetime} - on or after a given date/time
    • -
    • {datetime} to {datetime} - a date range, inclusive
    • +
    • <{datetime} - at or before a given date/time
    • +
    • >{datetime} - on or after a given date/time
    • +
    • {datetime} to {datetime} - a date range, inclusive
    • -{days} - within a given number of days of today
    @@ -2217,14 +2330,14 @@ patterns.

    Alternate pattern notations must be specified explicitly.

    To use a plain path name without any pattern matching, start it with -path:. These path names must completely match starting at the +path:. These path names must completely match starting at the current repository root.

    -

    To use an extended glob, start a name with glob:. Globs are rooted -at the current directory; a glob such as *.c will only match files -in the current directory ending with .c.

    -

    The supported glob syntax extensions are ** to match any string -across path separators and {a,b} to mean "a or b".

    -

    To use a Perl/Python regular expression, start a name with re:. +

    To use an extended glob, start a name with glob:. Globs are rooted +at the current directory; a glob such as *.c will only match files +in the current directory ending with .c.

    +

    The supported glob syntax extensions are ** to match any string +across path separators and {a,b} to mean "a or b".

    +

    To use a Perl/Python regular expression, start a name with re:. Regexp pattern matching is anchored at the root of the repository.

    Plain examples:

    @@ -2306,7 +2419,7 @@
     
  • hgrc files from the HGRCPATH
  • EMAIL
  • interactive prompt
  • -
  • LOGNAME (with @hostname appended)
  • +
  • LOGNAME (with @hostname appended)
  • (deprecated, use .hgrc)

    @@ -2366,6 +2479,140 @@

    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.

    +
    +

    Specifying Revision Sets

    +

    Mercurial supports a functional language for selecting a set of +revisions.

    +

    The language supports a number of predicates which are joined by infix +operators. Parenthesis can be used for grouping.

    +

    Identifiers such as branch names must be quoted with single or double +quotes if they contain characters outside of +[._a-zA-Z0-9\x80-\xff] or if they match one of the predefined +predicates. Special characters can be used in quoted identifiers by +escaping them, e.g., \n is interpreted as a newline.

    +

    There is a single prefix operator:

    +
    +
    not x
    +
    Changesets not in x. Short form is ! x.
    +
    +

    These are the supported infix operators:

    +
    +
    x::y
    +

    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 ancestors(y), if the second +is left out it is equivalent to descendants(x).

    +

    An alternative syntax is x..y.

    +
    +
    x:y
    +
    All changesets with revision numbers between x and y, both +inclusive. Either endpoint can be left out, they default to 0 and +tip.
    +
    x and y
    +
    The intersection of changesets in x and y. Short form is x & y.
    +
    x or y
    +
    The union of changesets in x and y. There are two alternative short +forms: x | y and x + y.
    +
    x - y
    +
    Changesets in x but not in y.
    +
    +

    The following predicates are supported:

    +
    +
    adds(pattern)
    +
    Changesets that add a file matching pattern.
    +
    all()
    +
    All changesets, the same as 0:tip.
    +
    ancestor(single, single)
    +
    Greatest common ancestor of the two changesets.
    +
    ancestors(set)
    +
    Changesets that are ancestors of a changeset in set.
    +
    author(string)
    +
    Alias for user(string).
    +
    branch(set)
    +
    The branch names are found for changesets in set, and the result is +all changesets belonging to one those branches.
    +
    children(set)
    +
    Child changesets of changesets in set.
    +
    closed()
    +
    Changeset is closed.
    +
    contains(pattern)
    +
    Revision contains pattern.
    +
    date(interval)
    +
    Changesets within the interval, see hg help dates.
    +
    descendants(set)
    +
    Changesets which are decendants of changesets in set.
    +
    file(pattern)
    +
    Changesets which manually affected files matching pattern.
    +
    follow()
    +
    An alias for ::. (ancestors of the working copy's first parent).
    +
    grep(regex)
    +
    Like keyword(string) but accepts a regex.
    +
    head()
    +
    Changeset is a head.
    +
    heads(set)
    +
    Members of set with no children in set.
    +
    keyword(string)
    +
    Search commit message, user name, and names of changed files for +string.
    +
    limit(set, n)
    +
    First n members of set.
    +
    max(set)
    +
    Changeset with highest revision number in set.
    +
    merge()
    +
    Changeset is a merge changeset.
    +
    modifies(pattern)
    +
    Changesets which modify files matching pattern.
    +
    outgoing([path])
    +
    Changesets missing in path.
    +
    p1(set)
    +
    First parent of changesets in set.
    +
    p2(set)
    +
    Second parent of changesets in set.
    +
    parents(set)
    +
    The set of all parents for all changesets in set.
    +
    removes(pattern)
    +
    Changesets which remove files matching pattern.
    +
    reverse(set)
    +
    Reverse order of set.
    +
    roots(set)
    +
    Changesets with no parent changeset in set.
    +
    sort(set[, [-]key...])
    +

    Sort set by keys. The default sort order is ascending, specify a key +as -key to sort in descending order.

    +

    The keys can be:

    +
      +
    • rev for the revision number,
    • +
    • branch for the branch name,
    • +
    • desc for the commit message (description),
    • +
    • user for user name (author can be used as an alias),
    • +
    • date for the commit date
    • +
    +
    +
    tagged()
    +
    Changeset is tagged.
    +
    user(string)
    +
    User name is string.
    +
    +

    Command line equivalents for hg log:

    +
    +-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)
    +
    +

    Some sample queries:

    +
    +hg log -r 'branch(default)'
    +hg log -r 'branch(default) and 1.5:: and not merge()'
    +hg log -r '1.3::1.5 and keyword(bug) and file("hgext/*")'
    +hg log -r 'sort(date("May 2008"), user)'
    +hg log -r '(keyword(bug) or keyword(issue)) and not ancestors(tagged())'
    +
    +

    Diff Formats

    Mercurial's default format for showing changes between two versions of @@ -2384,7 +2631,7 @@ by default because a few widespread tools still do not understand this format.

    This means that when generating diffs from a Mercurial repository -(e.g. with "hg export"), you should be careful about things like file +(e.g. with hg export), 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 @@ -2501,12 +2748,12 @@ timezone: "Mon Sep 04 15:13:13 2006 0700".

    +address, and extracts just the domain component. Example: User +<user@example.com> becomes example.com. +address. Example: User <user@example.com> becomes +user@example.com. @@ -2571,11 +2818,11 @@ ssh://[user[:pass]@]host[:port]/[path][#revision]

    Paths in the local filesystem can either point to Mercurial -repositories or to bundle files (as created by 'hg bundle' or 'hg -incoming --bundle').

    +repositories or to bundle files (as created by hg bundle or :hg:` +incoming --bundle`).

    An optional identifier after # indicates a particular branch, tag, or -changeset to use from the remote repository. See also 'hg help -revisions'.

    +changeset to use from the remote repository. See also hg help +revisions.

    Some features, such as pushing to http:// and https:// URLs are only possible if the feature is explicitly enabled on the remote Mercurial server.

    @@ -2611,7 +2858,7 @@ ...

    You can then use the alias for any command that uses a URL (for -example 'hg pull alias1' will be treated as 'hg pull URL1').

    +example hg pull alias1 will be treated as hg pull URL1).

    Two path aliases are special because they are used as defaults when you do not provide the URL to a command:

    @@ -2737,26 +2984,364 @@
    domain:Any text. Finds the first string that looks like an email -address, and extracts just the domain component. Example: User -<user@example.com> becomes example.com.
    email:Any text. Extracts the first string that looks like an email -address. Example: User <user@example.com> becomes -user@example.com.
    escape:Any text. Replaces the special XML/XHTML characters "&", "<" and ">" with XML entities.
    +
    +

    Configuring hgweb

    +

    Mercurial's internal web server, hgweb, can serve either a single +repository, or a collection of them. In the latter case, a special +configuration file can be used to specify the repository paths to use +and global web configuration options.

    +

    This file uses the same syntax as hgrc configuration files, but only +the following sections are recognized:

    +
    +
      +
    • web
    • +
    • paths
    • +
    • collections
    • +
    +
    +

    The web section can specify all the settings described in the web +section of the hgrc documentation.

    +

    The paths section provides mappings of physical repository +paths to virtual ones. For instance:

    +
    +[paths]
    +projects/a = /foo/bar
    +projects/b = /baz/quux
    +web/root = /real/root/*
    +/ = /real/root2/*
    +virtual/root2 = /real/root2/**
    +
    +
      +
    • The first two entries make two repositories in different directories +appear under the same directory in the web interface
    • +
    • The third entry maps every Mercurial repository found in '/real/root' +into 'web/root'. This format is preferred over the [collections] one, +since using absolute paths as configuration keys is not supported on every +platform (especially on Windows).
    • +
    • The fourth entry is a special case mapping all repositories in +'/real/root2' in the root of the virtual directory.
    • +
    • The fifth entry recursively finds all repositories under the real +root, and maps their relative paths under the virtual root.
    • +
    +

    The collections section provides mappings of trees of physical +repositories paths to virtual ones, though the paths syntax is generally +preferred. For instance:

    +
    +[collections]
    +/foo = /foo
    +
    +

    Here, the left side will be stripped off all repositories found in the +right side. Thus /foo/bar and foo/quux/baz will be listed as +bar and quux/baz respectively.

    +
    +
    +

    Glossary

    +
    +
    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: 'Descendant'.
    +
    Branch
    +

    (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'.

    +

    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.

    +

    Example: "The experimental branch".

    +

    (Verb) The action of creating a child changeset which results in +its parent having more than one child.

    +

    Example: "I'm going to branch at X".

    +
    +
    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.
    +
    Branch, closed
    +
    A named branch whose branch heads have all been closed.
    +
    Branch, default
    +
    The branch assigned to a changeset when no name has previously been +assigned.
    +
    Branch head
    +
    See 'Head, branch'.
    +
    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 hg help branch, hg help branches and +hg commit --close-branch for more information on managing +branches.

    +

    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.

    +
    +
    Branch tip
    +
    See 'Tip, branch'.
    +
    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.
    +
    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.
    +
    Changeset
    +
    A snapshot of the state of the repository used to record a change.
    +
    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.
    +
    Changeset id
    +
    A SHA-1 hash that uniquely identifies a changeset. It may be +represented as either a "long" 40-byte hexadecimal string, or a +"short" 12-byte hexadecimal string.
    +
    Changeset, merge
    +
    A changeset with two parents. This occurs when a merge is +committed.
    +
    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.
    +
    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.

    +

    Example: "I'm using checkout X."

    +

    (Verb) Updating the working directory to a specific changeset. See +hg help update.

    +

    Example: "I'm going to check out changeset X."

    +
    +
    Child changeset
    +
    See 'Changeset, child'.
    +
    Close changeset
    +
    See 'Changeset, close'.
    +
    Closed branch
    +
    See 'Branch, closed'.
    +
    Clone
    +

    (Noun) An entire or partial copy of a repository. The partial +clone must be in the form of a revision and its ancestors.

    +

    Example: "Is your clone up to date?".

    +

    (Verb) The process of creating a clone, using hg clone.

    +

    Example: "I'm going to clone the repository".

    +
    +
    Closed branch head
    +
    See 'Head, closed branch'.
    +
    Commit
    +

    (Noun) A synonym for changeset.

    +

    Example: "Is the bug fixed in your recent commit?"

    +

    (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.

    +

    Example: "You should commit those changes now."

    +
    +
    Cset
    +
    A common abbreviation of the term changeset.
    +
    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 hg glog +(graphlog). In Mercurial, the DAG is limited by the requirement +for children to have at most two parents.
    +
    Default branch
    +
    See 'Branch, default'.
    +
    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: 'Ancestor'.
    +
    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".

    +

    Example: "Did you see my correction in the diff?"

    +

    (Verb) Diffing two changesets is the action of creating a diff or +patch.

    +

    Example: "If you diff with changeset X, you will see what I mean."

    +
    +
    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 +'Parents, 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.
    +
    Graph
    +
    See DAG and hg help graphlog.
    +
    Head
    +

    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.

    +

    Heads are where development generally takes place and are the +usual targets for update and merge operations.

    +
    +
    Head, branch
    +
    A changeset with no descendants on the same named branch.
    +
    Head, closed branch
    +
    A changeset that marks a head as no longer interesting. The closed +head is no longer listed by hg heads. A branch is considered +closed when all its heads are closed and consequently is not +listed by hg branches.
    +
    Head, repository
    +
    A topological head which has not been closed.
    +
    Head, topological
    +
    A changeset with no children in the repository.
    +
    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.
    +
    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.
    +
    Immutable history
    +
    See 'History, immutable'.
    +
    Merge changeset
    +
    See 'Changeset, merge'.
    +
    Manifest
    +
    Each changeset has a manifest, which is the list of files that are +tracked by the changeset.
    +
    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.
    +
    Named branch
    +
    See 'Branch, named'.
    +
    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 'null' +or by the changeset ID '000000000000'.
    +
    Parent
    +
    See 'Changeset, parent'.
    +
    Parent changeset
    +
    See 'Changeset, parent'.
    +
    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 hg parents. This is changed with +hg update. Other commands to see the working directory parent +are hg summary and hg id. Can be specified by the alias ".".
    +
    Patch
    +

    (Noun) The product of a diff operation.

    +

    Example: "I've sent you my patch."

    +

    (Verb) The process of using a patch file to transform one +changeset into another.

    +

    Example: "You will need to patch that revision."

    +
    +
    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 hg help pull.
    +
    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 hg help push.
    +
    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 .hg +subdirectory of a working directory. Any recorded state can be +recreated by "updating" a working directory to a specific +changeset.
    +
    Repository head
    +
    See 'Head, repository'.
    +
    Revision
    +
    A state of the repository at some point in time. Earlier revisions +can be updated to by using hg update. See also 'Revision +number'; See also 'Changeset'.
    +
    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 +'Changeset id'.
    +
    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.
    +
    Rewriting history
    +
    See 'History, rewriting'.
    +
    Root
    +
    A changeset that has only the null changeset as its parent. Most +repositories have only a single root changeset.
    +
    Tip
    +
    The changeset with the highest revision number. It is the changeset +most recently added in a repository.
    +
    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 'Branch, head'. Note that because revision +numbers may be different in different repository clones, the +branch tip may be different in different cloned repositories.
    +
    Update
    +

    (Noun) Another synonym of changeset.

    +

    Example: "I've pushed an update".

    +

    (Verb) This term is usually used to describe updating the state of +the working directory to that of a specific changeset. See +hg help update.

    +

    Example: "You should update".

    +
    +
    Working directory
    +
    See 'Directory, working'.
    +
    Working directory parent
    +
    See 'Parent, working directory'.
    +
    +

    Files

    -
    .hgignore
    +
    .hgignore
    This file contains regular expressions (one per line) that describe file names that should be ignored by hg. For details, see hgignore(5).
    -
    .hgtags
    +
    .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.
    -
    /etc/mercurial/hgrc, $HOME/.hgrc, .hg/hgrc
    +
    /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. +.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.
    -

    Some commands (e.g. revert) produce backup files ending in .orig, -if the .orig file already exists and is not tracked by Mercurial, +

    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.

    diff -Nru mercurial-1.5.4/doc/hgignore.5 mercurial-1.6/doc/hgignore.5 --- mercurial-1.5.4/doc/hgignore.5 2010-06-01 16:54:09.000000000 +0100 +++ mercurial-1.6/doc/hgignore.5 2010-07-01 18:06:35.000000000 +0100 @@ -30,41 +30,41 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.SH SYNOPSIS +.SH Synopsis .sp -The Mercurial system uses a file called \fB.hgignore\fP in the root +The Mercurial system uses a file called \fC.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 +.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 +These files can be ignored by listing them in a \fC.hgignore\fP file in +the root of the working directory. The \fC.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. +any pattern in \fC.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. +For example, say we have an untracked file, \fCfile.c\fP, at +\fCa/b/file.c\fP inside our repository. Mercurial will ignore \fCfile.c\fP +if any pattern in \fC.hgignore\fP matches \fCa/b/file.c\fP, \fCa/b\fP or \fCa\fP. .sp In addition, a Mercurial configuration file can reference a set of -per\-user or global ignore files. See the \%\fBhgrc\fP(5)\: man page for details +per\-user or global ignore files. See the \fI\%\fBhgrc\fP(5)\fP man page for details of how to configure these files. Look for the "ignore" entry in the "ui" section. .sp To control Mercurial\(aqs handling of files that it manages, see the -\%\fBhg\fP(1)\: man page. Look for the \fB\-I\fP and \fB\-X\fP options. -.SH SYNTAX +\fI\%\fBhg\fP(1)\fP man page. Look for the \fC\-I\fP and \fC\-X\fP options. +.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 +with one pattern per line. Empty lines are skipped. The \fC#\fP +character is treated as a comment character, and the \fC\e\fP character is treated as an escape character. .sp Mercurial supports several pattern syntaxes. The default syntax used @@ -78,14 +78,14 @@ .ft P .fi .sp -where \fBNAME\fP is one of the following: +where \fCNAME\fP is one of the following: .INDENT 0.0 .TP -.B \fBregexp\fP +.B \fCregexp\fP .sp Regular expression, Python/Perl syntax. .TP -.B \fBglob\fP +.B \fCglob\fP .sp Shell\-style glob. .UNINDENT @@ -94,10 +94,10 @@ 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. -.SH EXAMPLE +the form \fC*.c\fP will match a file ending in \fC.c\fP in any directory, +and a regexp pattern of the form \fC\e.c$\fP will do the same. To root a +regexp pattern, start it with \fC^\fP. +.SH Example .sp Here is an example ignore file. .sp @@ -115,15 +115,15 @@ ^\e.pc/ .ft P .fi -.SH AUTHOR +.SH Author .sp -Vadim Gelfer <\%vadim.gelfer@gmail.com\:> +Vadim Gelfer <\fI\%vadim.gelfer@gmail.com\fP> .sp -Mercurial was written by Matt Mackall <\%mpm@selenic.com\:>. -.SH SEE ALSO +Mercurial was written by Matt Mackall <\fI\%mpm@selenic.com\fP>. +.SH See Also .sp -\%\fBhg\fP(1)\:, \%\fBhgrc\fP(5)\: -.SH COPYING +\fI\%\fBhg\fP(1)\fP, \fI\%\fBhgrc\fP(5)\fP +.SH Copying .sp This manual page is copyright 2006 Vadim Gelfer. Mercurial is copyright 2005\-2010 Matt Mackall. diff -Nru mercurial-1.5.4/doc/hgignore.5.html mercurial-1.6/doc/hgignore.5.html --- mercurial-1.5.4/doc/hgignore.5.html 2010-06-01 16:54:17.000000000 +0100 +++ mercurial-1.6/doc/hgignore.5.html 2010-07-01 18:06:39.000000000 +0100 @@ -3,7 +3,7 @@ - + hgignore @@ -29,7 +29,7 @@

    Synopsis

    -

    The Mercurial system uses a file called .hgignore in the root +

    The Mercurial system uses a file called .hgignore in the root directory of a repository to control its behavior when it searches for files that it is not currently tracking.

    @@ -38,16 +38,16 @@

    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 .hgignore file in -the root of the working directory. The .hgignore file must be +These files can be ignored by listing them in a .hgignore file in +the root of the working directory. The .hgignore 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.

    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 .hgignore.

    -

    For example, say we have an untracked file, file.c, at -a/b/file.c inside our repository. Mercurial will ignore file.c -if any pattern in .hgignore matches a/b/file.c, a/b or a.

    +any pattern in .hgignore.

    +

    For example, say we have an untracked file, file.c, at +a/b/file.c inside our repository. Mercurial will ignore file.c +if any pattern in .hgignore matches a/b/file.c, a/b or a.

    In addition, a Mercurial configuration file can reference a set of per-user or global ignore files. See the hgrc(5) man page for details of how to configure these files. Look for the "ignore" entry in the @@ -58,8 +58,8 @@

    Syntax

    An ignore file is a plain text file consisting of a list of patterns, -with one pattern per line. Empty lines are skipped. The # -character is treated as a comment character, and the \ character +with one pattern per line. Empty lines are skipped. The # +character is treated as a comment character, and the \ character is treated as an escape character.

    Mercurial supports several pattern syntaxes. The default syntax used is Python/Perl-style regular expressions.

    @@ -67,19 +67,19 @@
     syntax: NAME
     
    -

    where NAME is one of the following:

    +

    where NAME is one of the following:

    -
    regexp
    +
    regexp
    Regular expression, Python/Perl syntax.
    -
    glob
    +
    glob
    Shell-style glob.

    The chosen syntax stays in effect when parsing all patterns that follow, until another syntax is selected.

    Neither glob nor regexp patterns are rooted. A glob-syntax pattern of -the form *.c will match a file ending in .c in any directory, -and a regexp pattern of the form \.c$ will do the same. To root a -regexp pattern, start it with ^.

    +the form *.c will match a file ending in .c in any directory, +and a regexp pattern of the form \.c$ will do the same. To root a +regexp pattern, start it with ^.

    Example

    diff -Nru mercurial-1.5.4/doc/hgrc.5 mercurial-1.6/doc/hgrc.5 --- mercurial-1.5.4/doc/hgrc.5 2010-06-01 16:54:11.000000000 +0100 +++ mercurial-1.6/doc/hgrc.5 2010-07-01 18:06:35.000000000 +0100 @@ -30,21 +30,20 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.SH SYNOPSIS +.SH Synopsis .sp The Mercurial system uses a set of configuration files to control aspects of its behavior. -.SH FILES +.SH Files .sp Mercurial reads configuration data from several files, if they exist. 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 +installed. \fC*.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 -(Unix, Windows) \fB/.hg/hgrc\fP +(Unix, Windows) \fC/.hg/hgrc\fP .fi .sp .INDENT 0.0 @@ -56,32 +55,30 @@ this file override options in all other configuration files. On 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 -\%trusted\: section below for more details. +\fI\%trusted\fP section below for more details. .UNINDENT .UNINDENT -.sp .nf -(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 +(Unix) \fC$HOME/.hgrc\fP +(Windows) \fC%USERPROFILE%\e.hgrc\fP +(Windows) \fC%USERPROFILE%\eMercurial.ini\fP +(Windows) \fC%HOME%\e.hgrc\fP +(Windows) \fC%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 +Windows 9x, \fC%HOME%\fP is replaced by \fC%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 -(Unix) \fB/etc/mercurial/hgrc\fP -(Unix) \fB/etc/mercurial/hgrc.d/*.rc\fP +(Unix) \fC/etc/mercurial/hgrc\fP +(Unix) \fC/etc/mercurial/hgrc.d/*.rc\fP .fi .sp .INDENT 0.0 @@ -93,28 +90,26 @@ override per\-installation options. .UNINDENT .UNINDENT -.sp .nf -(Unix) \fB/etc/mercurial/hgrc\fP -(Unix) \fB/etc/mercurial/hgrc.d/*.rc\fP +(Unix) \fC/etc/mercurial/hgrc\fP +(Unix) \fC/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\fP is the +directory where Mercurial is installed. \fC\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 +example, if installed in \fC/shared/tools/bin/hg\fP, Mercurial will look +in \fC/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\eMercurial.ini\fP -(Windows) \fB\ehgrc.d\e*.rc\fP -(Windows) \fBHKEY_LOCAL_MACHINE\eSOFTWARE\eMercurial\fP +(Windows) \fC\eMercurial.ini\fP +(Windows) \fC\ehgrc.d\e*.rc\fP +(Windows) \fCHKEY_LOCAL_MACHINE\eSOFTWARE\eMercurial\fP .fi .sp .INDENT 0.0 @@ -124,18 +119,18 @@ 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 +a \fCMercurial.ini\fP file or be a directory where \fC*.rc\fP files will be read. Mercurial checks each of these locations in the specified order until one or more configuration files are detected. If the pywin32 extensions are not installed, Mercurial will only look for -site\-wide configuration in \fBC:\eMercurial\eMercurial.ini\fP. +site\-wide configuration in \fCC:\eMercurial\eMercurial.ini\fP. .UNINDENT .UNINDENT -.SH SYNTAX +.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): +A configuration file consists of sections, led by a \fC[section]\fP header +and followed by \fCname = value\fP entries (sometimes called +\fCconfiguration keys\fP): .sp .nf .ft C @@ -149,7 +144,7 @@ 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. +\fC#\fP or \fC;\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: @@ -163,7 +158,7 @@ .ft P .fi .sp -This would set the configuration key named \fBeggs\fP to \fBsmall\fP. +This would set the configuration key named \fCeggs\fP to \fCsmall\fP. .sp It is also possible to define a section multiple times. A section can be redefined on the same and/or on different hgrc files. For example: @@ -187,35 +182,58 @@ .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, +This would set the \fCeggs\fP, \fCham\fP, and \fCbread\fP configuration keys +of the \fCfoo\fP section to \fCmedium\fP, \fCprosciutto\fP, and \fCtoasted\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 +paths overriding later ones as described on the \fCFiles\fP section above. .sp -A line of the form \fB%include file\fP will include \fBfile\fP into the +A line of the form \fC%include file\fP will include \fCfile\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. +the configuration file in which the \fC%include\fP directive is found. +Environment variables and \fC~user\fP constructs are expanded in +\fCfile\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 +A line with \fC%unset name\fP will remove \fCname\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. Lists are split on whitespace and commas. 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). -.SH SECTIONS +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., \fCfoo"bar baz\fP is the list of \fCfoo"bar\fP and \fCbaz\fP). +.SH Sections .sp This section describes the different sections that may appear in a Mercurial "hgrc" file, the purpose of each section, its possible keys, and their possible values. -.SS \fBalias\fP +.SS \fCalias\fP .sp Defines command aliases. Aliases allow you to define your own commands in terms of other @@ -237,7 +255,7 @@ .ft P .fi .sp -creates a new command \fBlatest\fP that shows only the five most recent +creates a new command \fClatest\fP that shows only the five most recent changesets. You can define subsequent aliases using earlier ones: .sp .nf @@ -251,7 +269,7 @@ existing commands, which will then override the original definitions. This is almost always a bad idea! .RE -.SS \fBauth\fP +.SS \fCauth\fP .sp Authentication credentials for HTTP authentication. Each line has the following format: @@ -262,7 +280,7 @@ .ft P .fi .sp -where \fB\fP is used to group arguments into authentication +where \fC\fP is used to group arguments into authentication entries. Example: .sp .nf @@ -282,36 +300,36 @@ Supported arguments: .INDENT 0.0 .TP -.B \fBprefix\fP +.B \fCprefix\fP .sp -Either \fB*\fP or a URI prefix with or without the scheme part. +Either \fC*\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 +(where \fC*\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 +.B \fCusername\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. .TP -.B \fBpassword\fP +.B \fCpassword\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 +.B \fCkey\fP .sp Optional. PEM encoded client certificate key file. .TP -.B \fBcert\fP +.B \fCcert\fP .sp Optional. PEM encoded client certificate chain file. .TP -.B \fBschemes\fP +.B \fCschemes\fP .sp Optional. Space separated list of URI schemes to use this authentication entry with. Only used if the prefix doesn\(aqt include @@ -322,7 +340,7 @@ .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 +.SS \fCdecode/encode\fP .sp Filters for transforming files on checkout/checkin. This would typically be used for newline processing or other @@ -330,15 +348,15 @@ .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 example, to match any file ending in \fC.txt\fP in the root +directory only, use the pattern \fC*.txt\fP. To match any file ending +in \fC.c\fP anywhere in the repository, use the pattern \fC**.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. +The filter command can start with a specifier, either \fCpipe:\fP or +\fCtempfile:\fP. If no specifier is given, \fCpipe:\fP is used by default. .sp -A \fBpipe:\fP command must accept data on stdin and return the transformed +A \fCpipe:\fP command must accept data on stdin and return the transformed data on stdout. .sp Pipe example: @@ -357,9 +375,9 @@ .ft P .fi .sp -A \fBtempfile:\fP command is a template. The string \fBINFILE\fP is replaced +A \fCtempfile:\fP command is a template. The string \fCINFILE\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 +filtered by the command. The string \fCOUTFILE\fP is replaced with the name of an empty temporary file, where the filtered data must be written by the command. .IP Note @@ -369,41 +387,18 @@ strange effects and may corrupt the contents of your files. .RE .sp -The most common usage is for LF <\-> CRLF translation on Windows. For -this, use the "smart" converters which check for binary files: -.sp -.nf -.ft C -[extensions] -hgext.win32text = -[encode] -** = cleverencode: -[decode] -** = cleverdecode: -.ft P -.fi -.sp -or if you only want to translate certain files: -.sp -.nf -.ft C -[extensions] -hgext.win32text = -[encode] -**.txt = dumbencode: -[decode] -**.txt = dumbdecode: -.ft P -.fi -.SS \fBdefaults\fP +This filter mechanism is used internally by the \fCeol\fP extension to +translate line ending characters between Windows (CRLF) and Unix (LF) +format. We suggest you use the \fCeol\fP extension for convenience. +.SS \fCdefaults\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 +Use the \fC[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: +The following example makes \fI\%\fChg log\fP\fP run in verbose mode, and \fI\%\fChg hg +status\fP\fP show only the modified files, by default: .sp .nf .ft C @@ -416,76 +411,76 @@ 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 +.SS \fCdiff\fP .sp Settings used when displaying diffs. They are all Boolean and defaults to False. .INDENT 0.0 .TP -.B \fBgit\fP +.B \fCgit\fP .sp Use git extended diff format. .TP -.B \fBnodates\fP +.B \fCnodates\fP .sp Don\(aqt include dates in diff headers. .TP -.B \fBshowfunc\fP +.B \fCshowfunc\fP .sp Show which function each change is in. .TP -.B \fBignorews\fP +.B \fCignorews\fP .sp Ignore white space when comparing lines. .TP -.B \fBignorewsamount\fP +.B \fCignorewsamount\fP .sp Ignore changes in the amount of white space. .TP -.B \fBignoreblanklines\fP +.B \fCignoreblanklines\fP .sp Ignore changes whose lines are all blank. .UNINDENT -.SS \fBemail\fP +.SS \fCemail\fP .sp Settings for extensions that send email messages. .INDENT 0.0 .TP -.B \fBfrom\fP +.B \fCfrom\fP .sp Optional. Email address to use in "From" header and SMTP envelope of outgoing messages. .TP -.B \fBto\fP +.B \fCto\fP .sp Optional. Comma\-separated list of recipients\(aq email addresses. .TP -.B \fBcc\fP +.B \fCcc\fP .sp Optional. Comma\-separated list of carbon copy recipients\(aq email addresses. .TP -.B \fBbcc\fP +.B \fCbcc\fP .sp Optional. Comma\-separated list of blind carbon copy recipients\(aq email addresses. .TP -.B \fBmethod\fP +.B \fCmethod\fP .sp -Optional. Method to use to send email messages. If value is \fBsmtp\fP -(default), use SMTP (see the \%SMTP\: section for configuration). +Optional. Method to use to send email messages. If value is \fCsmtp\fP +(default), use SMTP (see the \fI\%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. +(takes \fC\-f\fP option for sender, list of recipients on command line, +message on stdin). Normally, setting this to \fCsendmail\fP or +\fC/usr/sbin/sendmail\fP is enough to use sendmail to send messages. .TP -.B \fBcharsets\fP +.B \fCcharsets\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 +(\fC$HGENCODING\fP, \fCui.fallbackencoding\fP) succeeds. If correct conversion fails, the text in question is sent as is. Defaults to empty (explicit) list. .sp @@ -493,19 +488,19 @@ .INDENT 7.0 .IP 1. 3 . -\fBus\-ascii\fP: always first, regardless of settings +\fCus\-ascii\fP: always first, regardless of settings .IP 2. 3 . -\fBemail.charsets\fP: in order given by user +\fCemail.charsets\fP: in order given by user .IP 3. 3 . -\fBui.fallbackencoding\fP: if not in email.charsets +\fCui.fallbackencoding\fP: if not in email.charsets .IP 4. 3 . -\fB$HGENCODING\fP: if not in email.charsets +\fC$HGENCODING\fP: if not in email.charsets .IP 5. 3 . -\fButf\-8\fP: always last, regardless of settings +\fCutf\-8\fP: always last, regardless of settings .UNINDENT .UNINDENT .sp @@ -521,25 +516,25 @@ charsets = iso\-8859\-1, iso\-8859\-15, windows\-1252 .ft P .fi -.SS \fBextensions\fP +.SS \fCextensions\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. +you can give the name of the module, followed by \fC=\fP, with nothing +after the \fC=\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 +Otherwise, give a name that you choose, followed by \fC=\fP, followed by +the path to the \fC.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 -\fBhgext.foo = !/ext/path\fP or \fBhgext.foo = !\fP when path is not +broader scope, prepend its path with \fC!\fP, as in +\fChgext.foo = !/ext/path\fP or \fChgext.foo = !\fP when path is not supplied. .sp -Example for \fB~/.hgrc\fP: +Example for \fC~/.hgrc\fP: .sp .nf .ft C @@ -550,10 +545,10 @@ myfeature = ~/.hgext/myfeature.py .ft P .fi -.SS \fBformat\fP +.SS \fCformat\fP .INDENT 0.0 .TP -.B \fBusestore\fP +.B \fCusestore\fP .sp Enable or disable the "store" repository format which improves compatibility with systems that fold case or otherwise mangle @@ -562,7 +557,7 @@ 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 +.B \fCusefncache\fP .sp Enable or disable the "fncache" repository format which enhances the "store" repository format (which has to be enabled to use @@ -571,7 +566,7 @@ option ensures that the on\-disk format of newly created repositories will be compatible with Mercurial before version 1.1. .UNINDENT -.SS \fBmerge\-patterns\fP +.SS \fCmerge\-patterns\fP .sp This section specifies merge tools to associate with particular file patterns. Tools matched here will take precedence over the default @@ -587,12 +582,12 @@ **.jpg = myimgmerge .ft P .fi -.SS \fBmerge\-tools\fP +.SS \fCmerge\-tools\fP .sp This section configures external merge tools to use for file\-level merges. .sp -Example \fB~/.hgrc\fP: +Example \fC~/.hgrc\fP: .sp .nf .ft C @@ -614,80 +609,97 @@ Supported arguments: .INDENT 0.0 .TP -.B \fBpriority\fP +.B \fCpriority\fP .sp The priority in which to evaluate this tool. Default: 0. .TP -.B \fBexecutable\fP +.B \fCexecutable\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 +.B \fCargs\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 +variables: \fC$base\fP, \fC$local\fP, \fC$other\fP, \fC$output\fP. +Default: \fC$local $base $other\fP .TP -.B \fBpremerge\fP +.B \fCpremerge\fP .sp Attempt to run internal non\-interactive 3\-way merge tool before -launching external tool. +launching external tool. Options are \fCtrue\fP, \fCfalse\fP, or \fCkeep\fP +to leave markers in the file if the premerge fails. Default: True .TP -.B \fBbinary\fP +.B \fCbinary\fP .sp This tool can merge binary files. Defaults to False, unless tool was selected by file pattern match. .TP -.B \fBsymlink\fP +.B \fCsymlink\fP .sp This tool can merge symlinks. Defaults to False, even if tool was selected by file pattern match. .TP -.B \fBcheckconflicts\fP +.B \fCcheck\fP +.sp +A list of merge success\-checking options: +.INDENT 7.0 +.TP +.B \fCchanged\fP +.sp +Ask whether merge was successful when the merged file shows no changes. +.TP +.B \fCconflicts\fP +.sp +Check whether there are conflicts even though the tool reported success. +.TP +.B \fCprompt\fP .sp -Check whether there are conflicts even though the tool reported -success. +Always prompt for merge success, regardless of success reported by tool. +.UNINDENT +.TP +.B \fCcheckchanged\fP +.sp +True is equivalent to \fCcheck = changed\fP. Default: False .TP -.B \fBcheckchanged\fP +.B \fCcheckconflicts\fP .sp -Check whether outputs were written even though the tool reported -success. +True is equivalent to \fCcheck = conflicts\fP. Default: False .TP -.B \fBfixeol\fP +.B \fCfixeol\fP .sp Attempt to fix up EOL changes caused by the merge tool. Default: False .TP -.B \fBgui\fP +.B \fCgui\fP .sp This tool requires a graphical interface to run. Default: False .TP -.B \fBregkey\fP +.B \fCregkey\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. +\fCHKEY_CURRENT_USER\fP and then under \fCHKEY_LOCAL_MACHINE\fP. Default: None .TP -.B \fBregname\fP +.B \fCregname\fP .sp Name of value to read from specified registry key. Defaults to the unnamed (default) value. .TP -.B \fBregappend\fP +.B \fCregappend\fP .sp String to append to the value read from the registry, typically the executable name of the tool. Default: None .UNINDENT -.SS \fBhooks\fP +.SS \fChooks\fP .sp Commands or Python functions that get automatically executed by various actions such as starting or finishing a commit. Multiple @@ -695,7 +707,7 @@ action. Overriding a site\-wide hook can be done by changing its value or setting it to an empty string. .sp -Example \fB.hg/hgrc\fP: +Example \fC.hg/hgrc\fP: .sp .nf .ft C @@ -711,116 +723,124 @@ .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. +variables it is passed are listed with names of the form \fC$HG_foo\fP. .INDENT 0.0 .TP -.B \fBchangegroup\fP +.B \fCchangegroup\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. +ID of the first new changeset is in \fC$HG_NODE\fP. URL from which +changes came is in \fC$HG_URL\fP. .TP -.B \fBcommit\fP +.B \fCcommit\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. +of the newly created changeset is in \fC$HG_NODE\fP. Parent changeset +IDs are in \fC$HG_PARENT1\fP and \fC$HG_PARENT2\fP. .TP -.B \fBincoming\fP +.B \fCincoming\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. +\fC$HG_NODE\fP. URL that was source of changes came is in \fC$HG_URL\fP. .TP -.B \fBoutgoing\fP +.B \fCoutgoing\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. +first changeset sent is in \fC$HG_NODE\fP. Source of operation is in +\fC$HG_SOURCE\fP; see "preoutgoing" hook for description. .TP -.B \fBpost\-\fP +.B \fCpost\-\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. Hook failure is ignored. +contents of the command line are passed as \fC$HG_ARGS\fP and the result +code in \fC$HG_RESULT\fP. Parsed command line arguments are passed as +\fC$HG_PATS\fP and \fC$HG_OPTS\fP. These contain string representations of +the python data internally passed to . \fC$HG_OPTS\fP is a +dictionary of options (with unspecified options set to their defaults). +\fC$HG_PATS\fP is a list of arguments. Hook failure is ignored. .TP -.B \fBpre\-\fP +.B \fCpre\-\fP .sp Run before executing the associated command. The contents of the -command line are passed as \fB$HG_ARGS\fP. If the hook returns failure, -the command doesn\(aqt execute and Mercurial returns the failure +command line are passed as \fC$HG_ARGS\fP. Parsed command line arguments +are passed as \fC$HG_PATS\fP and \fC$HG_OPTS\fP. These contain string +representations of the data internally passed to . \fC$HG_OPTS\fP +is a dictionary of options (with unspecified options set to their +defaults). \fC$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 +.B \fCprechangegroup\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. +will come is in \fC$HG_URL\fP. .TP -.B \fBprecommit\fP +.B \fCprecommit\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. +Parent changeset IDs are in \fC$HG_PARENT1\fP and \fC$HG_PARENT2\fP. .TP -.B \fBpreoutgoing\fP +.B \fCpreoutgoing\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 +\fC$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 \fBpretag\fP +.B \fCpretag\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. +changeset to tag is in \fC$HG_NODE\fP. Name of tag is in \fC$HG_TAG\fP. Tag is +local if \fC$HG_LOCAL=1\fP, in repository if \fC$HG_LOCAL=0\fP. .TP -.B \fBpretxnchangegroup\fP +.B \fCpretxnchangegroup\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 +\fC$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. +\fC$HG_URL\fP. .TP -.B \fBpretxncommit\fP +.B \fCpretxncommit\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. +be rolled back. ID of changeset is in \fC$HG_NODE\fP. Parent changeset +IDs are in \fC$HG_PARENT1\fP and \fC$HG_PARENT2\fP. .TP -.B \fBpreupdate\fP +.B \fCpreupdate\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. +Changeset ID of first new parent is in \fC$HG_PARENT1\fP. If merge, ID +of second new parent is in \fC$HG_PARENT2\fP. .TP -.B \fBtag\fP +.B \fCtag\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. +Run after a tag is created. ID of tagged changeset is in \fC$HG_NODE\fP. +Name of tag is in \fC$HG_TAG\fP. Tag is local if \fC$HG_LOCAL=1\fP, in +repository if \fC$HG_LOCAL=0\fP. .TP -.B \fBupdate\fP +.B \fCupdate\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. +new parent is in \fC$HG_PARENT1\fP. If merge, ID of second new parent is +in \fC$HG_PARENT2\fP. If the update succeeded, \fC$HG_ERROR=0\fP. If the +update failed (e.g. because conflicts not resolved), \fC$HG_ERROR=1\fP. .UNINDENT .IP Note . @@ -833,7 +853,7 @@ .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 +hooks on platforms such as Windows. As an example, \fC$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 @@ -849,96 +869,96 @@ .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 +\fCui\fP), a repository object (keyword \fCrepo\fP), and a \fChooktype\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. +\fCHG_\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 \fBhttp_proxy\fP +.SS \fChttp_proxy\fP .sp Used to access web\-based Mercurial repositories through a HTTP proxy. .INDENT 0.0 .TP -.B \fBhost\fP +.B \fChost\fP .sp Host name and (optional) port of the proxy server, for example "myproxy:8000". .TP -.B \fBno\fP +.B \fCno\fP .sp Optional. Comma\-separated list of host names that should bypass the proxy. .TP -.B \fBpasswd\fP +.B \fCpasswd\fP .sp Optional. Password to authenticate with at the proxy server. .TP -.B \fBuser\fP +.B \fCuser\fP .sp Optional. User name to authenticate with at the proxy server. .TP -.B \fBalways\fP +.B \fCalways\fP .sp Optional. Always use the proxy, even for localhost and any entries -in \fBhttp_proxy.no\fP. True or False. Default: False. +in \fChttp_proxy.no\fP. True or False. Default: False. .UNINDENT -.SS \fBsmtp\fP +.SS \fCsmtp\fP .sp Configuration for extensions that need to send email messages. .INDENT 0.0 .TP -.B \fBhost\fP +.B \fChost\fP .sp Host name of mail server, e.g. "mail.example.com". .TP -.B \fBport\fP +.B \fCport\fP .sp Optional. Port to connect to on mail server. Default: 25. .TP -.B \fBtls\fP +.B \fCtls\fP .sp Optional. Whether to connect to mail server using TLS. True or False. Default: False. .TP -.B \fBusername\fP +.B \fCusername\fP .sp Optional. User name to authenticate to SMTP server with. If username is specified, password must also be specified. Default: none. .TP -.B \fBpassword\fP +.B \fCpassword\fP .sp Optional. Password to authenticate to SMTP server with. If username is specified, password must also be specified. Default: none. .TP -.B \fBlocal_hostname\fP +.B \fClocal_hostname\fP .sp Optional. It\(aqs the hostname that the sender can use to identify itself to the MTA. .UNINDENT -.SS \fBpatch\fP +.SS \fCpatch\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 +.B \fCeol\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 +are preserved. When set to \fClf\fP or \fCcrlf\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 +\fCauto\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 +.SS \fCpaths\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 @@ -946,18 +966,18 @@ the following entries. .INDENT 0.0 .TP -.B \fBdefault\fP +.B \fCdefault\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 +.B \fCdefault\-push\fP .sp Optional. Directory or URL to use when pushing if no destination is specified. .UNINDENT -.SS \fBprofiling\fP +.SS \fCprofiling\fP .sp Specifies profiling format and file output. In this section description, \(aqprofiling data\(aq stands for the raw data collected @@ -966,37 +986,37 @@ using lsprof. .INDENT 0.0 .TP -.B \fBformat\fP +.B \fCformat\fP .sp Profiling format. Default: text. .INDENT 7.0 .TP -.B \fBtext\fP +.B \fCtext\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 +.B \fCkcachegrind\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 \fBoutput\fP +.B \fCoutput\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 \fBserver\fP +.SS \fCserver\fP .sp Controls generic server settings. .INDENT 0.0 .TP -.B \fBuncompressed\fP +.B \fCuncompressed\fP .sp Whether to allow clients to clone a repository using the uncompressed streaming protocol. This transfers about 40% more @@ -1009,244 +1029,247 @@ the write lock while determining what data to transfer. Default is True. .TP -.B \fBvalidate\fP +.B \fCvalidate\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 \fBtrusted\fP +.SS \fCtrusted\fP .sp -For security reasons, 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. The main exception is the web interface, -which automatically uses some safe settings, since it\(aqs common to -serve repositories from different users. +Mercurial will not use the settings in the +\fC.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 \fC[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. +group with name \fC*\fP. These settings must be placed in an +\fIalready\-trusted file\fP to take effect, such as \fC$HOME/.hgrc\fP of the +user or service running Mercurial. .INDENT 0.0 .TP -.B \fBusers\fP +.B \fCusers\fP .sp Comma\-separated list of trusted users. .TP -.B \fBgroups\fP +.B \fCgroups\fP .sp Comma\-separated list of trusted groups. .UNINDENT -.SS \fBui\fP +.SS \fCui\fP .sp User interface controls. .INDENT 0.0 .TP -.B \fBarchivemeta\fP +.B \fCarchivemeta\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 hg archive command or downloaded via hgweb. +by the \fI\%\fChg archive\fP\fP command or downloaded via hgweb. Default is True. .TP -.B \fBaskusername\fP +.B \fCaskusername\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 +neither \fC$HGUSER\fP nor \fC$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 \fCUSER@HOST\fP is used instead. Default is False. .TP -.B \fBdebug\fP +.B \fCdebug\fP .sp Print debugging information. True or False. Default is False. .TP -.B \fBeditor\fP +.B \fCeditor\fP .sp -The editor to use during a commit. Default is \fB$EDITOR\fP or \fBvi\fP. +The editor to use during a commit. Default is \fC$EDITOR\fP or \fCvi\fP. .TP -.B \fBfallbackencoding\fP +.B \fCfallbackencoding\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 +.B \fCignore\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\fP(5)\: man page. +\fCignore.other = ~/.hgignore2\fP. For details of the ignore file +format, see the \fI\%\fBhgignore\fP(5)\fP man page. .TP -.B \fBinteractive\fP +.B \fCinteractive\fP .sp Allow to prompt the user. True or False. Default is True. .TP -.B \fBlogtemplate\fP +.B \fClogtemplate\fP .sp Template string for commands that print changesets. .TP -.B \fBmerge\fP +.B \fCmerge\fP .sp The conflict resolution program to use during a manual merge. There are some internal tools available: .INDENT 7.0 .TP -.B \fBinternal:local\fP +.B \fCinternal:local\fP .sp keep the local version .TP -.B \fBinternal:other\fP +.B \fCinternal:other\fP .sp use the other version .TP -.B \fBinternal:merge\fP +.B \fCinternal:merge\fP .sp use the internal non\-interactive merge tool .TP -.B \fBinternal:fail\fP +.B \fCinternal:fail\fP .sp fail to merge .UNINDENT .UNINDENT .sp For more information on configuring merge tools see the -\%merge\-tools\: section. +\fI\%merge\-tools\fP section. .INDENT 0.0 .TP -.B \fBpatch\fP +.B \fCpatch\fP .sp -command to use to apply patches. Look for \fBgpatch\fP or \fBpatch\fP in +command to use to apply patches. Look for \fCgpatch\fP or \fCpatch\fP in PATH if unset. .TP -.B \fBquiet\fP +.B \fCquiet\fP .sp Reduce the amount of output printed. True or False. Default is False. .TP -.B \fBremotecmd\fP +.B \fCremotecmd\fP .sp -remote command to use for clone/push/pull operations. Default is \fBhg\fP. +remote command to use for clone/push/pull operations. Default is \fChg\fP. .TP -.B \fBreport_untrusted\fP +.B \fCreport_untrusted\fP .sp -Warn if a \fB.hg/hgrc\fP file is ignored due to not being owned by a +Warn if a \fC.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 +.B \fCslash\fP .sp -Display paths using a slash (\fB/\fP) as the path separator. This +Display paths using a slash (\fC/\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)). +backslash character (\fC\e\fP)). Default is False. .TP -.B \fBssh\fP +.B \fCssh\fP .sp -command to use for SSH connections. Default is \fBssh\fP. +command to use for SSH connections. Default is \fCssh\fP. .TP -.B \fBstrict\fP +.B \fCstrict\fP .sp Require exact command names, instead of allowing unambiguous abbreviations. True or False. Default is False. .TP -.B \fBstyle\fP +.B \fCstyle\fP .sp Name of style to use for command output. .TP -.B \fBtimeout\fP +.B \fCtimeout\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 +.B \fCtraceback\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 +.B \fCusername\fP .sp The committer of a changeset created when running "commit". -Typically a person\(aqs name and email address, e.g. \fBFred Widget -\fP. Default is \fB$EMAIL\fP or \fBusername@hostname\fP. If +Typically a person\(aqs name and email address, e.g. \fCFred Widget +\fP. Default is \fC$EMAIL\fP or \fCusername@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). +in a different hgrc file (e.g. \fC$HOME/.hgrc\fP, if the admin set +\fCusername =\fP in the system hgrc). Environment variables in the +username are expanded. .TP -.B \fBverbose\fP +.B \fCverbose\fP .sp Increase the amount of output printed. True or False. Default is False. .UNINDENT -.SS \fBweb\fP +.SS \fCweb\fP .sp Web interface configuration. .INDENT 0.0 .TP -.B \fBaccesslog\fP +.B \fCaccesslog\fP .sp Where to output the access log. Default is stdout. .TP -.B \fBaddress\fP +.B \fCaddress\fP .sp Interface address to bind to. Default is all. .TP -.B \fBallow_archive\fP +.B \fCallow_archive\fP .sp List of archive format (bz2, gz, zip) allowed for downloading. Default is empty. .TP -.B \fBallowbz2\fP +.B \fCallowbz2\fP .sp (DEPRECATED) Whether to allow .tar.bz2 downloading of repository revisions. Default is False. .TP -.B \fBallowgz\fP +.B \fCallowgz\fP .sp (DEPRECATED) Whether to allow .tar.gz downloading of repository revisions. Default is False. .TP -.B \fBallowpull\fP +.B \fCallowpull\fP .sp Whether to allow pulling from the repository. Default is True. .TP -.B \fBallow_push\fP +.B \fCallow_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 is not allowed. If the special value \fC*\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 (separated by whitespace or \fB,\fP). The -contents of the allow_push list are examined after the deny_push -list. +be present in this list. The contents of the allow_push list are +examined after the deny_push list. .TP -.B \fBallow_read\fP +.B \fCallow_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 (separated by -whitespace or \fB,\fP), 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. +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 \fC*\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 +.B \fCallowzip\fP .sp (DEPRECATED) Whether to allow .zip downloading of repository revisions. Default is False. This feature creates temporary files. .TP -.B \fBbaseurl\fP +.B \fCbaseurl\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. +URLs. Example: \fChttp://hgserver/repos/\fP. .TP -.B \fBcacerts\fP +.B \fCcacerts\fP .sp Path to file containing a list of PEM encoded certificate authorities that may be used to verify an SSL server\(aqs identity. The form must be @@ -1266,35 +1289,33 @@ This feature is only supported when using Python 2.6. 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. +\fChttp://pypi.python.org\fP. .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. +On most Linux systems this will be \fC/etc/ssl/certs/ca\-certificates.crt\fP. Otherwise you will have to generate this file manually. .TP -.B \fBcontact\fP +.B \fCcontact\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. +Defaults to ui.username or \fC$EMAIL\fP or "unknown" if unset or empty. .TP -.B \fBdeny_push\fP +.B \fCdeny_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 +push is not denied. If the special value \fC*\fP, all remote users are denied push. Otherwise, unauthenticated users are all denied, and -any authenticated user name present in this list (separated by -whitespace or \fB,\fP) is also denied. The contents of the deny_push -list are examined before the allow_push list. +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 +.B \fCdeny_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 (separated by -whitespace or \fB,\fP) 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 +authenticated user name present in this list is also denied access to +the repository. If set to the special value \fC*\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 @@ -1303,90 +1324,90 @@ priority over (are examined before) the contents of the allow_read list. .TP -.B \fBdescend\fP +.B \fCdescend\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 +.B \fCdescription\fP .sp Textual description of the repository\(aqs purpose or contents. Default is "unknown". .TP -.B \fBencoding\fP +.B \fCencoding\fP .sp -Character encoding name. +Character encoding name. Default is the current locale charset. Example: "UTF\-8" .TP -.B \fBerrorlog\fP +.B \fCerrorlog\fP .sp Where to output the error log. Default is stderr. .TP -.B \fBhidden\fP +.B \fChidden\fP .sp Whether to hide the repository in the hgwebdir index. Default is False. .TP -.B \fBipv6\fP +.B \fCipv6\fP .sp Whether to use IPv6. Default is False. .TP -.B \fBname\fP +.B \fCname\fP .sp Repository name to use in the web interface. Default is current working directory. .TP -.B \fBmaxchanges\fP +.B \fCmaxchanges\fP .sp Maximum number of changes to list on the changelog. Default is 10. .TP -.B \fBmaxfiles\fP +.B \fCmaxfiles\fP .sp Maximum number of files to list per changeset. Default is 10. .TP -.B \fBport\fP +.B \fCport\fP .sp Port to listen on. Default is 8000. .TP -.B \fBprefix\fP +.B \fCprefix\fP .sp Prefix path to serve from. Default is \(aq\(aq (server root). .TP -.B \fBpush_ssl\fP +.B \fCpush_ssl\fP .sp Whether to require that inbound pushes be transported over SSL to prevent password sniffing. Default is True. .TP -.B \fBstaticurl\fP +.B \fCstaticurl\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. +Example: \fChttp://hgserver/static/\fP. .TP -.B \fBstripes\fP +.B \fCstripes\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 +.B \fCstyle\fP .sp Which template map style to use. .TP -.B \fBtemplates\fP +.B \fCtemplates\fP .sp Where to find the HTML templates. Default is install path. .UNINDENT -.SH AUTHOR +.SH Author .sp -Bryan O\(aqSullivan <\%bos@serpentine.com\:>. +Bryan O\(aqSullivan <\fI\%bos@serpentine.com\fP>. .sp -Mercurial was written by Matt Mackall <\%mpm@selenic.com\:>. -.SH SEE ALSO +Mercurial was written by Matt Mackall <\fI\%mpm@selenic.com\fP>. +.SH See Also .sp -\%\fBhg\fP(1)\:, \%\fBhgignore\fP(5)\: -.SH COPYING +\fI\%\fBhg\fP(1)\fP, \fI\%\fBhgignore\fP(5)\fP +.SH Copying .sp This manual page is copyright 2005 Bryan O\(aqSullivan. Mercurial is copyright 2005\-2010 Matt Mackall. diff -Nru mercurial-1.5.4/doc/hgrc.5.html mercurial-1.6/doc/hgrc.5.html --- mercurial-1.5.4/doc/hgrc.5.html 2010-06-01 16:54:18.000000000 +0100 +++ mercurial-1.6/doc/hgrc.5.html 2010-07-01 18:06:40.000000000 +0100 @@ -3,7 +3,7 @@ - + hgrc @@ -34,26 +34,26 @@
  • Files
  • Syntax
  • Sections
  • Author
  • @@ -70,7 +70,7 @@

    Files

    Mercurial reads configuration data from several files, if they exist. The names of these files depend on the system on which Mercurial is -installed. *.rc files from a single directory are read in +installed. *.rc 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.

    @@ -94,12 +94,12 @@
    Per-user configuration file(s), for the user running Mercurial. On -Windows 9x, %HOME% is replaced by %APPDATA%. Options in these +Windows 9x, %HOME% is replaced by %APPDATA%. 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.
    -
    (Unix) /etc/mercurial/hgrc
    +
    (Unix) /etc/mercurial/hgrc
    (Unix) /etc/mercurial/hgrc.d/*.rc
    @@ -115,20 +115,20 @@ Per-installation configuration files, searched for in the directory where Mercurial is installed. <install-root> is the parent directory of the hg executable (or symlink) being run. For -example, if installed in /shared/tools/bin/hg, Mercurial will look -in /shared/tools/etc/mercurial/hgrc. Options in these files apply +example, if installed in /shared/tools/bin/hg, Mercurial will look +in /shared/tools/etc/mercurial/hgrc. Options in these files apply to all Mercurial commands executed by any user in any directory.
    (Windows) <install-dir>\Mercurial.ini
    (Windows) <install-dir>\hgrc.d\*.rc
    -
    (Windows) HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial
    +
    (Windows) HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial
    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 Mercurial.ini file or be a directory where *.rc files will +a Mercurial.ini file or be a directory where *.rc files will be read. Mercurial checks each of these locations in the specified order until one or more configuration files are detected. If the pywin32 extensions are not installed, Mercurial will only look for @@ -136,9 +136,9 @@

    Syntax

    -

    A configuration file consists of sections, led by a [section] header -and followed by name = value entries (sometimes called -configuration keys):

    +

    A configuration file consists of sections, led by a [section] header +and followed by name = value entries (sometimes called +configuration keys):

     [spam]
     eggs=ham
    @@ -148,7 +148,7 @@
     

    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 -# or ; are ignored and may be used to provide comments.

    +# or ; are ignored and may be used to provide comments.

    Configuration keys can be set multiple times, in which case mercurial will use the value that was configured last. As an example:

    @@ -157,7 +157,7 @@
     ham=serrano
     eggs=small
     
    -

    This would set the configuration key named eggs to small.

    +

    This would set the configuration key named eggs to small.

    It is also possible to define a section multiple times. A section can be redefined on the same and/or on different hgrc files. For example:

    @@ -176,25 +176,39 @@
     eggs=medium
     bread=toasted
     
    -

    This would set the eggs, ham, and bread configuration keys -of the foo section to medium, prosciutto, and toasted, +

    This would set the eggs, ham, and bread configuration keys +of the foo section to medium, prosciutto, and toasted, respectively. As you can see there only thing that matters is the last value that was set for each of the configuration keys.

    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 Files section +paths overriding later ones as described on the Files section above.

    -

    A line of the form %include file will include file into the +

    A line of the form %include file will include file 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 %include directive is found.

    -

    A line with %unset name will remove name from the current +the configuration file in which the %include directive is found. +Environment variables and ~user constructs are expanded in +file. This lets you do something like:

    +
    +%include ~/.hgrc.d/$HOST.rc
    +
    +

    to include a different configuration file on each computer you use.

    +

    A line with %unset name will remove name from the current section, if it has been set previously.

    The values are either free-form text strings, lists of text strings, -or Boolean values. Lists are split on whitespace and commas. 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).

    +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).

    +

    List values are separated by whitespace or comma, except when values are +placed in double quotation marks:

    +
    +allow_read = "John Doe, PhD", brian, betty
    +
    +

    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., foo"bar baz is the list of foo"bar and baz).

    Sections

    @@ -202,7 +216,7 @@ Mercurial "hgrc" file, the purpose of each section, its possible keys, and their possible values.

    -

    alias

    +

    alias

    Defines command aliases. Aliases allow you to define your own commands in terms of other commands (or aliases), optionally including arguments.

    @@ -214,7 +228,7 @@
     latest = log --limit 5
     
    -

    creates a new command latest that shows only the five most recent +

    creates a new command latest that shows only the five most recent changesets. You can define subsequent aliases using earlier ones:

     stable5 = latest -b stable
    @@ -227,13 +241,13 @@
     
    -

    auth

    +

    auth

    Authentication credentials for HTTP authentication. Each line has the following format:

     <name>.<argument> = <value>
     
    -

    where <name> is used to group arguments into authentication +

    where <name> is used to group arguments into authentication entries. Example:

     foo.prefix = hg.intevation.org/mercurial
    @@ -248,26 +262,26 @@
     

    Supported arguments:

    -
    prefix
    -
    Either * or a URI prefix with or without the scheme part. +
    prefix
    +
    Either * or a URI prefix with or without the scheme part. The authentication entry with the longest matching prefix is used -(where * matches everything and counts as a match of length +(where * 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.
    -
    username
    +
    username
    Optional. Username to authenticate with. If not given, and the remote site requires basic or digest authentication, the user will be prompted for it.
    -
    password
    +
    password
    Optional. Password to authenticate with. If not given, and the remote site requires basic or digest authentication, the user will be prompted for it.
    -
    key
    +
    key
    Optional. PEM encoded client certificate key file.
    -
    cert
    +
    cert
    Optional. PEM encoded client certificate chain file.
    -
    schemes
    +
    schemes
    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 @@ -278,19 +292,19 @@ for credentials as usual if required by the remote.

    -

    decode/encode

    +

    decode/encode

    Filters for transforming files on checkout/checkin. This would typically be used for newline processing or other localization/canonicalization of files.

    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 .txt in the root -directory only, use the pattern *.txt. To match any file ending -in .c anywhere in the repository, use the pattern **.c. +For example, to match any file ending in .txt in the root +directory only, use the pattern *.txt. To match any file ending +in .c anywhere in the repository, use the pattern **.c. For each file only the first matching filter applies.

    -

    The filter command can start with a specifier, either pipe: or -tempfile:. If no specifier is given, pipe: is used by default.

    -

    A pipe: command must accept data on stdin and return the transformed +

    The filter command can start with a specifier, either pipe: or +tempfile:. If no specifier is given, pipe: is used by default.

    +

    A pipe: command must accept data on stdin and return the transformed data on stdout.

    Pipe example:

    @@ -304,9 +318,9 @@
     # can safely omit "pipe:", because it's the default)
     *.gz = gzip
     
    -

    A tempfile: command is a template. The string INFILE is replaced +

    A tempfile: command is a template. The string INFILE is replaced with the name of a temporary file that contains the data to be -filtered by the command. The string OUTFILE is replaced with the name +filtered by the command. The string OUTFILE is replaced with the name of an empty temporary file, where the filtered data must be written by the command.

    @@ -315,33 +329,17 @@ where the standard shell I/O redirection operators often have strange effects and may corrupt the contents of your files.

    -

    The most common usage is for LF <-> CRLF translation on Windows. For -this, use the "smart" converters which check for binary files:

    -
    -[extensions]
    -hgext.win32text =
    -[encode]
    -** = cleverencode:
    -[decode]
    -** = cleverdecode:
    -
    -

    or if you only want to translate certain files:

    -
    -[extensions]
    -hgext.win32text =
    -[encode]
    -**.txt = dumbencode:
    -[decode]
    -**.txt = dumbdecode:
    -
    +

    This filter mechanism is used internally by the eol extension to +translate line ending characters between Windows (CRLF) and Unix (LF) +format. We suggest you use the eol extension for convenience.

    -

    defaults

    +

    defaults

    (defaults are deprecated. Don't use them. Use aliases instead)

    -

    Use the [defaults] section to define command defaults, i.e. the +

    Use the [defaults] section to define command defaults, i.e. the default options/arguments to pass to the specified commands.

    -

    The following example makes hg log run in verbose mode, and hg -status show only the modified files, by default:

    +

    The following example makes hg log run in verbose mode, and hg hg +status show only the modified files, by default:

     [defaults]
     log = -v
    @@ -352,60 +350,60 @@
     to the aliases of the commands defined.

    -

    diff

    +

    diff

    Settings used when displaying diffs. They are all Boolean and defaults to False.

    -
    git
    +
    git
    Use git extended diff format.
    -
    nodates
    +
    nodates
    Don't include dates in diff headers.
    -
    showfunc
    +
    showfunc
    Show which function each change is in.
    -
    ignorews
    +
    ignorews
    Ignore white space when comparing lines.
    -
    ignorewsamount
    +
    ignorewsamount
    Ignore changes in the amount of white space.
    -
    ignoreblanklines
    +
    ignoreblanklines
    Ignore changes whose lines are all blank.
    -

    email

    +

    email

    Settings for extensions that send email messages.

    -
    from
    +
    from
    Optional. Email address to use in "From" header and SMTP envelope of outgoing messages.
    -
    to
    +
    to
    Optional. Comma-separated list of recipients' email addresses.
    -
    cc
    +
    cc
    Optional. Comma-separated list of carbon copy recipients' email addresses.
    -
    bcc
    +
    bcc
    Optional. Comma-separated list of blind carbon copy recipients' email addresses.
    -
    method
    -
    Optional. Method to use to send email messages. If value is smtp +
    method
    +
    Optional. Method to use to send email messages. If value is smtp (default), use SMTP (see the SMTP section for configuration). Otherwise, use as name of program to run that acts like sendmail (takes -f option for sender, list of recipients on command line, -message on stdin). Normally, setting this to sendmail or -/usr/sbin/sendmail is enough to use sendmail to send messages.
    -
    charsets
    +message on stdin). Normally, setting this to sendmail or +/usr/sbin/sendmail is enough to use sendmail to send messages.
    +
    charsets

    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 -($HGENCODING, ui.fallbackencoding) succeeds. If correct +($HGENCODING, ui.fallbackencoding) succeeds. If correct conversion fails, the text in question is sent as is. Defaults to empty (explicit) list.

    Order of outgoing email character sets:

    1. us-ascii: always first, regardless of settings
    2. -
    3. email.charsets: in order given by user
    4. -
    5. ui.fallbackencoding: if not in email.charsets
    6. -
    7. $HGENCODING: if not in email.charsets
    8. +
    9. email.charsets: in order given by user
    10. +
    11. ui.fallbackencoding: if not in email.charsets
    12. +
    13. $HGENCODING: if not in email.charsets
    14. utf-8: always last, regardless of settings
    @@ -421,18 +419,18 @@
    -

    extensions

    +

    extensions

    Mercurial has an extension mechanism for adding new features. To enable an extension, create an entry for it in this section.

    If you know that the extension is already in Python's search path, -you can give the name of the module, followed by =, with nothing -after the =.

    -

    Otherwise, give a name that you choose, followed by =, followed by -the path to the .py file (including the file name extension) that +you can give the name of the module, followed by =, with nothing +after the =.

    +

    Otherwise, give a name that you choose, followed by =, followed by +the path to the .py file (including the file name extension) that defines the extension.

    To explicitly disable an extension that is enabled in an hgrc of -broader scope, prepend its path with !, as in -hgext.foo = !/ext/path or hgext.foo = ! when path is not +broader scope, prepend its path with !, as in +hgext.foo = !/ext/path or hgext.foo = ! when path is not supplied.

    Example for ~/.hgrc:

    @@ -444,16 +442,16 @@
     
    -

    format

    +

    format

    -
    usestore
    +
    usestore
    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.
    -
    usefncache
    +
    usefncache
    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 @@ -496,63 +494,73 @@

    Supported arguments:

    -
    priority
    +
    priority
    The priority in which to evaluate this tool. Default: 0.
    -
    executable
    +
    executable
    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.
    -
    args
    +
    args
    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: $base, $local, $other, $output. -Default: $local $base $other
    -
    premerge
    +variables: $base, $local, $other, $output. +Default: $local $base $other
    +
    premerge
    Attempt to run internal non-interactive 3-way merge tool before -launching external tool. +launching external tool. Options are true, false, or keep +to leave markers in the file if the premerge fails. Default: True
    -
    binary
    +
    binary
    This tool can merge binary files. Defaults to False, unless tool was selected by file pattern match.
    -
    symlink
    +
    symlink
    This tool can merge symlinks. Defaults to False, even if tool was selected by file pattern match.
    -
    checkconflicts
    -
    Check whether there are conflicts even though the tool reported -success. +
    check
    +

    A list of merge success-checking options:

    +
    +
    changed
    +
    Ask whether merge was successful when the merged file shows no changes.
    +
    conflicts
    +
    Check whether there are conflicts even though the tool reported success.
    +
    prompt
    +
    Always prompt for merge success, regardless of success reported by tool.
    +
    +
    +
    checkchanged
    +
    True is equivalent to check = changed. Default: False
    -
    checkchanged
    -
    Check whether outputs were written even though the tool reported -success. +
    checkconflicts
    +
    True is equivalent to check = conflicts. Default: False
    -
    fixeol
    +
    fixeol
    Attempt to fix up EOL changes caused by the merge tool. Default: False
    -
    gui
    +
    gui
    This tool requires a graphical interface to run. Default: False
    -
    regkey
    +
    regkey
    Windows registry key which describes install location of this tool. Mercurial will search for this key first under -HKEY_CURRENT_USER and then under HKEY_LOCAL_MACHINE. +HKEY_CURRENT_USER and then under HKEY_LOCAL_MACHINE. Default: None
    -
    regname
    +
    regname
    Name of value to read from specified registry key. Defaults to the unnamed (default) value.
    -
    regappend
    +
    regappend
    String to append to the value read from the registry, typically the executable name of the tool. Default: None
    -

    hooks

    +

    hooks

    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.

    -

    Example .hg/hgrc:

    +

    Example .hg/hgrc:

     [hooks]
     # update working directory after adding changesets
    @@ -564,86 +572,94 @@
     

    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 $HG_foo.

    +variables it is passed are listed with names of the form $HG_foo.

    -
    changegroup
    +
    changegroup
    Run after a changegroup has been added via push, pull or unbundle. -ID of the first new changeset is in $HG_NODE. URL from which -changes came is in $HG_URL.
    -
    commit
    +ID of the first new changeset is in $HG_NODE. URL from which +changes came is in $HG_URL. +
    commit
    Run after a changeset has been created in the local repository. ID -of the newly created changeset is in $HG_NODE. Parent changeset -IDs are in $HG_PARENT1 and $HG_PARENT2.
    -
    incoming
    +of the newly created changeset is in $HG_NODE. Parent changeset +IDs are in $HG_PARENT1 and $HG_PARENT2. +
    incoming
    Run after a changeset has been pulled, pushed, or unbundled into the local repository. The ID of the newly arrived changeset is in -$HG_NODE. URL that was source of changes came is in $HG_URL.
    -
    outgoing
    +$HG_NODE. URL that was source of changes came is in $HG_URL. +
    outgoing
    Run after sending changes from local repository to another. ID of -first changeset sent is in $HG_NODE. Source of operation is in -$HG_SOURCE; see "preoutgoing" hook for description.
    +first changeset sent is in $HG_NODE. Source of operation is in +$HG_SOURCE; see "preoutgoing" hook for description.
    post-<command>
    Run after successful invocations of the associated command. The -contents of the command line are passed as $HG_ARGS and the result -code in $HG_RESULT. Hook failure is ignored.
    +contents of the command line are passed as $HG_ARGS and the result +code in $HG_RESULT. Parsed command line arguments are passed as +$HG_PATS and $HG_OPTS. These contain string representations of +the python data internally passed to <command>. $HG_OPTS is a +dictionary of options (with unspecified options set to their defaults). +$HG_PATS is a list of arguments. Hook failure is ignored.
    pre-<command>
    Run before executing the associated command. The contents of the -command line are passed as $HG_ARGS. If the hook returns failure, -the command doesn't execute and Mercurial returns the failure +command line are passed as $HG_ARGS. Parsed command line arguments +are passed as $HG_PATS and $HG_OPTS. These contain string +representations of the data internally passed to <command>. $HG_OPTS +is a dictionary of options (with unspecified options set to their +defaults). $HG_PATS is a list of arguments. If the hook returns +failure, the command doesn't execute and Mercurial returns the failure code.
    -
    prechangegroup
    +
    prechangegroup
    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 $HG_URL.
    -
    precommit
    +will come is in $HG_URL. +
    precommit
    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 $HG_PARENT1 and $HG_PARENT2.
    -
    preoutgoing
    +Parent changeset IDs are in $HG_PARENT1 and $HG_PARENT2. +
    preoutgoing
    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 -$HG_SOURCE. If "serve", operation is happening on behalf of remote +$HG_SOURCE. 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.
    -
    pretag
    +
    pretag
    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 $HG_NODE. Name of tag is in $HG_TAG. Tag is -local if $HG_LOCAL=1, in repository if $HG_LOCAL=0.
    -
    pretxnchangegroup
    +changeset to tag is in $HG_NODE. Name of tag is in $HG_TAG. Tag is +local if $HG_LOCAL=1, in repository if $HG_LOCAL=0. +
    pretxnchangegroup
    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 -$HG_NODE. Exit status 0 allows the transaction to commit. Non-zero +$HG_NODE. 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 -$HG_URL.
    -
    pretxncommit
    +$HG_URL. +
    pretxncommit
    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 $HG_NODE. Parent changeset -IDs are in $HG_PARENT1 and $HG_PARENT2.
    -
    preupdate
    +be rolled back. ID of changeset is in $HG_NODE. Parent changeset +IDs are in $HG_PARENT1 and $HG_PARENT2. +
    preupdate
    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 $HG_PARENT1. If merge, ID -of second new parent is in $HG_PARENT2.
    -
    tag
    -
    Run after a tag is created. ID of tagged changeset is in $HG_NODE. -Name of tag is in $HG_TAG. Tag is local if $HG_LOCAL=1, in -repository if $HG_LOCAL=0.
    -
    update
    +Changeset ID of first new parent is in $HG_PARENT1. If merge, ID +of second new parent is in $HG_PARENT2. +
    tag
    +
    Run after a tag is created. ID of tagged changeset is in $HG_NODE. +Name of tag is in $HG_TAG. Tag is local if $HG_LOCAL=1, in +repository if $HG_LOCAL=0.
    +
    update
    Run after updating the working directory. Changeset ID of first -new parent is in $HG_PARENT1. If merge, ID of second new parent is -in $HG_PARENT2. If the update succeeded, $HG_ERROR=0. If the -update failed (e.g. because conflicts not resolved), $HG_ERROR=1.
    +new parent is in $HG_PARENT1. If merge, ID of second new parent is +in $HG_PARENT2. If the update succeeded, $HG_ERROR=0. If the +update failed (e.g. because conflicts not resolved), $HG_ERROR=1.

    Note

    @@ -656,7 +672,7 @@

    Note

    Environment variables with empty values may not be passed to -hooks on platforms such as Windows. As an example, $HG_PARENT2 +hooks on platforms such as Windows. As an example, $HG_PARENT2 will have an empty value under Unix-like platforms for non-merge changesets, while it will not be available at all under Windows.

    @@ -667,68 +683,68 @@

    Python hooks are run within the Mercurial process. Each hook is called with at least three keyword arguments: a ui object (keyword -ui), a repository object (keyword repo), and a hooktype +ui), a repository object (keyword repo), and a hooktype keyword that tells what kind of hook is used. Arguments listed as environment variables above are passed as keyword arguments, with no -HG_ prefix, and names in lower case.

    +HG_ prefix, and names in lower case.

    If a Python hook returns a "true" value or raises an exception, this is treated as a failure.

    -

    http_proxy

    +

    http_proxy

    Used to access web-based Mercurial repositories through a HTTP proxy.

    -
    host
    +
    host
    Host name and (optional) port of the proxy server, for example "myproxy:8000".
    -
    no
    +
    no
    Optional. Comma-separated list of host names that should bypass the proxy.
    -
    passwd
    +
    passwd
    Optional. Password to authenticate with at the proxy server.
    -
    user
    +
    user
    Optional. User name to authenticate with at the proxy server.
    -
    always
    +
    always
    Optional. Always use the proxy, even for localhost and any entries -in http_proxy.no. True or False. Default: False.
    +in http_proxy.no. True or False. Default: False.
    -

    smtp

    +

    smtp

    Configuration for extensions that need to send email messages.

    -
    host
    +
    host
    Host name of mail server, e.g. "mail.example.com".
    -
    port
    +
    port
    Optional. Port to connect to on mail server. Default: 25.
    -
    tls
    +
    tls
    Optional. Whether to connect to mail server using TLS. True or False. Default: False.
    -
    username
    +
    username
    Optional. User name to authenticate to SMTP server with. If username is specified, password must also be specified. Default: none.
    -
    password
    +
    password
    Optional. Password to authenticate to SMTP server with. If username is specified, password must also be specified. Default: none.
    -
    local_hostname
    +
    local_hostname
    Optional. It's the hostname that the sender can use to identify itself to the MTA.
    -

    patch

    +

    patch

    Settings used when applying patches, for instance through the 'import' command or with Mercurial Queues extension.

    -
    eol
    +
    eol
    When set to 'strict' patch content and patched files end of lines -are preserved. When set to lf or crlf, both files end of +are preserved. When set to lf or crlf, 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 -auto, end of lines are again ignored while patching but line +auto, 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. @@ -736,13 +752,13 @@
    -

    paths

    +

    paths

    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.

    -
    default
    +
    default
    Directory or URL to use when pulling if no source is specified. Default is set to repository from which the current repository was cloned.
    @@ -752,38 +768,38 @@
    -

    profiling

    +

    profiling

    Specifies profiling format and file output. 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.

    -
    format
    +
    format

    Profiling format. Default: text.

    -
    text
    +
    text
    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.
    -
    kcachegrind
    +
    kcachegrind
    Format profiling data for kcachegrind use: when saving to a file, the generated file can directly be loaded into kcachegrind.
    -
    output
    +
    output
    File path where profiling data or report should be saved. If the file exists, it is replaced. Default: None, data is printed on stderr
    -

    server

    +

    server

    Controls generic server settings.

    -
    uncompressed
    +
    uncompressed
    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 @@ -794,73 +810,77 @@ extra data transfer overhead. This mode will also temporarily hold the write lock while determining what data to transfer. Default is True.
    -
    validate
    +
    validate
    Whether to validate the completeness of pushed changesets by checking that all new file revisions specified in manifests are present. Default is False.
    -

    trusted

    -

    For security reasons, Mercurial will not use the settings in the -.hg/hgrc file from a repository if it doesn't belong to a trusted -user or to a trusted group. The main exception is the web interface, -which automatically uses some safe settings, since it's common to -serve repositories from different users.

    +

    trusted

    +

    Mercurial will not use the settings in the +.hg/hgrc 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 [web] +section.

    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 *.

    +group with name *. These settings must be placed in an +already-trusted file to take effect, such as $HOME/.hgrc of the +user or service running Mercurial.

    -
    users
    +
    users
    Comma-separated list of trusted users.
    -
    groups
    +
    groups
    Comma-separated list of trusted groups.
    -

    ui

    +

    ui

    User interface controls.

    -
    archivemeta
    +
    archivemeta
    Whether to include the .hg_archival.txt file containing meta data (hashes for the repository base and for tip) in archives created -by the hg archive command or downloaded via hgweb. +by the hg archive command or downloaded via hgweb. Default is True.
    -
    askusername
    +
    askusername
    Whether to prompt for a username when committing. If True, and -neither $HGUSER nor $EMAIL has been specified, then the user will +neither $HGUSER nor $EMAIL has been specified, then the user will be prompted to enter a username. If no username is entered, the -default USER@HOST is used instead. +default USER@HOST is used instead. Default is False.
    -
    debug
    +
    debug
    Print debugging information. True or False. Default is False.
    -
    editor
    -
    The editor to use during a commit. Default is $EDITOR or vi.
    -
    fallbackencoding
    +
    editor
    +
    The editor to use during a commit. Default is $EDITOR or vi.
    +
    fallbackencoding
    Encoding to try if it's not possible to decode the changelog using UTF-8. Default is ISO-8859-1.
    -
    ignore
    +
    ignore
    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 -ignore.other = ~/.hgignore2. For details of the ignore file +ignore.other = ~/.hgignore2. For details of the ignore file format, see the hgignore(5) man page.
    -
    interactive
    +
    interactive
    Allow to prompt the user. True or False. Default is True.
    -
    logtemplate
    +
    logtemplate
    Template string for commands that print changesets.
    -
    merge
    +
    merge

    The conflict resolution program to use during a manual merge. There are some internal tools available:

    -
    internal:local
    +
    internal:local
    keep the local version
    -
    internal:other
    +
    internal:other
    use the other version
    -
    internal:merge
    +
    internal:merge
    use the internal non-interactive merge tool
    -
    internal:fail
    +
    internal:fail
    fail to merge
    @@ -868,96 +888,95 @@

    For more information on configuring merge tools see the merge-tools section.

    -
    patch
    -
    command to use to apply patches. Look for gpatch or patch in +
    patch
    +
    command to use to apply patches. Look for gpatch or patch in PATH if unset.
    -
    quiet
    +
    quiet
    Reduce the amount of output printed. True or False. Default is False.
    -
    remotecmd
    -
    remote command to use for clone/push/pull operations. Default is hg.
    -
    report_untrusted
    -
    Warn if a .hg/hgrc file is ignored due to not being owned by a +
    remotecmd
    +
    remote command to use for clone/push/pull operations. Default is hg.
    +
    report_untrusted
    +
    Warn if a .hg/hgrc file is ignored due to not being owned by a trusted user or group. True or False. Default is True.
    -
    slash
    -
    Display paths using a slash (/) as the path separator. This +
    slash
    +
    Display paths using a slash (/) 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 (\)). +backslash character (\)). Default is False.
    -
    ssh
    -
    command to use for SSH connections. Default is ssh.
    -
    strict
    +
    ssh
    +
    command to use for SSH connections. Default is ssh.
    +
    strict
    Require exact command names, instead of allowing unambiguous abbreviations. True or False. Default is False.
    -
    style
    +
    style
    Name of style to use for command output.
    -
    timeout
    +
    timeout
    The timeout used when a lock is held (in seconds), a negative value means no timeout. Default is 600.
    -
    traceback
    +
    traceback
    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.
    -
    username
    +
    username
    The committer of a changeset created when running "commit". -Typically a person's name and email address, e.g. Fred Widget -<fred@example.com>. Default is $EMAIL or username@hostname. If +Typically a person's name and email address, e.g. Fred Widget +<fred@example.com>. Default is $EMAIL or username@hostname. If the username in hgrc is empty, it has to be specified manually or in a different hgrc file (e.g. $HOME/.hgrc, if the admin set -username = in the system hgrc).
    -
    verbose
    +username = in the system hgrc). Environment variables in the +username are expanded. +
    verbose
    Increase the amount of output printed. True or False. Default is False.
    -

    web

    +

    web

    Web interface configuration.

    -
    accesslog
    +
    accesslog
    Where to output the access log. Default is stdout.
    -
    address
    +
    address
    Interface address to bind to. Default is all.
    -
    allow_archive
    +
    allow_archive
    List of archive format (bz2, gz, zip) allowed for downloading. Default is empty.
    -
    allowbz2
    +
    allowbz2
    (DEPRECATED) Whether to allow .tar.bz2 downloading of repository revisions. Default is False.
    -
    allowgz
    +
    allowgz
    (DEPRECATED) Whether to allow .tar.gz downloading of repository revisions. Default is False.
    -
    allowpull
    +
    allowpull
    Whether to allow pulling from the repository. Default is True.
    -
    allow_push
    +
    allow_push
    Whether to allow pushing to the repository. If empty or not set, -push is not allowed. If the special value *, any remote user can +push is not allowed. If the special value *, 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 (separated by whitespace or ,). The -contents of the allow_push list are examined after the deny_push -list.
    -
    allow_read
    +be present in this list. The contents of the allow_push list are +examined after the deny_push list. +
    allow_read
    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 (separated by -whitespace or ,), 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 * 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.
    -
    allowzip
    +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 * 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. +
    allowzip
    (DEPRECATED) Whether to allow .zip downloading of repository revisions. Default is False. This feature creates temporary files.
    -
    baseurl
    +
    baseurl
    Base URL to use when publishing URLs in other locations, so third-party tools like email notification hooks can construct URLs. Example: http://hgserver/repos/.
    -
    cacerts
    +
    cacerts

    Path to file containing a list of PEM encoded certificate authorities that may be used to verify an SSL server's identity. The form must be as follows:

    @@ -977,24 +996,22 @@ On most Linux systems this will be /etc/ssl/certs/ca-certificates.crt. Otherwise you will have to generate this file manually.

    -
    contact
    +
    contact
    Name or email address of the person in charge of the repository. -Defaults to ui.username or $EMAIL or "unknown" if unset or empty.
    -
    deny_push
    +Defaults to ui.username or $EMAIL or "unknown" if unset or empty. +
    deny_push
    Whether to deny pushing to the repository. If empty or not set, -push is not denied. If the special value *, all remote users are +push is not denied. If the special value *, all remote users are denied push. Otherwise, unauthenticated users are all denied, and -any authenticated user name present in this list (separated by -whitespace or ,) is also denied. The contents of the deny_push -list are examined before the allow_push list.
    -
    deny_read
    +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. +
    deny_read
    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 (separated by -whitespace or ,) is also denied access to the repository. If set -to the special value *, 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 +authenticated user name present in this list is also denied access to +the repository. If set to the special value *, 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 @@ -1002,48 +1019,48 @@ the list of repositories. The contents of the deny_read list have priority over (are examined before) the contents of the allow_read list.
    -
    descend
    +
    descend
    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).
    -
    description
    +
    description
    Textual description of the repository's purpose or contents. Default is "unknown".
    -
    encoding
    -
    Character encoding name. +
    encoding
    +
    Character encoding name. Default is the current locale charset. Example: "UTF-8"
    -
    errorlog
    +
    errorlog
    Where to output the error log. Default is stderr.
    -
    hidden
    +
    hidden
    Whether to hide the repository in the hgwebdir index. Default is False.
    -
    ipv6
    +
    ipv6
    Whether to use IPv6. Default is False.
    -
    name
    +
    name
    Repository name to use in the web interface. Default is current working directory.
    -
    maxchanges
    +
    maxchanges
    Maximum number of changes to list on the changelog. Default is 10.
    -
    maxfiles
    +
    maxfiles
    Maximum number of files to list per changeset. Default is 10.
    -
    port
    +
    port
    Port to listen on. Default is 8000.
    -
    prefix
    +
    prefix
    Prefix path to serve from. Default is '' (server root).
    -
    push_ssl
    +
    push_ssl
    Whether to require that inbound pushes be transported over SSL to prevent password sniffing. Default is True.
    -
    staticurl
    +
    staticurl
    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: http://hgserver/static/.
    -
    stripes
    +
    stripes
    How many lines a "zebra stripe" should span in multiline output. Default is 1; set to 0 to disable.
    -
    style
    +
    style
    Which template map style to use.
    -
    templates
    +
    templates
    Where to find the HTML templates. Default is install path.
    diff -Nru mercurial-1.5.4/doc/hgrc.5.txt mercurial-1.6/doc/hgrc.5.txt --- mercurial-1.5.4/doc/hgrc.5.txt 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/doc/hgrc.5.txt 2010-07-01 18:06:26.000000000 +0100 @@ -146,15 +146,29 @@ 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 ``%include`` directive is found. +Environment variables and ``~user`` constructs are expanded in +``file``. This lets you do something like:: + + %include ~/.hgrc.d/$HOST.rc + +to include a different configuration file on each computer you use. A line with ``%unset name`` will remove ``name`` from the current section, if it has been set previously. The values are either free-form text strings, lists of text strings, -or Boolean values. Lists are split on whitespace and commas. 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). - +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). + +List values are separated by whitespace or comma, except when values are +placed in double quotation marks:: + + allow_read = "John Doe, PhD", brian, betty + +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., ``foo"bar baz`` is the list of ``foo"bar`` and ``baz``). Sections -------- @@ -280,24 +294,9 @@ where the standard shell I/O redirection operators often have strange effects and may corrupt the contents of your files. -The most common usage is for LF <-> CRLF translation on Windows. For -this, use the "smart" converters which check for binary files:: - - [extensions] - hgext.win32text = - [encode] - ** = cleverencode: - [decode] - ** = cleverdecode: - -or if you only want to translate certain files:: - - [extensions] - hgext.win32text = - [encode] - **.txt = dumbencode: - [decode] - **.txt = dumbdecode: +This filter mechanism is used internally by the ``eol`` extension to +translate line ending characters between Windows (CRLF) and Unix (LF) +format. We suggest you use the ``eol`` extension for convenience. ``defaults`` @@ -308,8 +307,8 @@ Use the ``[defaults]`` section to define command defaults, i.e. the default options/arguments to pass to the specified commands. -The following example makes ``hg log`` run in verbose mode, and ``hg -status`` show only the modified files, by default:: +The following example makes :hg:`log` run in verbose mode, and :hg:`hg +status` show only the modified files, by default:: [defaults] log = -v @@ -486,7 +485,8 @@ Default: ``$local $base $other`` ``premerge`` Attempt to run internal non-interactive 3-way merge tool before - launching external tool. + launching external tool. Options are ``true``, ``false``, or ``keep`` + to leave markers in the file if the premerge fails. Default: True ``binary`` This tool can merge binary files. Defaults to False, unless tool @@ -494,13 +494,21 @@ ``symlink`` This tool can merge symlinks. Defaults to False, even if tool was selected by file pattern match. -``checkconflicts`` - Check whether there are conflicts even though the tool reported - success. - Default: False +``check`` + A list of merge success-checking options: + + ``changed`` + Ask whether merge was successful when the merged file shows no changes. + ``conflicts`` + Check whether there are conflicts even though the tool reported success. + ``prompt`` + Always prompt for merge success, regardless of success reported by tool. + ``checkchanged`` - Check whether outputs were written even though the tool reported - success. + True is equivalent to ``check = changed``. + Default: False +``checkconflicts`` + True is equivalent to ``check = conflicts``. Default: False ``fixeol`` Attempt to fix up EOL changes caused by the merge tool. @@ -562,11 +570,19 @@ ``post-`` Run after successful invocations of the associated command. The contents of the command line are passed as ``$HG_ARGS`` and the result - code in ``$HG_RESULT``. Hook failure is ignored. + code in ``$HG_RESULT``. Parsed command line arguments are passed as + ``$HG_PATS`` and ``$HG_OPTS``. These contain string representations of + the python data internally passed to . ``$HG_OPTS`` is a + dictionary of options (with unspecified options set to their defaults). + ``$HG_PATS`` is a list of arguments. Hook failure is ignored. ``pre-`` Run before executing the associated command. The contents of the - command line are passed as ``$HG_ARGS``. If the hook returns failure, - the command doesn't execute and Mercurial returns the failure + command line are passed as ``$HG_ARGS``. Parsed command line arguments + are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain string + representations of the data internally passed to . ``$HG_OPTS`` + is a dictionary of options (with unspecified options set to their + defaults). ``$HG_PATS`` is a list of arguments. If the hook returns + failure, the command doesn't execute and Mercurial returns the failure code. ``prechangegroup`` Run before a changegroup is added via push, pull or unbundle. Exit @@ -773,15 +789,20 @@ ``trusted`` """"""""""" -For security reasons, Mercurial will not use the settings in the + +Mercurial will not use the settings in the ``.hg/hgrc`` file from a repository if it doesn't belong to a trusted -user or to a trusted group. The main exception is the web interface, -which automatically uses some safe settings, since it's common to -serve repositories from different users. +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 ``[web]`` +section. 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 ``*``. +group with name ``*``. These settings must be placed in an +*already-trusted file* to take effect, such as ``$HOME/.hgrc`` of the +user or service running Mercurial. ``users`` Comma-separated list of trusted users. @@ -797,7 +818,7 @@ ``archivemeta`` Whether to include the .hg_archival.txt file containing meta data (hashes for the repository base and for tip) in archives created - by the hg archive command or downloaded via hgweb. + by the :hg:`archive` command or downloaded via hgweb. Default is True. ``askusername`` Whether to prompt for a username when committing. If True, and @@ -876,7 +897,8 @@ ``. Default is ``$EMAIL`` or ``username@hostname``. If the username in hgrc is empty, it has to be specified manually or in a different hgrc file (e.g. ``$HOME/.hgrc``, if the admin set - ``username =`` in the system hgrc). + ``username =`` in the system hgrc). Environment variables in the + username are expanded. ``verbose`` Increase the amount of output printed. True or False. Default is False. @@ -907,20 +929,18 @@ push is not allowed. If the special value ``*``, 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 (separated by whitespace or ``,``). The - contents of the allow_push list are examined after the deny_push - list. + be present in this list. The contents of the allow_push list are + examined after the deny_push list. ``allow_read`` 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 (separated by - whitespace or ``,``), 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 ``*`` 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. + 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 ``*`` 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. ``allowzip`` (DEPRECATED) Whether to allow .zip downloading of repository revisions. Default is False. This feature creates temporary files. @@ -955,17 +975,15 @@ Whether to deny pushing to the repository. If empty or not set, push is not denied. If the special value ``*``, all remote users are denied push. Otherwise, unauthenticated users are all denied, and - any authenticated user name present in this list (separated by - whitespace or ``,``) is also denied. The contents of the deny_push - list are examined before the allow_push list. + 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. ``deny_read`` 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 (separated by - whitespace or ``,``) is also denied access to the repository. If set - to the special value ``*``, 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 + authenticated user name present in this list is also denied access to + the repository. If set to the special value ``*``, 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 @@ -981,7 +999,7 @@ Textual description of the repository's purpose or contents. Default is "unknown". ``encoding`` - Character encoding name. + Character encoding name. Default is the current locale charset. Example: "UTF-8" ``errorlog`` Where to output the error log. Default is stderr. diff -Nru mercurial-1.5.4/doc/Makefile mercurial-1.6/doc/Makefile --- mercurial-1.5.4/doc/Makefile 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/doc/Makefile 2010-07-01 18:06:26.000000000 +0100 @@ -6,7 +6,6 @@ MANDIR=$(PREFIX)/share/man INSTALL=install -c -m 644 PYTHON=python -RST2HTML=$(shell which rst2html 2> /dev/null || echo rst2html.py) export LANGUAGE=C export LC_ALL=C @@ -25,11 +24,11 @@ mv $@.tmp $@ %: %.txt common.txt - $(PYTHON) rst2man.py --halt warning \ + $(PYTHON) runrst manpage --halt warning \ --strip-elements-with-class htmlonly $*.txt $* %.html: %.txt common.txt - $(RST2HTML) --halt warning \ + $(PYTHON) runrst html --halt warning \ --link-stylesheet --stylesheet-path style.css $*.txt $*.html MANIFEST: man html diff -Nru mercurial-1.5.4/doc/manpage.py mercurial-1.6/doc/manpage.py --- mercurial-1.5.4/doc/manpage.py 1970-01-01 01:00:00.000000000 +0100 +++ mercurial-1.6/doc/manpage.py 2010-07-01 18:06:26.000000000 +0100 @@ -0,0 +1,1102 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# $Id: manpage.py 6110 2009-08-31 14:40:33Z grubert $ +# Author: Engelbert Gruber +# 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 +import roman + +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: + 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 + 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: + enum_style = { + 'bullet' : '\\(bu', + 'emdash' : '\\(em', + } + + def __init__(self, style): + self._style = style + if node.has_key('start'): + 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 node.has_key('enumtype'): + 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 not name 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 -Nru mercurial-1.5.4/doc/rst2man.py mercurial-1.6/doc/rst2man.py --- mercurial-1.5.4/doc/rst2man.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/doc/rst2man.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,1114 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# $Id: manpage.py 6110 2009-08-31 14:40:33Z grubert $ -# Author: Engelbert Gruber -# 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 sys -import os -import time -import re -from types import ListType - -import docutils -from docutils import nodes, utils, writers, languages -import roman - -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: - 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 - 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: - enum_style = { - 'bullet' : '\\(bu', - 'emdash' : '\\(em', - } - - def __init__(self, style): - self._style = style - if node.has_key('start'): - 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 node.has_key('enumtype'): - 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 not name 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__) - -# The following part is taken from the Docutils rst2man.py script: -if __name__ == "__main__": - from docutils.core import publish_cmdline, default_description - description = ("Generates plain unix manual documents. " + - default_description) - publish_cmdline(writer=Writer(), description=description) - -# vim: set fileencoding=utf-8 et ts=4 ai : diff -Nru mercurial-1.5.4/doc/runrst mercurial-1.6/doc/runrst --- mercurial-1.5.4/doc/runrst 1970-01-01 01:00:00.000000000 +0100 +++ mercurial-1.6/doc/runrst 2010-07-01 18:06:26.000000000 +0100 @@ -0,0 +1,42 @@ +#!/usr/bin/env python +# +# runrst - register custom roles and run correct writer +# +# Copyright 2010 Matt Mackall 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 +from docutils.parsers.rst import roles +from docutils.core import publish_cmdline +from docutils import nodes, utils + +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 -Nru mercurial-1.5.4/hgeditor mercurial-1.6/hgeditor --- mercurial-1.5.4/hgeditor 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgeditor 2010-07-01 18:06:26.000000000 +0100 @@ -25,12 +25,12 @@ # Remove temporary files even if we get interrupted trap "cleanup_exit" 0 # normal exit -trap "exit 255" 1 2 3 6 15 # HUP INT QUIT ABRT TERM +trap "exit 255" HUP INT QUIT ABRT TERM -HGTMP="${TMPDIR-/tmp}/hgeditor.$RANDOM.$RANDOM.$RANDOM.$$" -(umask 077 && mkdir "$HGTMP") || { - echo "Could not create temporary directory! Exiting." 1>&2 - exit 1 +HGTMP=$(mktemp -d ${TMPDIR-/tmp}/hgeditor.XXXXXX) +[ x$HGTMP != x -a -d $HGTMP ] || { + echo "Could not create temporary directory! Exiting." 1>&2 + exit 1 } ( diff -Nru mercurial-1.5.4/hgext/acl.py mercurial-1.6/hgext/acl.py --- mercurial-1.5.4/hgext/acl.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/acl.py 2010-07-01 18:06:26.000000000 +0100 @@ -7,55 +7,176 @@ '''hooks for controlling repository access -This hook makes it possible to allow or deny write access to portions -of a repository when receiving incoming changesets. +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. 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). 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. +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. -To use this hook, configure the acl extension in your hgrc like this:: +The order in which access checks are performed is: - [extensions] - acl = +1) Deny list for branches (section ``acl.deny.branches``) +2) Allow list for branches (section ``acl.allow.branches``) +3) Deny list for paths (section ``acl.deny``) +4) Allow list for paths (section ``acl.allow``) + +The allow and deny sections take key-value pairs. + +Branch-based Access Control +--------------------------- + +Use the ``acl.deny.branches`` and ``acl.allow.branches`` sections to +have branch-based access control. Keys in these sections can be +either: + +- a branch name, or +- an asterisk, to match any branch; + +The corresponding values can be either: + +- a comma-separated list containing users and groups, or +- an asterisk, to match anyone; + +Path-based Access Control +------------------------- + +Use the ``acl.deny`` and ``acl.allow`` 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. + +Groups +------ + +Group names must be prefixed with an ``@`` symbol. Specifying a group +name has the same effect as specifying all the users in that group. + +You can define group members in the ``acl.groups`` 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. + +Example Configuration +--------------------- + +:: [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] - # Check whether the source of incoming changes is in this list - # ("serve" == ssh or http, "push", "pull", "bundle") + # 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 -The allow and deny sections take a subtree pattern as key (with a glob -syntax by default), and a comma separated list of users as the -corresponding value. The deny list is checked before the allow list -is. :: + [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. - # An empty acl.allow section means no users allowed. + # if acl.allow is not present, all users are allowed by default + # empty acl.allow = no users allowed + + # User "doc_writer" has write access to any file under the "docs" + # folder: docs/** = doc_writer + + # User "jack" and group "designers" have write access to any file + # under the "images" folder: + images/** = jack, @designers + + # Everyone (except for "user6" - see acl.deny above) will have write + # access to any file under the "resources" folder (except for 1 + # file. See acl.deny): + src/main/resources/** = * + .hgtags = release_engineer - [acl.deny] - # If acl.deny is not present, no users are refused by default. - # An empty acl.deny section means all users allowed. - glob pattern = user4, user5 - ** = user6 ''' from mercurial.i18n import _ from mercurial import util, match import getpass, urllib +def _getusers(ui, group): + + # First, try to use group definition from section [acl.groups] + hgrcusers = ui.configlist('acl.groups', group) + if hgrcusers: + return hgrcusers + + ui.debug('acl: "%s" not defined in [acl.groups]\n' % group) + # If no users found in group definition, get users from OS-level group + try: + return util.groupmembers(group) + except KeyError: + raise util.Abort(_("group '%s' is undefined") % group) + +def _usermatch(ui, user, usersorgroups): + + if usersorgroups == '*': + return True + + for ug in usersorgroups.replace(',', ' ').split(): + if user == ug or ug.find('@') == 0 and user in _getusers(ui, ug[1:]): + return True + + return False + def buildmatch(ui, repo, user, key): '''return tuple of (match function, list enabled).''' if not ui.has_section(key): @@ -63,19 +184,26 @@ return None pats = [pat for pat, users in ui.configitems(key) - if users == '*' or user in users.replace(',', ' ').split()] + if _usermatch(ui, user, users)] ui.debug('acl: %s enabled, %d entries for user %s\n' % (key, len(pats), user)) + + if not repo: + if pats: + return lambda b: '*' in pats or b in pats + return lambda b: False + if pats: return match.match(repo.root, '', pats) return match.exact(repo.root, '', []) def hook(ui, repo, hooktype, node=None, source=None, **kwargs): - if hooktype != 'pretxnchangegroup': + if hooktype not in ['pretxnchangegroup', 'pretxncommit']: raise util.Abort(_('config error - hook type "%s" cannot stop ' - 'incoming changesets') % hooktype) - if source not in ui.config('acl', 'sources', 'serve').split(): + 'incoming changesets nor commits') % hooktype) + if (hooktype == 'pretxnchangegroup' and + source not in ui.config('acl', 'sources', 'serve').split()): ui.debug('acl: changes have source "%s" - skipping\n' % source) return @@ -90,12 +218,28 @@ cfg = ui.config('acl', 'config') if cfg: - ui.readconfig(cfg, sections = ['acl.allow', 'acl.deny']) + ui.readconfig(cfg, sections = ['acl.groups', 'acl.allow.branches', + 'acl.deny.branches', 'acl.allow', 'acl.deny']) + + allowbranches = buildmatch(ui, None, user, 'acl.allow.branches') + denybranches = buildmatch(ui, None, user, 'acl.deny.branches') allow = buildmatch(ui, repo, user, 'acl.allow') deny = buildmatch(ui, repo, user, 'acl.deny') for rev in xrange(repo[node], len(repo)): ctx = repo[rev] + branch = ctx.branch() + if denybranches and denybranches(branch): + raise util.Abort(_('acl: user "%s" denied on branch "%s"' + ' (changeset "%s")') + % (user, branch, ctx)) + if allowbranches and not allowbranches(branch): + raise util.Abort(_('acl: user "%s" not allowed on branch "%s"' + ' (changeset "%s")') + % (user, branch, ctx)) + ui.debug('acl: branch access granted: "%s" on branch "%s"\n' + % (ctx, branch)) + for f in ctx.files(): if deny and deny(f): ui.debug('acl: user %s denied on %s\n' % (user, f)) diff -Nru mercurial-1.5.4/hgext/bookmarks.py mercurial-1.6/hgext/bookmarks.py --- mercurial-1.5.4/hgext/bookmarks.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/bookmarks.py 2010-07-01 18:06:26.000000000 +0100 @@ -12,8 +12,8 @@ changeset that is based on a changeset that has a bookmark on it, the bookmark shifts to the new changeset. -It is possible to use bookmark names in every revision lookup (e.g. hg -merge, hg update). +It is possible to use bookmark names in every revision lookup (e.g. +:hg:`merge`, :hg:`update`). By default, when several bookmarks point to the same changeset, they will all move forward together. It is possible to obtain a more @@ -30,7 +30,7 @@ from mercurial.i18n import _ from mercurial.node import nullid, nullrev, hex, short -from mercurial import util, commands, repair, extensions +from mercurial import util, commands, repair, extensions, pushkey, hg, url import os def write(repo): @@ -53,6 +53,13 @@ for refspec, node in refs.iteritems(): file.write("%s %s\n" % (hex(node), refspec)) file.rename() + + # touch 00changelog.i so hgweb reloads bookmarks (no lock needed) + try: + os.utime(repo.sjoin('00changelog.i'), None) + except OSError: + pass + finally: wlock.release() @@ -88,10 +95,10 @@ Bookmarks are pointers to certain commits that move when committing. Bookmarks are local. They can be renamed, copied and - deleted. It is possible to use bookmark names in 'hg merge' and - 'hg update' to merge and update respectively to a given bookmark. + deleted. It is possible to use bookmark names in :hg:`merge` and + :hg:`update` to merge and update respectively to a given bookmark. - You can use 'hg bookmark NAME' to set a bookmark on the working + You can use :hg:`bookmark NAME` 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. @@ -152,15 +159,22 @@ for bmark, n in marks.iteritems(): if ui.configbool('bookmarks', 'track.current'): current = repo._bookmarkcurrent - prefix = (bmark == current and n == cur) and '*' or ' ' + if bmark == current and n == cur: + prefix, label = '*', 'bookmarks.current' + else: + prefix, label = ' ', '' else: - prefix = (n == cur) and '*' or ' ' + if n == cur: + prefix, label = '*', 'bookmarks.current' + else: + prefix, label = ' ', '' if ui.quiet: - ui.write("%s\n" % bmark) + ui.write("%s\n" % bmark, label=label) else: ui.write(" %s %-25s %d:%s\n" % ( - prefix, bmark, repo.changelog.rev(n), hexfn(n))) + prefix, bmark, repo.changelog.rev(n), hexfn(n)), + label=label) return def _revstostrip(changelog, node): @@ -234,10 +248,10 @@ file.close() return mark - def rollback(self): + def rollback(self, *args): if os.path.exists(self.join('undo.bookmarks')): util.rename(self.join('undo.bookmarks'), self.join('bookmarks')) - return super(bookmark_repo, self).rollback() + return super(bookmark_repo, self).rollback(*args) def lookup(self, key): if key in self._bookmarks: @@ -277,11 +291,58 @@ finally: wlock.release() - def addchangegroup(self, source, srctype, url, emptyok=False): + def pull(self, remote, heads=None, force=False): + result = super(bookmark_repo, self).pull(remote, heads, force) + + self.ui.debug("checking for updated bookmarks\n") + rb = remote.listkeys('bookmarks') + changes = 0 + for k in rb.keys(): + if k in self._bookmarks: + nr, nl = rb[k], self._bookmarks[k] + if nr in self: + cr = self[nr] + cl = self[nl] + if cl.rev() >= cr.rev(): + continue + if cr in cl.descendants(): + self._bookmarks[k] = cr.node() + changes += 1 + self.ui.status(_("updating bookmark %s\n") % k) + else: + self.ui.warn(_("not updating divergent" + " bookmark %s\n") % k) + if changes: + write(repo) + + return result + + def push(self, remote, force=False, revs=None, newbranch=False): + result = super(bookmark_repo, self).push(remote, force, revs, + newbranch) + + self.ui.debug("checking for updated bookmarks\n") + rb = remote.listkeys('bookmarks') + for k in rb.keys(): + if k in self._bookmarks: + nr, nl = rb[k], self._bookmarks[k] + if nr in self: + cr = self[nr] + cl = self[nl] + if cl in cr.descendants(): + r = remote.pushkey('bookmarks', k, nr, nl) + if r: + self.ui.status(_("updating bookmark %s\n") % k) + else: + self.ui.warn(_('updating bookmark %s' + ' failed!\n') % k) + + return result + + def addchangegroup(self, *args, **kwargs): parents = self.dirstate.parents() - result = super(bookmark_repo, self).addchangegroup( - source, srctype, url, emptyok) + result = super(bookmark_repo, self).addchangegroup(*args, **kwargs) if result > 1: # We have more heads than before return result @@ -301,15 +362,149 @@ super(bookmark_repo, self).invalidate() for attr in ('_bookmarks', '_bookmarkcurrent'): if attr in self.__dict__: - delattr(repo, attr) + delattr(self, attr) repo.__class__ = bookmark_repo +def listbookmarks(repo): + d = {} + for k, v in repo._bookmarks.iteritems(): + d[k] = hex(v) + return d + +def pushbookmark(repo, key, old, new): + w = repo.wlock() + try: + marks = repo._bookmarks + if hex(marks.get(key, '')) != old: + return False + if new == '': + del marks[key] + else: + if new not in repo: + return False + marks[key] = repo[new].node() + write(repo) + return True + finally: + w.release() + +def pull(oldpull, ui, repo, source="default", **opts): + # translate bookmark args to rev args for actual pull + if opts.get('bookmark'): + # this is an unpleasant hack as pull will do this internally + source, branches = hg.parseurl(ui.expandpath(source), + opts.get('branch')) + other = hg.repository(hg.remoteui(repo, opts), source) + rb = other.listkeys('bookmarks') + + for b in opts['bookmark']: + if b not in rb: + raise util.Abort(_('remote bookmark %s not found!') % b) + opts.setdefault('rev', []).append(b) + + result = oldpull(ui, repo, source, **opts) + + # update specified bookmarks + if opts.get('bookmark'): + for b in opts['bookmark']: + # explicit pull overrides local bookmark if any + ui.status(_("importing bookmark %s\n") % b) + repo._bookmarks[b] = repo[rb[b]].node() + write(repo) + + return result + +def push(oldpush, ui, repo, dest=None, **opts): + dopush = True + if opts.get('bookmark'): + dopush = False + for b in opts['bookmark']: + if b in repo._bookmarks: + dopush = True + opts.setdefault('rev', []).append(b) + + result = 0 + if dopush: + result = oldpush(ui, repo, dest, **opts) + + if opts.get('bookmark'): + # this is an unpleasant hack as push will do this internally + dest = ui.expandpath(dest or 'default-push', dest or 'default') + dest, branches = hg.parseurl(dest, opts.get('branch')) + other = hg.repository(hg.remoteui(repo, opts), dest) + rb = other.listkeys('bookmarks') + for b in opts['bookmark']: + # explicit push overrides remote bookmark if any + if b in repo._bookmarks: + ui.status(_("exporting bookmark %s\n") % b) + new = repo[b].hex() + else: + ui.status(_("deleting remote bookmark %s\n") % b) + new = '' # delete + old = rb.get(b, '') + r = other.pushkey('bookmarks', b, old, new) + if not r: + ui.warn(_('updating bookmark %s failed!\n') % b) + if not result: + result = 2 + + return result + +def diffbookmarks(ui, repo, remote): + ui.status(_("searching for changes\n")) + + lmarks = repo.listkeys('bookmarks') + rmarks = remote.listkeys('bookmarks') + + diff = set(rmarks) - set(lmarks) + for k in diff: + ui.write(" %-25s %s\n" % (k, rmarks[k][:12])) + + if len(diff) <= 0: + ui.status(_("no changes found\n")) + return 1 + return 0 + +def incoming(oldincoming, ui, repo, source="default", **opts): + if opts.get('bookmarks'): + source, branches = hg.parseurl(ui.expandpath(source), opts.get('branch')) + other = hg.repository(hg.remoteui(repo, opts), source) + ui.status(_('comparing with %s\n') % url.hidepassword(source)) + return diffbookmarks(ui, repo, other) + else: + return oldincoming(ui, repo, source, **opts) + +def outgoing(oldoutgoing, ui, repo, dest=None, **opts): + if opts.get('bookmarks'): + dest = ui.expandpath(dest or 'default-push', dest or 'default') + dest, branches = hg.parseurl(dest, opts.get('branch')) + other = hg.repository(hg.remoteui(repo, opts), dest) + ui.status(_('comparing with %s\n') % url.hidepassword(dest)) + return diffbookmarks(ui, other, repo) + else: + return oldoutgoing(ui, repo, dest, **opts) + def uisetup(ui): extensions.wrapfunction(repair, "strip", strip) if ui.configbool('bookmarks', 'track.current'): extensions.wrapcommand(commands.table, 'update', updatecurbookmark) + entry = extensions.wrapcommand(commands.table, 'pull', pull) + entry[1].append(('B', 'bookmark', [], + _("bookmark to import"))) + entry = extensions.wrapcommand(commands.table, 'push', push) + entry[1].append(('B', 'bookmark', [], + _("bookmark to export"))) + entry = extensions.wrapcommand(commands.table, 'incoming', incoming) + entry[1].append(('B', 'bookmarks', False, + _("compare bookmark"))) + entry = extensions.wrapcommand(commands.table, 'outgoing', outgoing) + entry[1].append(('B', 'bookmarks', False, + _("compare bookmark"))) + + pushkey.register('bookmarks', pushbookmark, listbookmarks) + def updatecurbookmark(orig, ui, repo, *args, **opts): '''Set the current bookmark @@ -327,8 +522,10 @@ "bookmarks": (bookmark, [('f', 'force', False, _('force')), - ('r', 'rev', '', _('revision')), + ('r', 'rev', '', _('revision'), _('REV')), ('d', 'delete', False, _('delete a given bookmark')), - ('m', 'rename', '', _('rename a given bookmark'))], + ('m', 'rename', '', _('rename a given bookmark'), _('NAME'))], _('hg bookmarks [-f] [-d] [-m NAME] [-r REV] [NAME]')), } + +colortable = {'bookmarks.current': 'green'} diff -Nru mercurial-1.5.4/hgext/children.py mercurial-1.6/hgext/children.py --- mercurial-1.5.4/hgext/children.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/children.py 2010-07-01 18:06:26.000000000 +0100 @@ -38,7 +38,8 @@ cmdtable = { "children": (children, - [('r', 'rev', '', _('show children of the specified revision')), + [('r', 'rev', '', + _('show children of the specified revision'), _('REV')), ] + templateopts, _('hg children [-r REV] [FILE]')), } diff -Nru mercurial-1.5.4/hgext/churn.py mercurial-1.6/hgext/churn.py --- mercurial-1.5.4/hgext/churn.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/churn.py 2010-07-01 18:06:26.000000000 +0100 @@ -9,8 +9,8 @@ '''command to display statistics about repository history''' from mercurial.i18n import _ -from mercurial import patch, cmdutil, util, templater -import sys, os +from mercurial import patch, cmdutil, util, templater, commands +import os import time, datetime def maketemplater(ui, repo, tmpl): @@ -48,7 +48,7 @@ tmpl.show(ctx) return ui.popbuffer() - state = {'count': 0, 'pct': 0} + state = {'count': 0} rate = {} df = False if opts.get('date'): @@ -74,20 +74,13 @@ lines = changedlines(ui, repo, ctx1, ctx, fns) rate[key] = [r + l for r, l in zip(rate.get(key, (0, 0)), lines)] - if opts.get('progress'): - state['count'] += 1 - newpct = int(100.0 * state['count'] / max(len(repo), 1)) - if state['pct'] < newpct: - state['pct'] = newpct - ui.write("\r" + _("generating stats: %d%%") % state['pct']) - sys.stdout.flush() + state['count'] += 1 + ui.progress(_('analyzing'), state['count'], total=len(repo)) for ctx in cmdutil.walkchangerevs(repo, m, opts, prep): continue - if opts.get('progress'): - ui.write("\r") - sys.stdout.flush() + ui.progress(_('analyzing'), None) return rate @@ -122,7 +115,7 @@ It is possible to map alternate email addresses to a main address by providing a file using the following format:: - + = Such a file may be specified with the --aliases option, otherwise a .hgchurn file will be looked for in the working directory root. @@ -136,9 +129,8 @@ aliases = repo.wjoin('.hgchurn') if aliases: for l in open(aliases, "r"): - l = l.strip() - alias, actual = l.split() - amap[alias] = actual + alias, actual = l.split('=' in l and '=' or None, 1) + amap[alias.strip()] = actual.strip() rate = countrate(ui, repo, amap, *pats, **opts).items() if not rate: @@ -160,8 +152,10 @@ def format(name, (added, removed)): return "%s %15s %s%s\n" % (pad(name, maxname), '+%d/-%d' % (added, removed), - '+' * charnum(added), - '-' * charnum(removed)) + ui.label('+' * charnum(added), + 'diffstat.inserted'), + ui.label('-' * charnum(removed), + 'diffstat.deleted')) else: width -= 6 def format(name, count): @@ -178,16 +172,19 @@ cmdtable = { "churn": (churn, - [('r', 'rev', [], _('count rate for the specified revision or range')), - ('d', 'date', '', _('count rate for revisions matching date spec')), + [('r', 'rev', [], + _('count rate for the specified revision or range'), _('REV')), + ('d', 'date', '', + _('count rate for revisions matching date spec'), _('DATE')), ('t', 'template', '{author|email}', - _('template to group changesets')), + _('template to group changesets'), _('TEMPLATE')), ('f', 'dateformat', '', - _('strftime-compatible format for grouping by date')), + _('strftime-compatible format for grouping by date'), _('FORMAT')), ('c', 'changesets', False, _('count rate by number of changesets')), ('s', 'sort', False, _('sort by key (default: sort by count)')), ('', 'diffstat', False, _('display added/removed lines separately')), - ('', 'aliases', '', _('file with email aliases')), - ('', 'progress', None, _('show progress'))], - _("hg churn [-d DATE] [-r REV] [--aliases FILE] [--progress] [FILE]")), + ('', 'aliases', '', + _('file with email aliases'), _('FILE')), + ] + commands.walkopts, + _("hg churn [-d DATE] [-r REV] [--aliases FILE] [FILE]")), } diff -Nru mercurial-1.5.4/hgext/color.py mercurial-1.6/hgext/color.py --- mercurial-1.5.4/hgext/color.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/color.py 2010-07-01 18:06:26.000000000 +0100 @@ -61,317 +61,228 @@ resolve.resolved = green bold bookmarks.current = green + +The color extension will try to detect whether to use ANSI codes or +Win32 console APIs, unless it is made explicit:: + + [color] + mode = ansi + +Any value other than 'ansi', 'win32', or 'auto' will disable color. + ''' import os, sys -from mercurial import cmdutil, commands, extensions +from mercurial import commands, dispatch, extensions from mercurial.i18n import _ # start and stop parameters for effects -_effect_params = {'none': 0, - 'black': 30, - 'red': 31, - 'green': 32, - 'yellow': 33, - 'blue': 34, - 'magenta': 35, - 'cyan': 36, - 'white': 37, - 'bold': 1, - 'italic': 3, - 'underline': 4, - 'inverse': 7, - 'black_background': 40, - 'red_background': 41, - 'green_background': 42, - 'yellow_background': 43, - 'blue_background': 44, - 'purple_background': 45, - 'cyan_background': 46, - 'white_background': 47} +_effects = {'none': 0, 'black': 30, 'red': 31, 'green': 32, 'yellow': 33, + 'blue': 34, 'magenta': 35, 'cyan': 36, 'white': 37, 'bold': 1, + 'italic': 3, 'underline': 4, 'inverse': 7, + 'black_background': 40, 'red_background': 41, + 'green_background': 42, 'yellow_background': 43, + 'blue_background': 44, 'purple_background': 45, + 'cyan_background': 46, 'white_background': 47} + +_styles = {'grep.match': 'red bold', + 'diff.changed': 'white', + 'diff.deleted': 'red', + 'diff.diffline': 'bold', + 'diff.extended': 'cyan bold', + 'diff.file_a': 'red bold', + 'diff.file_b': 'green bold', + 'diff.hunk': 'magenta', + 'diff.inserted': 'green', + 'diff.trailingwhitespace': 'bold red_background', + 'diffstat.deleted': 'red', + 'diffstat.inserted': 'green', + 'log.changeset': 'yellow', + 'resolve.resolved': 'green bold', + 'resolve.unresolved': 'red bold', + 'status.added': 'green bold', + 'status.clean': 'none', + 'status.copied': 'none', + 'status.deleted': 'cyan bold underline', + 'status.ignored': 'black bold', + 'status.modified': 'blue bold', + 'status.removed': 'red bold', + 'status.unknown': 'magenta bold underline'} + def render_effects(text, effects): 'Wrap text in commands to turn on each effect.' - start = [str(_effect_params[e]) for e in ['none'] + effects] + if not text: + return text + start = [str(_effects[e]) for e in ['none'] + effects.split()] start = '\033[' + ';'.join(start) + 'm' - stop = '\033[' + str(_effect_params['none']) + 'm' + stop = '\033[' + str(_effects['none']) + 'm' return ''.join([start, text, stop]) -def _colorstatuslike(abbreviations, effectdefs, orig, ui, repo, *pats, **opts): - '''run a status-like command with colorized output''' - delimiter = opts.get('print0') and '\0' or '\n' - - nostatus = opts.get('no_status') - opts['no_status'] = False - # run original command and capture its output - ui.pushbuffer() - retval = orig(ui, repo, *pats, **opts) - # filter out empty strings - lines_with_status = [line for line in ui.popbuffer().split(delimiter) if line] +def extstyles(): + for name, ext in extensions.extensions(): + _styles.update(getattr(ext, 'colortable', {})) + +def configstyles(ui): + for status, cfgeffects in ui.configitems('color'): + if '.' not in status: + continue + cfgeffects = ui.configlist('color', status) + if cfgeffects: + good = [] + for e in cfgeffects: + if e in _effects: + good.append(e) + else: + ui.warn(_("ignoring unknown color/effect %r " + "(configured in color.%s)\n") + % (e, status)) + _styles[status] = ' '.join(good) - if nostatus: - lines = [l[2:] for l in lines_with_status] +_buffers = None +def style(msg, label): + effects = [] + for l in label.split(): + s = _styles.get(l, '') + if s: + effects.append(s) + effects = ''.join(effects) + if effects: + return '\n'.join([render_effects(s, effects) + for s in msg.split('\n')]) + return msg + +def popbuffer(orig, labeled=False): + global _buffers + if labeled: + return ''.join(style(a, label) for a, label in _buffers.pop()) + return ''.join(a for a, label in _buffers.pop()) + +mode = 'ansi' +def write(orig, *args, **opts): + label = opts.get('label', '') + global _buffers + if _buffers: + _buffers[-1].extend([(str(a), label) for a in args]) + elif mode == 'win32': + for a in args: + win32print(a, orig, **opts) else: - lines = lines_with_status - - # apply color to output and display it - for i in xrange(len(lines)): - try: - status = abbreviations[lines_with_status[i][0]] - except KeyError: - # Ignore lines with invalid codes, especially in the case of - # of unknown filenames containing newlines (issue2036). - pass - else: - effects = effectdefs[status] - if effects: - lines[i] = render_effects(lines[i], effects) - ui.write(lines[i] + delimiter) - return retval - - -_status_abbreviations = { 'M': 'modified', - 'A': 'added', - 'R': 'removed', - '!': 'deleted', - '?': 'unknown', - 'I': 'ignored', - 'C': 'clean', - ' ': 'copied', } - -_status_effects = { 'modified': ['blue', 'bold'], - 'added': ['green', 'bold'], - 'removed': ['red', 'bold'], - 'deleted': ['cyan', 'bold', 'underline'], - 'unknown': ['magenta', 'bold', 'underline'], - 'ignored': ['black', 'bold'], - 'clean': ['none'], - 'copied': ['none'], } - -def colorstatus(orig, ui, repo, *pats, **opts): - '''run the status command with colored output''' - return _colorstatuslike(_status_abbreviations, _status_effects, - orig, ui, repo, *pats, **opts) - - -_resolve_abbreviations = { 'U': 'unresolved', - 'R': 'resolved', } - -_resolve_effects = { 'unresolved': ['red', 'bold'], - 'resolved': ['green', 'bold'], } - -def colorresolve(orig, ui, repo, *pats, **opts): - '''run the resolve command with colored output''' - if not opts.get('list'): - # only colorize for resolve -l - return orig(ui, repo, *pats, **opts) - return _colorstatuslike(_resolve_abbreviations, _resolve_effects, - orig, ui, repo, *pats, **opts) - - -_bookmark_effects = { 'current': ['green'] } - -def colorbookmarks(orig, ui, repo, *pats, **opts): - def colorize(orig, s): - lines = s.split('\n') - for i, line in enumerate(lines): - if line.startswith(" *"): - lines[i] = render_effects(line, _bookmark_effects['current']) - orig('\n'.join(lines)) - oldwrite = extensions.wrapfunction(ui, 'write', colorize) - try: - orig(ui, repo, *pats, **opts) - finally: - ui.write = oldwrite - -def colorqseries(orig, ui, repo, *dummy, **opts): - '''run the qseries command with colored output''' - ui.pushbuffer() - retval = orig(ui, repo, **opts) - patchlines = ui.popbuffer().splitlines() - patchnames = repo.mq.series - - for patch, patchname in zip(patchlines, patchnames): - if opts['missing']: - effects = _patch_effects['missing'] - # Determine if patch is applied. - elif [applied for applied in repo.mq.applied - if patchname == applied.name]: - effects = _patch_effects['applied'] - else: - effects = _patch_effects['unapplied'] + return orig(*[style(str(a), label) for a in args], **opts) - patch = patch.replace(patchname, render_effects(patchname, effects), 1) - ui.write(patch + '\n') - return retval - -_patch_effects = { 'applied': ['blue', 'bold', 'underline'], - 'missing': ['red', 'bold'], - 'unapplied': ['black', 'bold'], } -def colorwrap(orig, *args): - '''wrap ui.write for colored diff output''' - def _colorize(s): - lines = s.split('\n') - for i, line in enumerate(lines): - stripline = line - if line and line[0] in '+-': - # highlight trailing whitespace, but only in changed lines - stripline = line.rstrip() - for prefix, style in _diff_prefixes: - if stripline.startswith(prefix): - lines[i] = render_effects(stripline, _diff_effects[style]) - break - if line != stripline: - lines[i] += render_effects( - line[len(stripline):], _diff_effects['trailingwhitespace']) - return '\n'.join(lines) - orig(*[_colorize(s) for s in args]) - -def colorshowpatch(orig, self, node): - '''wrap cmdutil.changeset_printer.showpatch with colored output''' - oldwrite = extensions.wrapfunction(self.ui, 'write', colorwrap) - try: - orig(self, node) - finally: - self.ui.write = oldwrite - -def colordiffstat(orig, s): - lines = s.split('\n') - for i, line in enumerate(lines): - if line and line[-1] in '+-': - name, graph = line.rsplit(' ', 1) - graph = graph.replace('-', - render_effects('-', _diff_effects['deleted'])) - graph = graph.replace('+', - render_effects('+', _diff_effects['inserted'])) - lines[i] = ' '.join([name, graph]) - orig('\n'.join(lines)) - -def colordiff(orig, ui, repo, *pats, **opts): - '''run the diff command with colored output''' - if opts.get('stat'): - wrapper = colordiffstat +def write_err(orig, *args, **opts): + label = opts.get('label', '') + if mode == 'win32': + for a in args: + win32print(a, orig, **opts) else: - wrapper = colorwrap - oldwrite = extensions.wrapfunction(ui, 'write', wrapper) - try: - orig(ui, repo, *pats, **opts) - finally: - ui.write = oldwrite - -def colorchurn(orig, ui, repo, *pats, **opts): - '''run the churn command with colored output''' - if not opts.get('diffstat'): - return orig(ui, repo, *pats, **opts) - oldwrite = extensions.wrapfunction(ui, 'write', colordiffstat) - try: - orig(ui, repo, *pats, **opts) - finally: - ui.write = oldwrite - -_diff_prefixes = [('diff', 'diffline'), - ('copy', 'extended'), - ('rename', 'extended'), - ('old', 'extended'), - ('new', 'extended'), - ('deleted', 'extended'), - ('---', 'file_a'), - ('+++', 'file_b'), - ('@', 'hunk'), - ('-', 'deleted'), - ('+', 'inserted')] - -_diff_effects = {'diffline': ['bold'], - 'extended': ['cyan', 'bold'], - 'file_a': ['red', 'bold'], - 'file_b': ['green', 'bold'], - 'hunk': ['magenta'], - 'deleted': ['red'], - 'inserted': ['green'], - 'changed': ['white'], - 'trailingwhitespace': ['bold', 'red_background']} - -def extsetup(ui): - '''Initialize the extension.''' - _setupcmd(ui, 'diff', commands.table, colordiff, _diff_effects) - _setupcmd(ui, 'incoming', commands.table, None, _diff_effects) - _setupcmd(ui, 'log', commands.table, None, _diff_effects) - _setupcmd(ui, 'outgoing', commands.table, None, _diff_effects) - _setupcmd(ui, 'tip', commands.table, None, _diff_effects) - _setupcmd(ui, 'status', commands.table, colorstatus, _status_effects) - _setupcmd(ui, 'resolve', commands.table, colorresolve, _resolve_effects) + return orig(*[style(str(a), label) for a in args], **opts) - try: - mq = extensions.find('mq') - _setupcmd(ui, 'qdiff', mq.cmdtable, colordiff, _diff_effects) - _setupcmd(ui, 'qseries', mq.cmdtable, colorqseries, _patch_effects) - except KeyError: - mq = None - - try: - rec = extensions.find('record') - _setupcmd(ui, 'record', rec.cmdtable, colordiff, _diff_effects) - except KeyError: - rec = None +def uisetup(ui): + if ui.plain(): + return + global mode + mode = ui.config('color', 'mode', 'auto') + if mode == 'auto': + if os.name == 'nt' and 'TERM' not in os.environ: + # looks line a cmd.exe console, use win32 API or nothing + mode = w32effects and 'win32' or 'none' + else: + mode = 'ansi' + if mode == 'win32': + if w32effects is None: + # only warn if color.mode is explicitly set to win32 + ui.warn(_('win32console not found, please install pywin32\n')) + return + _effects.update(w32effects) + elif mode != 'ansi': + return + def colorcmd(orig, ui_, opts, cmd, cmdfunc): + if (opts['color'] == 'always' or + (opts['color'] == 'auto' and (os.environ.get('TERM') != 'dumb' + and ui_.formatted()))): + global _buffers + _buffers = ui_._buffers + extensions.wrapfunction(ui_, 'popbuffer', popbuffer) + extensions.wrapfunction(ui_, 'write', write) + extensions.wrapfunction(ui_, 'write_err', write_err) + ui_.label = style + extstyles() + configstyles(ui) + return orig(ui_, opts, cmd, cmdfunc) + extensions.wrapfunction(dispatch, '_runcommand', colorcmd) + +commands.globalopts.append(('', 'color', 'auto', + _("when to colorize (always, auto, or never)"), + _('TYPE'))) + +try: + import re, pywintypes + from win32console import * + + # http://msdn.microsoft.com/en-us/library/ms682088%28VS.85%29.aspx + w32effects = { + 'none': 0, + 'black': 0, + 'red': FOREGROUND_RED, + 'green': FOREGROUND_GREEN, + 'yellow': FOREGROUND_RED | FOREGROUND_GREEN, + 'blue': FOREGROUND_BLUE, + 'magenta': FOREGROUND_BLUE | FOREGROUND_RED, + 'cyan': FOREGROUND_BLUE | FOREGROUND_GREEN, + 'white': FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE, + 'bold': FOREGROUND_INTENSITY, + 'black_background': 0, + 'red_background': BACKGROUND_RED, + 'green_background': BACKGROUND_GREEN, + 'yellow_background': BACKGROUND_RED | BACKGROUND_GREEN, + 'blue_background': BACKGROUND_BLUE, + 'purple_background': BACKGROUND_BLUE | BACKGROUND_RED, + 'cyan_background': BACKGROUND_BLUE | BACKGROUND_GREEN, + 'white_background': BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE, + 'bold_background': BACKGROUND_INTENSITY, + 'underline': COMMON_LVB_UNDERSCORE, # double-byte charsets only + 'inverse': COMMON_LVB_REVERSE_VIDEO, # double-byte charsets only + } + + stdout = GetStdHandle(STD_OUTPUT_HANDLE) + try: + origattr = stdout.GetConsoleScreenBufferInfo()['Attributes'] + except pywintypes.error: + # stdout may be defined but not support + # GetConsoleScreenBufferInfo(), when called from subprocess or + # redirected. + raise ImportError() + ansire = re.compile('\033\[([^m]*)m([^\033]*)(.*)', re.MULTILINE | re.DOTALL) + + def win32print(text, orig, **opts): + label = opts.get('label', '') + attr = 0 + + # determine console attributes based on labels + for l in label.split(): + style = _styles.get(l, '') + for effect in style.split(): + attr |= w32effects[effect] + + # hack to ensure regexp finds data + if not text.startswith('\033['): + text = '\033[m' + text + + # Look for ANSI-like codes embedded in text + m = re.match(ansire, text) + while m: + for sattr in m.group(1).split(';'): + if sattr: + val = int(sattr) + attr = val and attr|val or 0 + stdout.SetConsoleTextAttribute(attr or origattr) + orig(m.group(2), **opts) + m = re.match(ansire, m.group(3)) - if mq and rec: - _setupcmd(ui, 'qrecord', rec.cmdtable, colordiff, _diff_effects) - try: - churn = extensions.find('churn') - _setupcmd(ui, 'churn', churn.cmdtable, colorchurn, _diff_effects) - except KeyError: - churn = None + # Explicity reset original attributes + stdout.SetConsoleTextAttribute(origattr) - try: - bookmarks = extensions.find('bookmarks') - _setupcmd(ui, 'bookmarks', bookmarks.cmdtable, colorbookmarks, - _bookmark_effects) - except KeyError: - # The bookmarks extension is not enabled - pass - -def _setupcmd(ui, cmd, table, func, effectsmap): - '''patch in command to command table and load effect map''' - # check isatty() before anything else changes it (like pager) - isatty = sys.__stdout__.isatty() - - def nocolor(orig, *args, **opts): - - if (opts['no_color'] or opts['color'] == 'never' or - (opts['color'] == 'auto' and (os.environ.get('TERM') == 'dumb' - or not isatty))): - del opts['no_color'] - del opts['color'] - return orig(*args, **opts) - - oldshowpatch = extensions.wrapfunction(cmdutil.changeset_printer, - 'showpatch', colorshowpatch) - del opts['no_color'] - del opts['color'] - try: - if func is not None: - return func(orig, *args, **opts) - return orig(*args, **opts) - finally: - cmdutil.changeset_printer.showpatch = oldshowpatch - - entry = extensions.wrapcommand(table, cmd, nocolor) - entry[1].extend([ - ('', 'color', 'auto', _("when to colorize (always, auto, or never)")), - ('', 'no-color', None, _("don't colorize output (DEPRECATED)")), - ]) - - for status in effectsmap: - configkey = cmd + '.' + status - effects = ui.configlist('color', configkey) - if effects: - good = [] - for e in effects: - if e in _effect_params: - good.append(e) - else: - ui.warn(_("ignoring unknown color/effect %r " - "(configured in color.%s)\n") - % (e, configkey)) - effectsmap[status] = good +except ImportError: + w32effects = None diff -Nru mercurial-1.5.4/hgext/convert/bzr.py mercurial-1.6/hgext/convert/bzr.py --- mercurial-1.5.4/hgext/convert/bzr.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/convert/bzr.py 2010-07-01 18:06:26.000000000 +0100 @@ -109,18 +109,16 @@ # the file is not available anymore - was deleted raise IOError(_('%s is not available in %s anymore') % (name, rev)) + mode = self._modecache[(name, rev)] if kind == 'symlink': target = revtree.get_symlink_target(fileid) if target is None: raise util.Abort(_('%s.%s symlink has no target') % (name, rev)) - return target + return target, mode else: sio = revtree.get_file(fileid) - return sio.read() - - def getmode(self, name, rev): - return self._modecache[(name, rev)] + return sio.read(), mode def getchanges(self, version): # set up caches: modecache and revtree diff -Nru mercurial-1.5.4/hgext/convert/common.py mercurial-1.6/hgext/convert/common.py --- mercurial-1.5.4/hgext/convert/common.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/convert/common.py 2010-07-01 18:06:26.000000000 +0100 @@ -77,15 +77,10 @@ raise NotImplementedError() def getfile(self, name, rev): - """Return file contents as a string. rev is the identifier returned - by a previous call to getchanges(). Raise IOError to indicate that - name was deleted in rev. - """ - raise NotImplementedError() - - def getmode(self, name, rev): - """Return file mode, eg. '', 'x', or 'l'. rev is the identifier - returned by a previous call to getchanges(). + """Return a pair (data, mode) where data is the file content + as a string and mode one of '', 'x' or 'l'. rev is the + identifier returned by a previous call to getchanges(). Raise + IOError to indicate that name was deleted in rev. """ raise NotImplementedError() @@ -192,8 +187,8 @@ changeset. 'files' is a list of (path, version) tuples, 'copies' is a dictionary mapping destinations to sources, 'source' is the source repository, and 'revmap' is a mapfile - of source revisions to converted revisions. Only getfile(), - getmode(), and lookuprev() should be called on 'source'. + of source revisions to converted revisions. Only getfile() and + lookuprev() should be called on 'source'. Note that the sink repository is not told to update itself to a particular revision (or even what that revision would be) diff -Nru mercurial-1.5.4/hgext/convert/convcmd.py mercurial-1.6/hgext/convert/convcmd.py --- mercurial-1.5.4/hgext/convert/convcmd.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/convert/convcmd.py 2010-07-01 18:06:26.000000000 +0100 @@ -72,6 +72,25 @@ ui.note(_("convert: %s\n") % inst) raise util.Abort(_('%s: unknown repository type') % path) +class progresssource(object): + def __init__(self, ui, source, filecount): + self.ui = ui + self.source = source + self.filecount = filecount + self.retrieved = 0 + + def getfile(self, file, rev): + self.retrieved += 1 + self.ui.progress(_('retrieving file'), self.retrieved, + item=file, total=self.filecount) + return self.source.getfile(file, rev) + + def lookuprev(self, rev): + return self.source.lookuprev(rev) + + def close(self): + self.ui.progress(_('retrieving file'), None) + class converter(object): def __init__(self, ui, source, dest, revmapfile, opts): @@ -111,11 +130,13 @@ if n in known or n in self.map: continue known.add(n) + self.ui.progress(_('scanning'), len(known), unit=_('revisions')) commit = self.cachecommit(n) parents[n] = [] for p in commit.parents: parents[n].append(p) visit.append(p) + self.ui.progress(_('scanning'), None) return parents @@ -302,8 +323,10 @@ parents = [self.map.get(p, p) for p in parents] except KeyError: parents = [b[0] for b in pbranches] + source = progresssource(self.ui, self.source, len(files)) newnode = self.dest.putcommit(files, copies, parents, commit, - self.source, self.map) + source, self.map) + source.close() self.source.converted(rev, newnode) self.map[rev] = newnode @@ -321,7 +344,7 @@ c = None self.ui.status(_("converting...\n")) - for c in t: + for i, c in enumerate(t): num -= 1 desc = self.commitcache[c].desc if "\n" in desc: @@ -331,7 +354,10 @@ # 'utf-8' self.ui.status("%d %s\n" % (num, recode(desc))) self.ui.note(_("source: %s\n") % recode(c)) + self.ui.progress(_('converting'), i, unit=_('revisions'), + total=len(t)) self.copy(c) + self.ui.progress(_('converting'), None) tags = self.source.gettags() ctags = {} diff -Nru mercurial-1.5.4/hgext/convert/cvsps.py mercurial-1.6/hgext/convert/cvsps.py --- mercurial-1.5.4/hgext/convert/cvsps.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/convert/cvsps.py 2010-07-01 18:06:27.000000000 +0100 @@ -239,12 +239,12 @@ continue match = re_01.match(line) if match: - raise Exception(match.group(1)) + raise logerror(match.group(1)) match = re_02.match(line) if match: - raise Exception(match.group(2)) + raise logerror(match.group(2)) if re_03.match(line): - raise Exception(line) + raise logerror(line) elif state == 1: # expect 'Working file' (only when using log instead of rlog) diff -Nru mercurial-1.5.4/hgext/convert/cvs.py mercurial-1.6/hgext/convert/cvs.py --- mercurial-1.5.4/hgext/convert/cvs.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/convert/cvs.py 2010-07-01 18:06:27.000000000 +0100 @@ -200,7 +200,7 @@ self._parse() return self.heads - def _getfile(self, name, rev): + def getfile(self, name, rev): def chunkedread(fp, count): # file-objects returned by socked.makefile() do not handle @@ -216,6 +216,7 @@ output.write(data) return output.getvalue() + self._parse() if rev.endswith("(DEAD)"): raise IOError @@ -255,18 +256,8 @@ else: raise util.Abort(_("unknown CVS response: %s") % line) - def getfile(self, file, rev): - self._parse() - data, mode = self._getfile(file, rev) - self.modecache[(file, rev)] = mode - return data - - def getmode(self, file, rev): - return self.modecache[(file, rev)] - def getchanges(self, rev): self._parse() - self.modecache = {} return sorted(self.files[rev].iteritems()), {} def getcommit(self, rev): diff -Nru mercurial-1.5.4/hgext/convert/darcs.py mercurial-1.6/hgext/convert/darcs.py --- mercurial-1.5.4/hgext/convert/darcs.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/convert/darcs.py 2010-07-01 18:06:27.000000000 +0100 @@ -157,11 +157,11 @@ def getfile(self, name, rev): if rev != self.lastrev: raise util.Abort(_('internal calling inconsistency')) - return open(os.path.join(self.tmppath, name), 'rb').read() - - def getmode(self, name, rev): - mode = os.lstat(os.path.join(self.tmppath, name)).st_mode - return (mode & 0111) and 'x' or '' + path = os.path.join(self.tmppath, name) + data = open(path, 'rb').read() + mode = os.lstat(path).st_mode + mode = (mode & 0111) and 'x' or '' + return data, mode def gettags(self): return self.tags diff -Nru mercurial-1.5.4/hgext/convert/filemap.py mercurial-1.6/hgext/convert/filemap.py --- mercurial-1.5.4/hgext/convert/filemap.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/convert/filemap.py 2010-07-01 18:06:27.000000000 +0100 @@ -100,8 +100,7 @@ # # - Filter and rename files. This is mostly wrapped by the filemapper # class above. We hide the original filename in the revision that is -# returned by getchanges to be able to find things later in getfile -# and getmode. +# returned by getchanges to be able to find things later in getfile. # # - Return only revisions that matter for the files we're interested in. # This involves rewriting the parents of the original revision to @@ -318,10 +317,9 @@ self.convertedorder.append((rev, True, None)) self._discard(*parents) - # Get the real changes and do the filtering/mapping. - # To be able to get the files later on in getfile and getmode, - # we hide the original filename in the rev part of the return - # value. + # Get the real changes and do the filtering/mapping. To be + # able to get the files later on in getfile, we hide the + # original filename in the rev part of the return value. changes, copies = self.base.getchanges(rev) newnames = {} files = [] @@ -345,10 +343,6 @@ realname, realrev = rev return self.base.getfile(realname, realrev) - def getmode(self, name, rev): - realname, realrev = rev - return self.base.getmode(realname, realrev) - def gettags(self): return self.base.gettags() diff -Nru mercurial-1.5.4/hgext/convert/git.py mercurial-1.6/hgext/convert/git.py --- mercurial-1.5.4/hgext/convert/git.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/convert/git.py 2010-07-01 18:06:27.000000000 +0100 @@ -67,10 +67,9 @@ return data def getfile(self, name, rev): - return self.catfile(rev, "blob") - - def getmode(self, name, rev): - return self.modecache[(name, rev)] + data = self.catfile(rev, "blob") + mode = self.modecache[(name, rev)] + return data, mode def getchanges(self, version): self.modecache = {} diff -Nru mercurial-1.5.4/hgext/convert/gnuarch.py mercurial-1.6/hgext/convert/gnuarch.py --- mercurial-1.5.4/hgext/convert/gnuarch.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/convert/gnuarch.py 2010-07-01 18:06:27.000000000 +0100 @@ -54,7 +54,6 @@ self.changes = {} self.parents = {} self.tags = {} - self.modecache = {} self.catlogparser = Parser() self.locale = locale.getpreferredencoding() self.archives = [] @@ -142,16 +141,9 @@ if not os.path.exists(os.path.join(self.tmppath, name)): raise IOError - data, mode = self._getfile(name, rev) - self.modecache[(name, rev)] = mode - - return data - - def getmode(self, name, rev): - return self.modecache[(name, rev)] + return self._getfile(name, rev) def getchanges(self, rev): - self.modecache = {} self._update(rev) changes = [] copies = {} diff -Nru mercurial-1.5.4/hgext/convert/hg.py mercurial-1.6/hgext/convert/hg.py --- mercurial-1.5.4/hgext/convert/hg.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/convert/hg.py 2010-07-01 18:06:27.000000000 +0100 @@ -134,11 +134,11 @@ files = dict(files) def getfilectx(repo, memctx, f): v = files[f] - data = source.getfile(f, v) - e = source.getmode(f, v) + data, mode = source.getfile(f, v) if f == '.hgtags': data = self._rewritetags(source, revmap, data) - return context.memfilectx(f, data, 'l' in e, 'x' in e, copies.get(f)) + return context.memfilectx(f, data, 'l' in mode, 'x' in mode, + copies.get(f)) pl = [] for p in parents: @@ -266,13 +266,11 @@ def getfile(self, name, rev): try: - return self.changectx(rev)[name].data() + fctx = self.changectx(rev)[name] + return fctx.data(), fctx.flags() except error.LookupError, err: raise IOError(err) - def getmode(self, name, rev): - return self.changectx(rev).manifest().flags(name) - def getchanges(self, rev): ctx = self.changectx(rev) parents = self.parents(ctx) diff -Nru mercurial-1.5.4/hgext/convert/__init__.py mercurial-1.6/hgext/convert/__init__.py --- mercurial-1.5.4/hgext/convert/__init__.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/convert/__init__.py 2010-07-01 18:06:26.000000000 +0100 @@ -258,13 +258,20 @@ cmdtable = { "convert": (convert, - [('A', 'authors', '', _('username mapping filename')), - ('d', 'dest-type', '', _('destination repository type')), - ('', 'filemap', '', _('remap file names using contents of file')), - ('r', 'rev', '', _('import up to target revision REV')), - ('s', 'source-type', '', _('source repository type')), - ('', 'splicemap', '', _('splice synthesized history into place')), - ('', 'branchmap', '', _('change branch names while converting')), + [('A', 'authors', '', + _('username mapping filename'), _('FILE')), + ('d', 'dest-type', '', + _('destination repository type'), _('TYPE')), + ('', 'filemap', '', + _('remap file names using contents of file'), _('FILE')), + ('r', 'rev', '', + _('import up to target revision REV'), _('REV')), + ('s', 'source-type', '', + _('source repository type'), _('TYPE')), + ('', 'splicemap', '', + _('splice synthesized history into place'), _('FILE')), + ('', 'branchmap', '', + _('change branch names while converting'), _('FILE')), ('', 'branchsort', None, _('try to sort changesets by branches')), ('', 'datesort', None, _('try to sort changesets by date')), ('', 'sourcesort', None, _('preserve source changesets order'))], diff -Nru mercurial-1.5.4/hgext/convert/monotone.py mercurial-1.6/hgext/convert/monotone.py --- mercurial-1.5.4/hgext/convert/monotone.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/convert/monotone.py 2010-07-01 18:06:27.000000000 +0100 @@ -192,18 +192,16 @@ return (files.items(), copies) - def getmode(self, name, rev): - self.mtnloadmanifest(rev) - node, attr = self.files.get(name, (None, "")) - return attr - def getfile(self, name, rev): if not self.mtnisfile(name, rev): raise IOError() # file was deleted or renamed try: - return self.mtnrun("get_file_of", name, r=rev) + data = self.mtnrun("get_file_of", name, r=rev) except: raise IOError() # file was deleted or renamed + self.mtnloadmanifest(rev) + node, attr = self.files.get(name, (None, "")) + return data, attr def getcommit(self, rev): certs = self.mtngetcerts(rev) diff -Nru mercurial-1.5.4/hgext/convert/p4.py mercurial-1.6/hgext/convert/p4.py --- mercurial-1.5.4/hgext/convert/p4.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/convert/p4.py 2010-07-01 18:06:27.000000000 +0100 @@ -41,7 +41,6 @@ self.parent = {} self.encoding = "latin_1" self.depotname = {} # mapping from local name to depot name - self.modecache = {} self.re_type = re.compile( "([a-z]+)?(text|binary|symlink|apple|resource|unicode|utf\d+)" "(\+\w+)?$") @@ -54,7 +53,7 @@ def _parse_view(self, path): "Read changes affecting the path" - cmd = 'p4 -G changes -s submitted "%s"' % path + cmd = 'p4 -G changes -s submitted %s' % util.shellquote(path) stdout = util.popen(cmd, mode='rb') for d in loaditer(stdout): c = d.get("change", None) @@ -73,7 +72,7 @@ else: views = {"//": ""} else: - cmd = 'p4 -G client -o "%s"' % path + cmd = 'p4 -G client -o %s' % util.shellquote(path) clientspec = marshal.load(util.popen(cmd, mode='rb')) views = {} @@ -149,7 +148,8 @@ return self.heads def getfile(self, name, rev): - cmd = 'p4 -G print "%s#%s"' % (self.depotname[name], rev) + cmd = 'p4 -G print %s' \ + % util.shellquote("%s#%s" % (self.depotname[name], rev)) stdout = util.popen(cmd, mode='rb') mode = None @@ -183,17 +183,12 @@ if mode is None: raise IOError(0, "bad stat") - self.modecache[(name, rev)] = mode - if keywords: contents = keywords.sub("$\\1$", contents) if mode == "l" and contents.endswith("\n"): contents = contents[:-1] - return contents - - def getmode(self, name, rev): - return self.modecache[(name, rev)] + return contents, mode def getchanges(self, rev): return self.files[rev], {} diff -Nru mercurial-1.5.4/hgext/convert/subversion.py mercurial-1.6/hgext/convert/subversion.py --- mercurial-1.5.4/hgext/convert/subversion.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/convert/subversion.py 2010-07-01 18:06:27.000000000 +0100 @@ -371,19 +371,10 @@ return self.heads - def getfile(self, file, rev): - data, mode = self._getfile(file, rev) - self.modecache[(file, rev)] = mode - return data - - def getmode(self, file, rev): - return self.modecache[(file, rev)] - def getchanges(self, rev): if self._changescache and self._changescache[0] == rev: return self._changescache[1] self._changescache = None - self.modecache = {} (paths, parents) = self.paths[rev] if parents: files, self.removed, copies = self.expandpaths(rev, paths, parents) @@ -612,9 +603,6 @@ def expandpaths(self, rev, paths, parents): changed, removed = set(), set() - # Map of entrypath, revision for finding source of deleted - # revisions. - copyfrom = {} copies = {} new_module, revnum = self.revsplit(rev)[1:] @@ -622,7 +610,9 @@ self.module = new_module self.reparent(self.module) - for path, ent in paths: + for i, (path, ent) in enumerate(paths): + self.ui.progress(_('scanning paths'), i, item=path, + total=len(paths)) entrypath = self.getrelpath(path) kind = self._checkpath(entrypath, revnum) @@ -652,10 +642,10 @@ elif fromkind == svn.core.svn_node_dir: oroot = parentpath.strip('/') nroot = path.strip('/') - children = self._find_children(oroot, prevnum) - children = [s.replace(oroot, nroot) for s in children] - for child in children: - childpath = self.getrelpath("/" + child, pmodule) + children = self._iterfiles(oroot, prevnum) + for childpath in children: + childpath = childpath.replace(oroot, nroot) + childpath = self.getrelpath("/" + childpath, pmodule) if childpath: removed.add(self.recode(childpath)) else: @@ -674,18 +664,10 @@ if pkind == svn.core.svn_node_file: removed.add(self.recode(entrypath)) - children = sorted(self._find_children(path, revnum)) - for child in children: - # Can we move a child directory and its - # parent in the same commit? (probably can). Could - # cause problems if instead of revnum -1, - # we have to look in (copyfrom_path, revnum - 1) - entrypath = self.getrelpath("/" + child) - if entrypath: - # Need to filter out directories here... - kind = self._checkpath(entrypath, revnum) - if kind != svn.core.svn_node_dir: - changed.add(self.recode(entrypath)) + for childpath in self._iterfiles(path, revnum): + childpath = self.getrelpath("/" + childpath) + if childpath: + changed.add(self.recode(childpath)) # Handle directory copies if not ent.copyfrom_path or not parents: @@ -698,19 +680,18 @@ copyfrompath = self.getrelpath(ent.copyfrom_path, pmodule) if not copyfrompath: continue - copyfrom[path] = ent self.ui.debug("mark %s came from %s:%d\n" % (path, copyfrompath, ent.copyfrom_rev)) - children = self._find_children(ent.copyfrom_path, ent.copyfrom_rev) - children.sort() - for child in children: - entrypath = self.getrelpath("/" + child, pmodule) - if not entrypath: + children = self._iterfiles(ent.copyfrom_path, ent.copyfrom_rev) + for childpath in children: + childpath = self.getrelpath("/" + childpath, pmodule) + if not childpath: continue - copytopath = path + entrypath[len(copyfrompath):] + copytopath = path + childpath[len(copyfrompath):] copytopath = self.getrelpath(copytopath) - copies[self.recode(copytopath)] = self.recode(entrypath) + copies[self.recode(copytopath)] = self.recode(childpath) + self.ui.progress(_('scanning paths'), None) changed.update(removed) return (list(changed), removed, copies) @@ -839,10 +820,10 @@ raise util.Abort(_('svn: branch has no revision %s') % to_revnum) raise - def _getfile(self, file, rev): + def getfile(self, file, rev): # TODO: ra.get_file transmits the whole file instead of diffs. if file in self.removed: - raise IOError() + raise IOError() mode = '' try: new_module, revnum = self.revsplit(rev)[1:] @@ -871,12 +852,14 @@ data = data[len(link_prefix):] return data, mode - def _find_children(self, path, revnum): + def _iterfiles(self, path, revnum): + """Enumerate all files in path at revnum, recursively.""" path = path.strip('/') pool = Pool() rpath = '/'.join([self.baseurl, urllib.quote(path)]).strip('/') - return ['%s/%s' % (path, x) for x in - svn.client.ls(rpath, optrev(revnum), True, self.ctx, pool).keys()] + entries = svn.client.ls(rpath, optrev(revnum), True, self.ctx, pool) + return ((path + '/' + p) for p, e in entries.iteritems() + if e.kind == svn.core.svn_node_file) def getrelpath(self, path, module=None): if module is None: @@ -1111,12 +1094,11 @@ # Apply changes to working copy for f, v in files: try: - data = source.getfile(f, v) + data, mode = source.getfile(f, v) except IOError: self.delete.append(f) else: - e = source.getmode(f, v) - self.putfile(f, e, data) + self.putfile(f, mode, data) if f in copies: self.copies.append([copies[f], f]) files = [f[0] for f in files] diff -Nru mercurial-1.5.4/hgext/extdiff.py mercurial-1.6/hgext/extdiff.py --- mercurial-1.5.4/hgext/extdiff.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/extdiff.py 2010-07-01 18:06:27.000000000 +0100 @@ -14,7 +14,7 @@ files to compare. The extdiff extension also allows to configure new diff commands, so -you do not need to type "hg extdiff -p kdiff3" always. :: +you do not need to type :hg:`extdiff -p kdiff3` always. :: [extdiff] # add new command that runs GNU diff(1) in 'context diff' mode @@ -35,10 +35,28 @@ # your .vimrc vimdiff = gvim -f '+next' '+execute "DirDiff" argv(0) argv(1)' -You can use -I/-X and list of file or directory names like normal "hg -diff" 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). +Tool arguments can include variables that are expanded at runtime:: + + $parent1, $plabel1 - filename, descriptive label of first parent + $child, $clabel - filename, descriptive label of child revision + $parent2, $plabel2 - filename, descriptive label of second parent + $parent is an alias for $parent1. + +The extdiff extension will look in your [diff-tools] and [merge-tools] +sections for diff tool arguments, when none are specified in [extdiff]. + +:: + + [extdiff] + kdiff3 = + + [diff-tools] + kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child + +You can use -I/-X and list of file or directory names like normal +:hg:`diff` 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). ''' from mercurial.i18n import _ @@ -133,18 +151,23 @@ # Always make a copy of node1a (and node1b, if applicable) dir1a_files = mod_a | rem_a | ((mod_b | add_b) - add_a) dir1a = snapshot(ui, repo, dir1a_files, node1a, tmproot)[0] + rev1a = '@%d' % repo[node1a].rev() if do3way: dir1b_files = mod_b | rem_b | ((mod_a | add_a) - add_b) dir1b = snapshot(ui, repo, dir1b_files, node1b, tmproot)[0] + rev1b = '@%d' % repo[node1b].rev() else: dir1b = None + rev1b = '' fns_and_mtime = [] # If node2 in not the wc or there is >1 change, copy it dir2root = '' + rev2 = '' if node2: dir2 = snapshot(ui, repo, modadd, node2, tmproot)[0] + rev2 = '@%d' % repo[node2].rev() elif len(common) > 1: #we only actually need to get the files to copy back to #the working dir in this case (because the other cases @@ -156,23 +179,32 @@ dir2 = '' dir2root = repo.root + label1a = rev1a + label1b = rev1b + label2 = rev2 + # If only one change, diff the files instead of the directories # Handle bogus modifies correctly by checking if the files exist if len(common) == 1: common_file = util.localpath(common.pop()) dir1a = os.path.join(dir1a, common_file) + label1a = common_file + rev1a if not os.path.isfile(os.path.join(tmproot, dir1a)): dir1a = os.devnull if do3way: dir1b = os.path.join(dir1b, common_file) + label1b = common_file + rev1b if not os.path.isfile(os.path.join(tmproot, dir1b)): dir1b = os.devnull dir2 = os.path.join(dir2root, dir2, common_file) + label2 = common_file + rev2 # Function to quote file/dir names in the argument string. # When not operating in 3-way mode, an empty string is # returned for parent2 - replace = dict(parent=dir1a, parent1=dir1a, parent2=dir1b, child=dir2) + replace = dict(parent=dir1a, parent1=dir1a, parent2=dir1b, + plabel1=label1a, plabel2=label1b, + clabel=label2, child=dir2) def quote(match): key = match.group()[1:] if not do3way and key == 'parent2': @@ -180,7 +212,7 @@ return util.shellquote(replace[key]) # Match parent2 first, so 'parent1?' will match both parent1 and parent - regex = '\$(parent2|parent1?|child)' + regex = '\$(parent2|parent1?|child|plabel1|plabel2|clabel)' if not do3way and not re.search(regex, args): args += ' $parent1 $child' args = re.sub(regex, quote, args) @@ -227,10 +259,14 @@ cmdtable = { "extdiff": (extdiff, - [('p', 'program', '', _('comparison program to run')), - ('o', 'option', [], _('pass option to comparison program')), - ('r', 'rev', [], _('revision')), - ('c', 'change', '', _('change made by revision')), + [('p', 'program', '', + _('comparison program to run'), _('CMD')), + ('o', 'option', [], + _('pass option to comparison program'), _('OPT')), + ('r', 'rev', [], + _('revision'), _('REV')), + ('c', 'change', '', + _('change made by revision'), _('REV')), ] + commands.walkopts, _('hg extdiff [OPT]... [FILE]...')), } @@ -252,6 +288,12 @@ path = diffopts.pop(0) else: path, diffopts = cmd, [] + # look for diff arguments in [diff-tools] then [merge-tools] + if diffopts == []: + args = ui.config('diff-tools', cmd+'.diffargs') or \ + ui.config('merge-tools', cmd+'.diffargs') + if args: + diffopts = shlex.split(args) def save(cmd, path, diffopts): '''use closure to save diff command to use''' def mydiff(ui, repo, *pats, **opts): diff -Nru mercurial-1.5.4/hgext/fetch.py mercurial-1.6/hgext/fetch.py --- mercurial-1.5.4/hgext/fetch.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/fetch.py 2010-07-01 18:06:27.000000000 +0100 @@ -28,7 +28,7 @@ parent, with local changes as the second. To switch the merge order, use --switch-parent. - See 'hg help dates' for a list of formats valid for -d/--date. + See :hg:`help dates` for a list of formats valid for -d/--date. ''' date = opts.get('date') @@ -61,7 +61,7 @@ raise util.Abort(_('multiple heads in this branch ' '(use "hg heads ." and "hg merge" to merge)')) - other = hg.repository(cmdutil.remoteui(repo, opts), + other = hg.repository(hg.remoteui(repo, opts), ui.expandpath(source)) ui.status(_('pulling from %s\n') % url.hidepassword(ui.expandpath(source))) @@ -138,7 +138,8 @@ cmdtable = { 'fetch': (fetch, - [('r', 'rev', [], _('a specific revision you would like to pull')), + [('r', 'rev', [], + _('a specific revision you would like to pull'), _('REV')), ('e', 'edit', None, _('edit commit message')), ('', 'force-editor', None, _('edit commit message (DEPRECATED)')), ('', 'switch-parent', None, _('switch parents when merging')), diff -Nru mercurial-1.5.4/hgext/gpg.py mercurial-1.6/hgext/gpg.py --- mercurial-1.5.4/hgext/gpg.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/gpg.py 2010-07-01 18:06:27.000000000 +0100 @@ -197,7 +197,7 @@ If no revision is given, the parent of the working directory is used, or tip if no revision is checked out. - See 'hg help dates' for a list of formats valid for -d/--date. + See :hg:`help dates` for a list of formats valid for -d/--date. """ mygpg = newgpg(ui, **opts) @@ -247,7 +247,7 @@ repo.wfile(".hgsigs", "ab").write(sigmessage) if '.hgsigs' not in repo.dirstate: - repo.add([".hgsigs"]) + repo[None].add([".hgsigs"]) if opts["no_commit"]: return @@ -276,8 +276,10 @@ [('l', 'local', None, _('make the signature local')), ('f', 'force', None, _('sign even if the sigfile is modified')), ('', 'no-commit', None, _('do not commit the sigfile after signing')), - ('k', 'key', '', _('the key id to sign with')), - ('m', 'message', '', _('commit message')), + ('k', 'key', '', + _('the key id to sign with'), _('ID')), + ('m', 'message', '', + _('commit message'), _('TEXT')), ] + commands.commitopts2, _('hg sign [OPTION]... [REVISION]...')), "sigcheck": (check, [], _('hg sigcheck REVISION')), diff -Nru mercurial-1.5.4/hgext/graphlog.py mercurial-1.6/hgext/graphlog.py --- mercurial-1.5.4/hgext/graphlog.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/graphlog.py 2010-07-01 18:06:27.000000000 +0100 @@ -18,7 +18,7 @@ from mercurial.i18n import _ from mercurial.node import nullrev from mercurial import bundlerepo, changegroup, cmdutil, commands, extensions -from mercurial import hg, url, util, graphmod +from mercurial import hg, url, util, graphmod, discovery ASCIIDATA = 'ASC' @@ -209,6 +209,8 @@ def get_revs(repo, rev_opt): if rev_opt: revs = revrange(repo, rev_opt) + if len(revs) == 0: + return (nullrev, nullrev) return (max(revs), min(revs)) else: return (len(repo) - 1, 0) @@ -279,11 +281,11 @@ dest = ui.expandpath(dest or 'default-push', dest or 'default') dest, branches = hg.parseurl(dest, opts.get('branch')) revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get('rev')) - other = hg.repository(cmdutil.remoteui(ui, opts), dest) + other = hg.repository(hg.remoteui(ui, opts), dest) if revs: revs = [repo.lookup(rev) for rev in revs] ui.status(_('comparing with %s\n') % url.hidepassword(dest)) - o = repo.findoutgoing(other, force=opts.get('force')) + o = discovery.findoutgoing(repo, other, force=opts.get('force')) if not o: ui.status(_("no changes found\n")) return @@ -306,12 +308,13 @@ check_unsupported_flags(opts) source, branches = hg.parseurl(ui.expandpath(source), opts.get('branch')) - other = hg.repository(cmdutil.remoteui(repo, opts), source) + other = hg.repository(hg.remoteui(repo, opts), source) revs, checkout = hg.addbranchrevs(repo, other, branches, opts.get('rev')) ui.status(_('comparing with %s\n') % url.hidepassword(source)) if revs: revs = [other.lookup(rev) for rev in revs] - incoming = repo.findincoming(other, heads=revs, force=opts["force"]) + incoming = discovery.findincoming(repo, other, heads=revs, + force=opts["force"]) if not incoming: try: os.unlink(opts["bundle"]) @@ -369,9 +372,11 @@ cmdtable = { "glog": (graphlog, - [('l', 'limit', '', _('limit number of changes displayed')), + [('l', 'limit', '', + _('limit number of changes displayed'), _('NUM')), ('p', 'patch', False, _('show patch')), - ('r', 'rev', [], _('show the specified revision or range')), + ('r', 'rev', [], + _('show the specified revision or range'), _('REV')), ] + templateopts, _('hg glog [OPTION]... [FILE]')), } diff -Nru mercurial-1.5.4/hgext/hgcia.py mercurial-1.6/hgext/hgcia.py --- mercurial-1.5.4/hgext/hgcia.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/hgcia.py 2010-07-01 18:06:27.000000000 +0100 @@ -113,7 +113,7 @@ n = self.ctx.node() pbuf = patchbuf() - patch.export(self.cia.repo, [n], fp=pbuf) + cmdutil.export(self.cia.repo, [n], fp=pbuf) return patch.diffstat(pbuf.lines) or '' def logmsg(self): diff -Nru mercurial-1.5.4/hgext/hgk.py mercurial-1.6/hgext/hgk.py --- mercurial-1.5.4/hgext/hgk.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/hgk.py 2010-07-01 18:06:27.000000000 +0100 @@ -17,7 +17,7 @@ the contrib directory, and the extension is shipped in the hgext repository, and needs to be enabled. -The hg view command will launch the hgk Tcl script. For this command +The :hg:`view` 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 .hgrc file:: @@ -314,7 +314,8 @@ cmdtable = { "^view": (view, - [('l', 'limit', '', _('limit number of changes displayed'))], + [('l', 'limit', '', + _('limit number of changes displayed'), _('NUM'))], _('hg view [-l LIMIT] [REVRANGE]')), "debug-diff-tree": (difftree, diff -Nru mercurial-1.5.4/hgext/highlight/highlight.py mercurial-1.6/hgext/highlight/highlight.py --- mercurial-1.5.4/hgext/highlight/highlight.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/highlight/highlight.py 2010-07-01 18:06:27.000000000 +0100 @@ -23,7 +23,7 @@ def pygmentize(field, fctx, style, tmpl): # append a to the syntax highlighting css - old_header = ''.join(tmpl('header')) + old_header = tmpl.load('header') if SYNTAX_CSS not in old_header: new_header = old_header + SYNTAX_CSS tmpl.cache['header'] = new_header diff -Nru mercurial-1.5.4/hgext/inotify/__init__.py mercurial-1.6/hgext/inotify/__init__.py --- mercurial-1.5.4/hgext/inotify/__init__.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/inotify/__init__.py 2010-07-01 18:06:27.000000000 +0100 @@ -41,7 +41,7 @@ # to start an inotify server if it won't start. _inotifyon = True - def status(self, match, subrepos, ignored, clean, unknown=True): + def status(self, match, subrepos, ignored, clean, unknown): files = match.files() if '.' in files: files = [] @@ -79,8 +79,11 @@ '^inserve': (serve, [('d', 'daemon', None, _('run server in background')), - ('', 'daemon-pipefds', '', _('used internally by daemon mode')), - ('t', 'idle-timeout', '', _('minutes to sit idle before exiting')), - ('', 'pid-file', '', _('name of file to write process ID to'))], + ('', 'daemon-pipefds', '', + _('used internally by daemon mode'), _('NUM')), + ('t', 'idle-timeout', '', + _('minutes to sit idle before exiting'), _('NUM')), + ('', 'pid-file', '', + _('name of file to write process ID to'), _('FILE'))], _('hg inserve [OPTION]...')), } diff -Nru mercurial-1.5.4/hgext/keyword.py mercurial-1.6/hgext/keyword.py --- mercurial-1.5.4/hgext/keyword.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/keyword.py 2010-07-01 18:06:27.000000000 +0100 @@ -1,6 +1,6 @@ # keyword.py - $Keyword$ expansion for Mercurial # -# Copyright 2007-2009 Christian Ebert +# Copyright 2007-2010 Christian Ebert # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. @@ -35,8 +35,8 @@ change history. The mechanism can be regarded as a convenience for the current user or for archive distribution. -Configuration is done in the [keyword] and [keywordmaps] sections of -hgrc files. +Configuration is done in the [keyword], [keywordset] and [keywordmaps] +sections of hgrc files. Example:: @@ -45,31 +45,33 @@ **.py = x* = ignore + [keywordset] + # prefer svn- over cvs-like default keywordmaps + svn = True + NOTE: the more specific you are in your filename patterns the less you lose speed in huge repositories. For [keywordmaps] template mapping and expansion demonstration and -control run "hg kwdemo". See "hg help templates" for a list of +control run :hg:`kwdemo`. See :hg:`help templates` for a list of available templates and filters. -An additional date template filter {date|utcdate} is provided. It -returns a date like "2006/09/18 15:13:13". +Three additional date template filters are provided:: + + utcdate "2006/09/18 15:13:13" + svnutcdate "2006-09-18 15:13:13Z" + svnisodate "2006-09-18 08:13:13 -700 (Mon, 18 Sep 2006)" -The default template mappings (view with "hg kwdemo -d") can be -replaced with customized keywords and templates. Again, run "hg -kwdemo" to control the results of your config changes. +The default template mappings (view with :hg:`kwdemo -d`) can be +replaced with customized keywords and templates. Again, run +:hg:`kwdemo` to control the results of your config changes. -Before changing/disabling active keywords, run "hg kwshrink" to avoid +Before changing/disabling active keywords, run :hg:`kwshrink` to avoid the risk of inadvertently storing expanded keywords in the change history. To force expansion after enabling it, or a configuration change, run -"hg kwexpand". - -Also, when committing with the record extension or using mq's qrecord, -be aware that keywords cannot be updated. Again, run "hg kwexpand" on -the files in question to update keyword expansions after all changes -have been checked in. +:hg:`kwexpand`. Expansions spanning more than one line and incremental expansions, like CVS' $Log$, are not supported. A keyword template map "Log = @@ -79,8 +81,6 @@ from mercurial import commands, cmdutil, dispatch, filelog, revlog, extensions from mercurial import patch, localrepo, templater, templatefilters, util, match from mercurial.hgweb import webcommands -from mercurial.lock import release -from mercurial.node import nullid from mercurial.i18n import _ import re, shutil, tempfile @@ -93,24 +93,31 @@ # hg commands that trigger expansion only when writing to working dir, # not when reading filelog, and unexpand when reading from working dir -restricted = ('merge record resolve qfold qimport qnew qpush qrefresh qrecord' - ' transplant') +restricted = 'merge record qrecord resolve transplant' + +# commands using dorecord +recordcommands = 'record qrecord' +# names of extensions using dorecord +recordextensions = 'record' -# provide cvs-like UTC date filter +# date like in cvs' $Date utcdate = lambda x: util.datestr((x[0], 0), '%Y/%m/%d %H:%M:%S') +# date like in svn's $Date +svnisodate = lambda x: util.datestr(x, '%Y-%m-%d %H:%M:%S %1%2 (%a, %d %b %Y)') +# date like in svn's $Id +svnutcdate = lambda x: util.datestr((x[0], 0), '%Y-%m-%d %H:%M:%SZ') # make keyword tools accessible kwtools = {'templater': None, 'hgcmd': '', 'inc': [], 'exc': ['.hg*']} -class kwtemplater(object): - ''' - Sets up keyword templates, corresponding keyword regex, and - provides keyword substitution functions. - ''' +def _defaultkwmaps(ui): + '''Returns default keywordmaps according to keywordset configuration.''' templates = { 'Revision': '{node|short}', 'Author': '{author|user}', + } + kwsets = ({ 'Date': '{date|utcdate}', 'RCSfile': '{file|basename},v', 'RCSFile': '{file|basename},v', # kept for backwards compatibility @@ -118,7 +125,21 @@ 'Source': '{root}/{file},v', 'Id': '{file|basename},v {node|short} {date|utcdate} {author|user}', 'Header': '{root}/{file},v {node|short} {date|utcdate} {author|user}', - } + }, { + 'Date': '{date|svnisodate}', + 'Id': '{file|basename},v {node|short} {date|svnutcdate} {author|user}', + 'LastChangedRevision': '{node|short}', + 'LastChangedBy': '{author|user}', + 'LastChangedDate': '{date|svnisodate}', + }) + templates.update(kwsets[ui.configbool('keywordset', 'svn')]) + return templates + +class kwtemplater(object): + ''' + Sets up keyword templates, corresponding keyword regex, and + provides keyword substitution functions. + ''' def __init__(self, ui, repo): self.ui = ui @@ -126,26 +147,31 @@ self.match = match.match(repo.root, '', [], kwtools['inc'], kwtools['exc']) self.restrict = kwtools['hgcmd'] in restricted.split() + self.record = kwtools['hgcmd'] in recordcommands.split() kwmaps = self.ui.configitems('keywordmaps') if kwmaps: # override default templates self.templates = dict((k, templater.parsestring(v, False)) for k, v in kwmaps) + else: + self.templates = _defaultkwmaps(self.ui) escaped = map(re.escape, self.templates.keys()) kwpat = r'\$(%s)(: [^$\n\r]*? )??\$' % '|'.join(escaped) self.re_kw = re.compile(kwpat) templatefilters.filters['utcdate'] = utcdate - self.ct = cmdutil.changeset_templater(self.ui, self.repo, - False, None, '', False) + templatefilters.filters['svnisodate'] = svnisodate + templatefilters.filters['svnutcdate'] = svnutcdate def substitute(self, data, path, ctx, subfunc): '''Replaces keywords in data with expanded template.''' def kwsub(mobj): kw = mobj.group(1) - self.ct.use_template(self.templates[kw]) + ct = cmdutil.changeset_templater(self.ui, self.repo, + False, None, '', False) + ct.use_template(self.templates[kw]) self.ui.pushbuffer() - self.ct.show(ctx, root=self.repo.root, file=path) + ct.show(ctx, root=self.repo.root, file=path) ekw = templatefilters.firstline(self.ui.popbuffer()) return '$%s: %s $' % (kw, ekw) return subfunc(kwsub, data) @@ -163,37 +189,37 @@ Caveat: localrepository._link fails on Windows.''' return self.match(path) and not 'l' in flagfunc(path) - def overwrite(self, node, expand, files): + def overwrite(self, ctx, candidates, iswctx, expand): '''Overwrites selected files expanding/shrinking keywords.''' - ctx = self.repo[node] - mf = ctx.manifest() - if node is not None: # commit - files = [f for f in ctx.files() if f in mf] - notify = self.ui.debug - else: # kwexpand/kwshrink - notify = self.ui.note - candidates = [f for f in files if self.iskwfile(f, ctx.flags)] + if self.record: + candidates = [f for f in ctx.files() if f in ctx] + candidates = [f for f in candidates if self.iskwfile(f, ctx.flags)] if candidates: - self.restrict = True # do not expand when reading + self.restrict = True # do not expand when reading + mf = ctx.manifest() msg = (expand and _('overwriting %s expanding keywords\n') or _('overwriting %s shrinking keywords\n')) for f in candidates: - fp = self.repo.file(f) - data = fp.read(mf[f]) + if not self.record: + data = self.repo.file(f).read(mf[f]) + else: + data = self.repo.wread(f) if util.binary(data): continue if expand: - if node is None: + if iswctx: ctx = self.repo.filectx(f, fileid=mf[f]).changectx() data, found = self.substitute(data, f, ctx, self.re_kw.subn) else: found = self.re_kw.search(data) if found: - notify(msg % f) + self.ui.note(msg % f) self.repo.wwrite(f, data, mf.flags(f)) - if node is None: + if iswctx: self.repo.dirstate.normal(f) + elif self.record: + self.repo.dirstate.normallookup(f) self.restrict = False def shrinktext(self, text): @@ -251,30 +277,27 @@ '''Bails out if [keyword] configuration is not active. Returns status of working directory.''' if kwt: - unknown = (opts.get('unknown') or opts.get('all') - or opts.get('untracked')) return repo.status(match=cmdutil.match(repo, pats, opts), clean=True, - unknown=unknown) + unknown=opts.get('unknown') or opts.get('all')) if ui.configitems('keyword'): raise util.Abort(_('[keyword] patterns cannot match')) raise util.Abort(_('no [keyword] patterns configured')) def _kwfwrite(ui, repo, expand, *pats, **opts): '''Selects files and passes them to kwtemplater.overwrite.''' - if repo.dirstate.parents()[1] != nullid: + wctx = repo[None] + if len(wctx.parents()) > 1: raise util.Abort(_('outstanding uncommitted merge')) kwt = kwtools['templater'] - status = _status(ui, repo, kwt, *pats, **opts) - modified, added, removed, deleted = status[:4] - if modified or added or removed or deleted: - raise util.Abort(_('outstanding uncommitted changes')) - wlock = lock = None + wlock = repo.wlock() try: - wlock = repo.wlock() - lock = repo.lock() - kwt.overwrite(None, expand, status[6]) + status = _status(ui, repo, kwt, *pats, **opts) + modified, added, removed, deleted, unknown, ignored, clean = status + if modified or added or removed or deleted: + raise util.Abort(_('outstanding uncommitted changes')) + kwt.overwrite(wctx, clean, True, expand) finally: - release(lock, wlock) + wlock.release() def demo(ui, repo, *args, **opts): '''print [keywordmaps] configuration and an expansion example @@ -287,7 +310,7 @@ Use -d/--default to disable current configuration. - See "hg help templates" for information on templates and filters. + See :hg:`help templates` for information on templates and filters. ''' def demoitems(section, items): ui.write('[%s]\n' % section) @@ -295,7 +318,6 @@ ui.write('%s = %s\n' % (k, v)) fn = 'demo.txt' - branchname = 'demobranch' tmpdir = tempfile.mkdtemp('', 'kwdemo.') ui.note(_('creating temporary repository at %s\n') % tmpdir) repo = localrepo.localrepository(ui, tmpdir, True) @@ -320,46 +342,34 @@ kwmaps = dict(ui.configitems('keywordmaps')) elif opts.get('default'): ui.status(_('\n\tconfiguration using default keyword template maps\n')) - kwmaps = kwtemplater.templates + kwmaps = _defaultkwmaps(ui) if uikwmaps: ui.status(_('\tdisabling current template maps\n')) for k, v in kwmaps.iteritems(): ui.setconfig('keywordmaps', k, v) else: ui.status(_('\n\tconfiguration using current keyword template maps\n')) - kwmaps = dict(uikwmaps) or kwtemplater.templates + kwmaps = dict(uikwmaps) or _defaultkwmaps(ui) uisetup(ui) reposetup(ui, repo) - for k, v in ui.configitems('extensions'): - if k.endswith('keyword'): - extension = '%s = %s' % (k, v) - break - ui.write('[extensions]\n%s\n' % extension) + ui.write('[extensions]\nkeyword =\n') demoitems('keyword', ui.configitems('keyword')) demoitems('keywordmaps', kwmaps.iteritems()) keywords = '$' + '$\n$'.join(sorted(kwmaps.keys())) + '$\n' repo.wopener(fn, 'w').write(keywords) - repo.add([fn]) - path = repo.wjoin(fn) - ui.note(_('\nkeywords written to %s:\n') % path) + repo[None].add([fn]) + ui.note(_('\nkeywords written to %s:\n') % fn) ui.note(keywords) - ui.note('\nhg -R "%s" branch "%s"\n' % (tmpdir, branchname)) - # silence branch command if not verbose - quiet = ui.quiet - ui.quiet = not ui.verbose - commands.branch(ui, repo, branchname) - ui.quiet = quiet + repo.dirstate.setbranch('demobranch') for name, cmd in ui.configitems('hooks'): if name.split('.', 1)[0].find('commit') > -1: repo.ui.setconfig('hooks', name, '') - ui.note(_('unhooked all commit hooks\n')) msg = _('hg keyword configuration and expansion example') - ui.note("hg -R '%s' ci -m '%s'\n" % (tmpdir, msg)) + ui.note("hg ci -m '%s'\n" % msg) repo.commit(text=msg) ui.status(_('\n\tkeywords expanded\n')) ui.write(repo.wread(fn)) - ui.debug('\nremoving temporary repository %s\n' % tmpdir) shutil.rmtree(tmpdir, ignore_errors=True) def expand(ui, repo, *pats, **opts): @@ -382,7 +392,7 @@ execution by including only files that are actual candidates for expansion. - See "hg help keyword" on how to construct patterns both for + See :hg:`help keyword` on how to construct patterns both for inclusion and exclusion of files. With -A/--all and -v/--verbose the codes used to show the status @@ -398,7 +408,7 @@ cwd = pats and repo.getcwd() or '' modified, added, removed, deleted, unknown, ignored, clean = status files = [] - if not (opts.get('unknown') or opts.get('untracked')) or opts.get('all'): + if not opts.get('unknown') or opts.get('all'): files = sorted(modified + added + clean) wctx = repo[None] kwfiles = [f for f in files if kwt.iskwfile(f, wctx.flags)] @@ -419,7 +429,7 @@ '''revert expanded keywords in the working directory Run before changing/disabling active keywords or if you experience - problems with "hg import" or "hg merge". + problems with :hg:`import` or :hg:`merge`. kwshrink refuses to run if given files contain local changes. ''' @@ -485,22 +495,19 @@ del self.commitctx def kwcommitctx(self, ctx, error=False): - wlock = lock = None - try: - wlock = self.wlock() - lock = self.lock() - n = super(kwrepo, self).commitctx(ctx, error) - kwt.overwrite(n, True, None) - return n - finally: - release(lock, wlock) + n = super(kwrepo, self).commitctx(ctx, error) + # no lock needed, only called from repo.commit() which already locks + if not kwt.record: + kwt.overwrite(self[n], sorted(ctx.added() + ctx.modified()), + False, True) + return n # monkeypatches def kwpatchfile_init(orig, self, ui, fname, opener, - missing=False, eol=None): + missing=False, eolmode=None): '''Monkeypatch/wrap patch.patchfile.__init__ to avoid rejects or conflicts due to expanded keywords in working dir.''' - orig(self, ui, fname, opener, missing, eol) + orig(self, ui, fname, opener, missing, eolmode) # shrink keywords read from working dir self.lines = kwt.shrinklines(self.fname, self.lines) @@ -519,6 +526,21 @@ kwt.match = util.never return orig(web, req, tmpl) + def kw_dorecord(orig, ui, repo, commitfunc, *pats, **opts): + '''Wraps record.dorecord expanding keywords after recording.''' + wlock = repo.wlock() + try: + # record returns 0 even when nothing has changed + # therefore compare nodes before and after + ctx = repo['.'] + ret = orig(ui, repo, commitfunc, *pats, **opts) + recordctx = repo['.'] + if ctx != recordctx: + kwt.overwrite(recordctx, None, False, True) + return ret + finally: + wlock.release() + repo.__class__ = kwrepo extensions.wrapfunction(patch.patchfile, '__init__', kwpatchfile_init) @@ -526,12 +548,19 @@ extensions.wrapfunction(patch, 'diff', kw_diff) for c in 'annotate changeset rev filediff diff'.split(): extensions.wrapfunction(webcommands, c, kwweb_skip) + for name in recordextensions.split(): + try: + record = extensions.find(name) + extensions.wrapfunction(record, 'dorecord', kw_dorecord) + except KeyError: + pass cmdtable = { 'kwdemo': (demo, [('d', 'default', None, _('show default keyword template maps')), - ('f', 'rcfile', '', _('read maps from rcfile'))], + ('f', 'rcfile', '', + _('read maps from rcfile'), _('FILE'))], _('hg kwdemo [-d] [-f RCFILE] [TEMPLATEMAP]...')), 'kwexpand': (expand, commands.walkopts, _('hg kwexpand [OPTION]... [FILE]...')), @@ -540,9 +569,6 @@ [('A', 'all', None, _('show keyword status flags of all files')), ('i', 'ignore', None, _('show files excluded from expansion')), ('u', 'unknown', None, _('only show unknown (not tracked) files')), - ('a', 'all', None, - _('show keyword status flags of all files (DEPRECATED)')), - ('u', 'untracked', None, _('only show untracked files (DEPRECATED)')), ] + commands.walkopts, _('hg kwfiles [OPTION]... [FILE]...')), 'kwshrink': (shrink, commands.walkopts, diff -Nru mercurial-1.5.4/hgext/mq.py mercurial-1.6/hgext/mq.py --- mercurial-1.5.4/hgext/mq.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/mq.py 2010-07-01 18:06:27.000000000 +0100 @@ -14,7 +14,7 @@ Known patches are represented as patch files in the .hg/patches directory. Applied patches are both patch files and changesets. -Common tasks (use "hg help command" for more details):: +Common tasks (use :hg:`help command` for more details):: create new patch qnew import existing patch qimport @@ -37,6 +37,9 @@ 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. + +You will by default be managing a patch queue named "patches". You can +create other, independent patch queues with the :hg:`qqueue` command. ''' from mercurial.i18n import _ @@ -53,18 +56,10 @@ normname = util.normpath class statusentry(object): - def __init__(self, rev, name=None): - if not name: - fields = rev.split(':', 1) - if len(fields) == 2: - self.rev, self.name = fields - else: - self.rev, self.name = None, None - else: - self.rev, self.name = rev, name - - def __str__(self): - return self.rev + ':' + self.name + def __init__(self, node, name): + self.node, self.name = node, name + def __repr__(self): + return hex(self.node) + ':' + self.name class patchheader(object): def __init__(self, pf, plainmode=False): @@ -79,8 +74,7 @@ break def eatempty(lines): while lines: - l = lines[-1] - if re.match('\s*$', l): + if not lines[-1].strip(): del lines[-1] else: break @@ -242,11 +236,21 @@ class queue(object): def __init__(self, ui, path, patchdir=None): self.basepath = path - self.path = patchdir or os.path.join(path, "patches") + try: + fh = open(os.path.join(path, 'patches.queue')) + cur = fh.read().rstrip() + if not cur: + curpath = os.path.join(path, 'patches') + else: + curpath = os.path.join(path, 'patches-' + cur) + except IOError: + curpath = os.path.join(path, 'patches') + self.path = patchdir or curpath self.opener = util.opener(self.path) self.ui = ui self.applied_dirty = 0 self.series_dirty = 0 + self.added = [] self.series_path = "series" self.status_path = "status" self.guards_path = "guards" @@ -265,8 +269,11 @@ @util.propertycache def applied(self): if os.path.exists(self.join(self.status_path)): + def parse(l): + n, name = l.split(':', 1) + return statusentry(bin(n), name) lines = self.opener(self.status_path).read().splitlines() - return [statusentry(l) for l in lines] + return [parse(l) for l in lines] return [] @util.propertycache @@ -329,16 +336,12 @@ return os.path.join(self.path, *p) def find_series(self, patch): - pre = re.compile("(\s*)([^#]+)") - index = 0 - for l in self.full_series: - m = pre.match(l) - if m: - s = m.group(2) - s = s.rstrip() - if s == patch: - return index - index += 1 + def matchpatch(l): + l = l.split('#', 1)[0] + return l.strip() == patch + for index, l in enumerate(self.full_series): + if matchpatch(l): + return index return None guard_re = re.compile(r'\s?#([-+][^-+# \t\r\n\f][^# \t\r\n\f]*)') @@ -486,19 +489,9 @@ def printdiff(self, repo, diffopts, node1, node2=None, files=None, fp=None, changes=None, opts={}): stat = opts.get('stat') - if stat: - opts['unified'] = '0' - m = cmdutil.match(repo, files, opts) - chunks = patch.diff(repo, node1, node2, m, changes, diffopts) - write = fp is None and repo.ui.write or fp.write - if stat: - width = self.ui.interactive() and util.termwidth() or 80 - write(patch.diffstat(util.iterlines(chunks), width=width, - git=diffopts.git)) - else: - for chunk in chunks: - write(chunk) + cmdutil.diffordiffstat(self.ui, repo, diffopts, node1, node2, m, + changes, stat, fp) def mergeone(self, repo, mergeq, head, patch, rev, diffopts): # first try just applying the patch @@ -544,22 +537,16 @@ (p1, p2) = repo.dirstate.parents() if p2 == nullid: return p1 - if len(self.applied) == 0: + if not self.applied: return None - return bin(self.applied[-1].rev) - pp = repo.changelog.parents(rev) - if pp[1] != nullid: - arevs = [x.rev for x in self.applied] - p0 = hex(pp[0]) - p1 = hex(pp[1]) - if p0 in arevs: - return pp[0] - if p1 in arevs: - return pp[1] - return pp[0] + return self.applied[-1].node + p1, p2 = repo.changelog.parents(rev) + if p2 != nullid and p2 in [x.node for x in self.applied]: + return p2 + return p1 def mergepatch(self, repo, mergeq, series, diffopts): - if len(self.applied) == 0: + if not self.applied: # each of the patches merged in will have two parents. This # can confuse the qrefresh, qdiff, and strip code because it # needs to know which parent is actually in the patch queue. @@ -569,7 +556,7 @@ pname = ".hg.patches.merge.marker" n = repo.commit('[mq]: merge marker', force=True) self.removeundo(repo) - self.applied.append(statusentry(hex(n), pname)) + self.applied.append(statusentry(n, pname)) self.applied_dirty = 1 head = self.qparents(repo) @@ -587,10 +574,10 @@ if not info: self.ui.warn(_("patch %s is not applied\n") % patch) return (1, None) - rev = bin(info[1]) + rev = info[1] err, head = self.mergeone(repo, mergeq, head, patch, rev, diffopts) if head: - self.applied.append(statusentry(hex(head), patch)) + self.applied.append(statusentry(head, patch)) self.applied_dirty = 1 if err: return (err, head) @@ -613,12 +600,12 @@ return (True, files, fuzz) def apply(self, repo, series, list=False, update_status=True, - strict=False, patchdir=None, merge=None, all_files={}): + strict=False, patchdir=None, merge=None, all_files=None): wlock = lock = tr = None try: wlock = repo.wlock() lock = repo.lock() - tr = repo.transaction() + tr = repo.transaction("qpush") try: ret = self._apply(repo, series, list, update_status, strict, patchdir, merge, all_files=all_files) @@ -633,12 +620,11 @@ repo.dirstate.invalidate() raise finally: - del tr - release(lock, wlock) + release(tr, lock, wlock) self.removeundo(repo) def _apply(self, repo, series, list=False, update_status=True, - strict=False, patchdir=None, merge=None, all_files={}): + strict=False, patchdir=None, merge=None, all_files=None): '''returns (error, hash) error = 1 for unable to read, 2 for patch failed, 3 for patch fuzz''' # TODO unify with commands.py @@ -671,7 +657,8 @@ if ph.haspatch: (patcherr, files, fuzz) = self.patch(repo, pf) - all_files.update(files) + if all_files is not None: + all_files.update(files) patcherr = not patcherr else: self.ui.warn(_("patch %s is empty\n") % patchname) @@ -701,7 +688,7 @@ raise util.Abort(_("repo commit failed")) if update_status: - self.applied.append(statusentry(hex(n), patchname)) + self.applied.append(statusentry(n, patchname)) if patcherr: self.ui.warn(_("patch failed, rejects left in working dir\n")) @@ -718,7 +705,7 @@ if not keep: r = self.qrepo() if r: - r.remove(patches, True) + r[None].remove(patches, True) else: for p in patches: os.unlink(self.join(p)) @@ -733,7 +720,7 @@ self.series_dirty = 1 def _revpatches(self, repo, revs): - firstrev = repo[self.applied[0].rev].rev() + firstrev = repo[self.applied[0].node].rev() patches = [] for i, rev in enumerate(revs): @@ -741,7 +728,7 @@ raise util.Abort(_('revision %d is not managed') % rev) ctx = repo[rev] - base = bin(self.applied[i].rev) + base = self.applied[i].node if ctx.node() != base: msg = _('cannot delete revision %d above applied patches') raise util.Abort(msg % rev) @@ -789,8 +776,8 @@ self._cleanup(realpatches, numrevs, opts.get('keep')) def check_toppatch(self, repo): - if len(self.applied) > 0: - top = bin(self.applied[-1].rev) + if self.applied: + top = self.applied[-1].node patch = self.applied[-1].name pp = repo.dirstate.parents() if top not in pp: @@ -870,7 +857,7 @@ raise util.Abort(_("repo commit failed")) try: self.full_series[insert:insert] = [patchfn] - self.applied.append(statusentry(hex(n), patchfn)) + self.applied.append(statusentry(n, patchfn)) self.parse_series() self.series_dirty = 1 self.applied_dirty = 1 @@ -888,7 +875,7 @@ wlock = None r = self.qrepo() if r: - r.add([patchfn]) + r[None].add([patchfn]) except: repo.rollback() raise @@ -927,7 +914,7 @@ """returns (index, rev, patch)""" for i, a in enumerate(self.applied): if a.name == patch: - return (i, a.rev, a.name) + return (i, a.node, a.name) return None # if the exact patch name does not exist, we try a few @@ -950,7 +937,7 @@ return None if matches: return matches[0] - if len(self.series) > 0 and len(self.applied) > 0: + if self.series and self.applied: if s == 'qtip': return self.series[self.series_end(True)-1] if s == 'qbase': @@ -1002,7 +989,7 @@ raise util.Abort(_("patch %s not in series") % patch) def push(self, repo, patch=None, force=False, list=False, - mergeq=None, all=False): + mergeq=None, all=False, move=False): diffopts = self.diffopts() wlock = repo.wlock() try: @@ -1031,7 +1018,7 @@ _("cannot push to a previous patch: %s") % patch) self.ui.warn( _('qpush: %s is already at the top\n') % patch) - return + return 0 pushable, reason = self.pushable(patch) if not pushable: if reason: @@ -1058,6 +1045,17 @@ if not force: self.check_localchanges(repo) + if move: + try: + index = self.series.index(patch, start) + fullpatch = self.full_series[index] + del self.full_series[index] + except ValueError: + raise util.Abort(_("patch '%s' not found") % patch) + self.full_series.insert(start, fullpatch) + self.parse_series() + self.series_dirty = 1 + self.applied_dirty = 1 if start > 0: self.check_toppatch(repo) @@ -1068,7 +1066,7 @@ end = self.series.index(patch, start) + 1 s = self.series[start:end] - all_files = {} + all_files = set() try: if mergeq: ret = self.mergepatch(repo, mergeq, s, diffopts) @@ -1078,12 +1076,15 @@ self.ui.warn(_('cleaning up working directory...')) node = repo.dirstate.parents()[0] hg.revert(repo, node, None) - unknown = repo.status(unknown=True)[4] # only remove unknown files that we know we touched or # created while patching - for f in unknown: - if f in all_files: - util.unlink(repo.wjoin(f)) + for f in all_files: + if f not in repo.dirstate: + try: + util.unlink(repo.wjoin(f)) + except OSError, inst: + if inst.errno != errno.ENOENT: + raise self.ui.warn(_('done\n')) raise @@ -1101,10 +1102,6 @@ wlock.release() def pop(self, repo, patch=None, force=False, update=True, all=False): - def getfile(f, rev, flags): - t = repo.file(f).read(rev) - repo.wwrite(f, t, flags) - wlock = repo.wlock() try: if patch: @@ -1116,7 +1113,7 @@ if not info: raise util.Abort(_("patch %s is not applied") % patch) - if len(self.applied) == 0: + if not self.applied: # Allow qpop -a to work repeatedly, # but not qpop without an argument self.ui.warn(_("no patches applied\n")) @@ -1135,16 +1132,16 @@ if not update: parents = repo.dirstate.parents() - rr = [bin(x.rev) for x in self.applied] + rr = [x.node for x in self.applied] for p in parents: if p in rr: self.ui.warn(_("qpop: forcing dirstate update\n")) update = True else: - parents = [p.hex() for p in repo[None].parents()] + parents = [p.node() for p in repo[None].parents()] needupdate = False for entry in self.applied[start:]: - if entry.rev in parents: + if entry.node in parents: needupdate = True break update = needupdate @@ -1154,7 +1151,7 @@ self.applied_dirty = 1 end = len(self.applied) - rev = bin(self.applied[start].rev) + rev = self.applied[start].node if update: top = self.check_toppatch(repo)[0] @@ -1164,7 +1161,7 @@ node = short(rev) raise util.Abort(_('trying to pop unknown node %s') % node) - if heads != [bin(self.applied[-1].rev)]: + if heads != [self.applied[-1].node]: raise util.Abort(_("popping would remove a revision not " "managed by this patch queue")) @@ -1172,8 +1169,7 @@ # form of hg.update. if update: qp = self.qparents(repo, rev) - changes = repo.changelog.read(qp) - mmap = repo.manifest.read(changes[0]) + ctx = repo[qp] m, a, r, d = repo.status(qp, top)[:4] if d: raise util.Abort(_("deletions found between repo revs")) @@ -1184,18 +1180,16 @@ if e.errno != errno.ENOENT: raise repo.dirstate.forget(f) - for f in m: - getfile(f, mmap[f], mmap.flags(f)) - for f in r: - getfile(f, mmap[f], mmap.flags(f)) for f in m + r: + fctx = ctx[f] + repo.wwrite(f, fctx.data(), fctx.flags()) repo.dirstate.normal(f) repo.dirstate.setparents(qp, nullid) for patch in reversed(self.applied[start:end]): self.ui.status(_("popping %s\n") % patch.name) del self.applied[start:end] self.strip(repo, rev, update=False, backup='strip') - if len(self.applied): + if self.applied: self.ui.write(_("now at: %s\n") % self.applied[-1].name) else: self.ui.write(_("patch queue now empty\n")) @@ -1216,7 +1210,7 @@ self.printdiff(repo, diffopts, node1, node2, files=pats, opts=opts) def refresh(self, repo, pats=None, **opts): - if len(self.applied) == 0: + if not self.applied: self.ui.write(_("no patches applied\n")) return 1 msg = opts.get('msg', '').rstrip() @@ -1228,8 +1222,7 @@ try: self.check_toppatch(repo) - (top, patchfn) = (self.applied[-1].rev, self.applied[-1].name) - top = bin(top) + (top, patchfn) = (self.applied[-1].node, self.applied[-1].name) if repo.changelog.heads(top) != [top]: raise util.Abort(_("cannot refresh a revision with children")) @@ -1386,7 +1379,7 @@ patchf.rename() n = repo.commit(message, user, ph.date, match=match, force=True) - self.applied.append(statusentry(hex(n), patchfn)) + self.applied.append(statusentry(n, patchfn)) except: ctx = repo[cparents[0]] repo.dirstate.rebuild(ctx.node(), ctx.manifest()) @@ -1426,20 +1419,24 @@ def qseries(self, repo, missing=None, start=0, length=None, status=None, summary=False): - def displayname(pfx, patchname): + def displayname(pfx, patchname, state): + if pfx: + self.ui.write(pfx) if summary: ph = patchheader(self.join(patchname), self.plainmode) msg = ph.message and ph.message[0] or '' - if not self.ui.plain(): + if self.ui.formatted(): width = util.termwidth() - len(pfx) - len(patchname) - 2 if width > 0: msg = util.ellipsis(msg, width) else: msg = '' - msg = "%s%s: %s" % (pfx, patchname, msg) + self.ui.write(patchname, label='qseries.' + state) + self.ui.write(': ') + self.ui.write(msg, label='qseries.message.' + state) else: - msg = pfx + patchname - self.ui.write(msg + '\n') + self.ui.write(patchname, label='qseries.' + state) + self.ui.write('\n') applied = set([p.name for p in self.applied]) if length is None: @@ -1450,17 +1447,17 @@ for i in xrange(start, start + length): patch = self.series[i] if patch in applied: - stat = 'A' + char, state = 'A', 'applied' elif self.pushable(i)[0]: - stat = 'U' + char, state = 'U', 'unapplied' else: - stat = 'G' + char, state = 'G', 'guarded' pfx = '' if self.ui.verbose: - pfx = '%*d %s ' % (idxwidth, i, stat) - elif status and status != stat: + pfx = '%*d %s ' % (idxwidth, i, char) + elif status and status != char: continue - displayname(pfx, patch) + displayname(pfx, patch, state) else: msng_list = [] for root, dirs, files in os.walk(self.path): @@ -1474,7 +1471,7 @@ msng_list.append(fl) for x in sorted(msng_list): pfx = self.ui.verbose and ('D ') or '' - displayname(pfx, x) + displayname(pfx, x, 'missing') def issaveline(self, l): if l.name == '.hg.patches.save.line': @@ -1485,8 +1482,7 @@ return hg.repository(self.ui, path=self.path, create=create) def restore(self, repo, rev, delete=None, qupdate=None): - c = repo.changelog.read(rev) - desc = c[4].strip() + desc = repo[rev].description().strip() lines = desc.splitlines() i = 0 datastart = None @@ -1502,12 +1498,11 @@ qpp = [bin(x) for x in l] elif datastart != None: l = line.rstrip() - se = statusentry(l) - file_ = se.name - if se.rev: - applied.append(se) + n, name = l.split(':', 1) + if n: + applied.append(statusentry(bin(n), name)) else: - series.append(file_) + series.append(l) if datastart is None: self.ui.warn(_("No saved patch data found\n")) return 1 @@ -1541,14 +1536,13 @@ hg.clean(r, qpp[0]) def save(self, repo, msg=None): - if len(self.applied) == 0: + if not self.applied: self.ui.warn(_("save: no patches applied, exiting\n")) return 1 if self.issaveline(self.applied[-1]): self.ui.warn(_("status is already saved\n")) return 1 - ar = [':' + x for x in self.full_series] if not msg: msg = _("hg patches saved state") else: @@ -1558,18 +1552,18 @@ pp = r.dirstate.parents() msg += "\nDirstate: %s %s" % (hex(pp[0]), hex(pp[1])) msg += "\n\nPatch Data:\n" - text = msg + "\n".join([str(x) for x in self.applied]) + '\n' + (ar and - "\n".join(ar) + '\n' or "") - n = repo.commit(text, force=True) + msg += ''.join('%s\n' % x for x in self.applied) + msg += ''.join(':%s\n' % x for x in self.full_series) + n = repo.commit(msg, force=True) if not n: self.ui.warn(_("repo commit failed\n")) return 1 - self.applied.append(statusentry(hex(n),'.hg.patches.save.line')) + self.applied.append(statusentry(n, '.hg.patches.save.line')) self.applied_dirty = 1 self.removeundo(repo) def full_series_end(self): - if len(self.applied) > 0: + if self.applied: p = self.applied[-1].name end = self.find_series(p) if end is None: @@ -1584,17 +1578,15 @@ """ end = 0 def next(start): - if all_patches: + if all_patches or start >= len(self.series): return start - i = start - while i < len(self.series): + for i in xrange(start, len(self.series)): p, reason = self.pushable(i) if p: break self.explain_pushable(i) - i += 1 return i - if len(self.applied) > 0: + if self.applied: p = self.applied[-1].name try: end = self.series.index(p) @@ -1631,8 +1623,7 @@ if (len(files) > 1 or len(rev) > 1) and patchname: raise util.Abort(_('option "-n" not valid when importing multiple ' 'patches')) - i = 0 - added = [] + self.added = [] if rev: # If mq patches are applied, we can only import revisions # that form a linear path to qbase. @@ -1642,14 +1633,14 @@ raise util.Abort(_('revision %d is the root of more than one ' 'branch') % rev[-1]) if self.applied: - base = hex(repo.changelog.node(rev[0])) - if base in [n.rev for n in self.applied]: + base = repo.changelog.node(rev[0]) + if base in [n.node for n in self.applied]: raise util.Abort(_('revision %d is already managed') % rev[0]) - if heads != [bin(self.applied[-1].rev)]: + if heads != [self.applied[-1].node]: raise util.Abort(_('revision %d is not the parent of ' 'the queue') % rev[0]) - base = repo.changelog.rev(bin(self.applied[0].rev)) + base = repo.changelog.rev(self.applied[0].node) lastparent = repo.changelog.parentrevs(base)[0] else: if heads != [repo.changelog.node(rev[0])]: @@ -1676,18 +1667,19 @@ self.full_series.insert(0, patchname) patchf = self.opener(patchname, "w") - patch.export(repo, [n], fp=patchf, opts=diffopts) + cmdutil.export(repo, [n], fp=patchf, opts=diffopts) patchf.close() - se = statusentry(hex(n), patchname) + se = statusentry(n, patchname) self.applied.insert(0, se) - added.append(patchname) + self.added.append(patchname) patchname = None self.parse_series() self.applied_dirty = 1 + self.series_dirty = True - for filename in files: + for i, filename in enumerate(files): if existing: if filename == '-': raise util.Abort(_('-e is incompatible with import from -')) @@ -1719,14 +1711,10 @@ index = self.full_series_end() + i self.full_series[index:index] = [patchname] self.parse_series() + self.series_dirty = True self.ui.warn(_("adding %s to series file\n") % patchname) - i += 1 - added.append(patchname) + self.added.append(patchname) patchname = None - self.series_dirty = 1 - qrepo = self.qrepo() - if qrepo: - qrepo.add(added) def delete(ui, repo, *patches, **opts): """remove patches from queue @@ -1735,7 +1723,7 @@ -k/--keep, the patch files are preserved in the patch directory. To stop managing a patch and move it into permanent history, - use the qfinish command.""" + use the :hg:`qfinish` command.""" q = repo.mq q.delete(repo, patches, opts) q.save_dirty() @@ -1816,10 +1804,15 @@ using the --name flag. """ q = repo.mq - q.qimport(repo, filename, patchname=opts['name'], + try: + q.qimport(repo, filename, patchname=opts['name'], existing=opts['existing'], force=opts['force'], rev=opts['rev'], git=opts['git']) - q.save_dirty() + finally: + q.save_dirty() + qrepo = q.qrepo() + if qrepo: + qrepo[None].add(q.added) if opts.get('push') and not opts.get('rev'): return q.push(repo, None) @@ -1845,7 +1838,7 @@ fp.close() if not os.path.exists(r.wjoin('series')): r.wopener('series', 'w').close() - r.add(['.hgignore', 'series']) + r[None].add(['.hgignore', 'series']) commands.add(ui, r) return 0 @@ -1859,7 +1852,7 @@ qcommit to commit changes to this queue repository. This command is deprecated. Without -c, it's implied by other relevant - commands. With -c, use hg init --mq instead.""" + commands. With -c, use :hg:`init --mq` instead.""" return qinit(ui, repo, create=opts['create_repo']) def clone(ui, source, dest=None, **opts): @@ -1875,7 +1868,7 @@ default. Use -p to change. The patch directory must be a nested Mercurial repository, as - would be created by init --mq. + would be created by :hg:`init --mq`. ''' def patchdir(repo): url = repo.url() @@ -1884,7 +1877,7 @@ return url + '/.hg/patches' if dest is None: dest = hg.defaultdest(source) - sr = hg.repository(cmdutil.remoteui(ui, opts), ui.expandpath(source)) + sr = hg.repository(hg.remoteui(ui, opts), ui.expandpath(source)) if opts['patches']: patchespath = ui.expandpath(opts['patches']) else: @@ -1897,7 +1890,7 @@ qbase, destrev = None, None if sr.local(): if sr.mq.applied: - qbase = bin(sr.mq.applied[0].rev) + qbase = sr.mq.applied[0].node if not hg.islocal(dest): heads = set(sr.heads()) destrev = list(heads.difference(sr.heads(qbase))) @@ -1929,7 +1922,7 @@ def commit(ui, repo, *pats, **opts): """commit changes in the queue repository (DEPRECATED) - This command is deprecated; use hg commit --mq instead.""" + This command is deprecated; use :hg:`commit --mq` instead.""" q = repo.mq r = q.qrepo() if not r: @@ -2056,9 +2049,9 @@ last refresh (thus showing what the current patch would become after a qrefresh). - Use 'hg diff' if you only want to see the changes made since the - last qrefresh, or 'hg export qtip' if you want to see changes made - by the current patch without including changes made since the + Use :hg:`diff` if you only want to see the changes made since the + last qrefresh, or :hg:`export qtip` if you want to see changes + made by the current patch without including changes made since the qrefresh. """ repo.mq.diff(repo, pats, opts) @@ -2144,8 +2137,8 @@ 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 qselect command has activated it. A patch with - a negative guard ("-foo") is never pushed if the qselect command + pushed only if the :hg:`qselect` command has activated it. A patch with + a negative guard ("-foo") is never pushed if the :hg:`qselect` command has activated it. With no arguments, print the currently active guards. @@ -2158,7 +2151,17 @@ ''' def status(idx): guards = q.series_guards[idx] or ['unguarded'] - ui.write('%s: %s\n' % (q.series[idx], ' '.join(guards))) + ui.write('%s: ' % ui.label(q.series[idx], 'qguard.patch')) + for i, guard in enumerate(guards): + if guard.startswith('+'): + ui.write(guard, label='qguard.positive') + elif guard.startswith('-'): + ui.write(guard, label='qguard.negative') + else: + ui.write(guard, label='qguard.unguarded') + if i != len(guards) - 1: + ui.write(' ') + ui.write('\n') q = repo.mq patch = None args = list(args) @@ -2244,7 +2247,7 @@ mergeq = queue(ui, repo.join(""), newpath) ui.warn(_("merging with queue at: %s\n") % mergeq.path) ret = q.push(repo, patch, force=opts['force'], list=opts['list'], - mergeq=mergeq, all=opts.get('all')) + mergeq=mergeq, all=opts.get('all'), move=opts.get('move')) return ret def pop(ui, repo, patch=None, **opts): @@ -2311,6 +2314,7 @@ util.rename(q.join(patch), absdest) r = q.qrepo() if r: + wctx = r[None] wlock = r.wlock() try: if r.dirstate[patch] == 'a': @@ -2318,9 +2322,9 @@ r.dirstate.add(name) else: if r.dirstate[name] == 'r': - r.undelete([name]) - r.copy(patch, name) - r.remove([patch], False) + wctx.undelete([name]) + wctx.copy(patch, name) + wctx.remove([patch], False) finally: wlock.release() @@ -2384,8 +2388,8 @@ completes. Any stripped changesets are stored in ``.hg/strip-backup`` as a - bundle (see ``hg help bundle`` and ``hg help unbundle``). They can - be restored by running ``hg unbundle .hg/strip-backup/BUNDLE``, + bundle (see :hg:`help bundle` and :hg:`help unbundle`). They can + be restored by running :hg:`unbundle .hg/strip-backup/BUNDLE`, where BUNDLE is the bundle file created by the strip. Note that the local revision numbers will in general be different after the restore. @@ -2416,7 +2420,7 @@ def select(ui, repo, *args, **opts): '''set or print guarded patches to push - Use the qguard command to set or print guards on patch, then use + Use the :hg:`qguard` 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 @@ -2547,6 +2551,123 @@ q.save_dirty() return 0 +def qqueue(ui, repo, name=None, **opts): + '''manage multiple patch queues + + Supports switching between different patch queues, as well as creating + new patch queues and deleting existing ones. + + 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)". + + 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. + + To delete an existing queue, use --delete. You cannot delete the currently + active queue. + ''' + + q = repo.mq + + _defaultqueue = 'patches' + _allqueues = 'patches.queues' + _activequeue = 'patches.queue' + + def _getcurrent(): + cur = os.path.basename(q.path) + if cur.startswith('patches-'): + cur = cur[8:] + return cur + + def _noqueues(): + try: + fh = repo.opener(_allqueues, 'r') + fh.close() + except IOError: + return True + + return False + + def _getqueues(): + current = _getcurrent() + + try: + fh = repo.opener(_allqueues, 'r') + queues = [queue.strip() for queue in fh if queue.strip()] + if current not in queues: + queues.append(current) + except IOError: + queues = [_defaultqueue] + + return sorted(queues) + + def _setactive(name): + if q.applied: + raise util.Abort(_('patches applied - cannot set new queue active')) + + fh = repo.opener(_activequeue, 'w') + if name != 'patches': + fh.write(name) + fh.close() + + def _addqueue(name): + fh = repo.opener(_allqueues, 'a') + fh.write('%s\n' % (name,)) + fh.close() + + def _validname(name): + for n in name: + if n in ':\\/.': + return False + return True + + if not name or opts.get('list'): + current = _getcurrent() + for queue in _getqueues(): + ui.write('%s' % (queue,)) + if queue == current: + ui.write(_(' (active)\n')) + else: + ui.write('\n') + return + + if not _validname(name): + raise util.Abort( + _('invalid queue name, may not contain the characters ":\\/."')) + + existing = _getqueues() + + if opts.get('create'): + if name in existing: + raise util.Abort(_('queue "%s" already exists') % name) + if _noqueues(): + _addqueue(_defaultqueue) + _addqueue(name) + _setactive(name) + elif opts.get('delete'): + if name not in existing: + raise util.Abort(_('cannot delete queue that does not exist')) + + current = _getcurrent() + + if name == current: + raise util.Abort(_('cannot delete currently active queue')) + + fh = repo.opener('patches.queues.new', 'w') + for queue in existing: + if queue == name: + continue + fh.write('%s\n' % (queue,)) + fh.close() + util.rename(repo.join('patches.queues.new'), repo.join(_allqueues)) + else: + if name not in existing: + raise util.Abort(_('use --create to create a new queue')) + _setactive(name) + def reposetup(ui, repo): class mqrepo(repo.__class__): @util.propertycache @@ -2555,8 +2676,8 @@ def abort_if_wdir_patched(self, errmsg, force=False): if self.mq.applied and not force: - parent = hex(self.dirstate.parents()[0]) - if parent in [s.rev for s in self.mq.applied]: + parent = self.dirstate.parents()[0] + if parent in [s.node for s in self.mq.applied]: raise util.Abort(errmsg) def commit(self, text="", user=None, date=None, match=None, @@ -2568,10 +2689,10 @@ return super(mqrepo, self).commit(text, user, date, match, force, editor, extra) - def push(self, remote, force=False, revs=None): + def push(self, remote, force=False, revs=None, newbranch=False): if self.mq.applied and not force and not revs: raise util.Abort(_('source has mq patches applied')) - return super(mqrepo, self).push(remote, force, revs) + return super(mqrepo, self).push(remote, force, revs, newbranch) def _findtags(self): '''augment tags from base class with patch tags''' @@ -2581,7 +2702,7 @@ if not q.applied: return result - mqtags = [(bin(patch.rev), patch.name) for patch in q.applied] + mqtags = [(patch.node, patch.name) for patch in q.applied] if mqtags[-1][0] not in self.changelog.nodemap: self.ui.warn(_('mq status file refers to unknown node %s\n') @@ -2607,7 +2728,7 @@ return super(mqrepo, self)._branchtags(partial, lrev) cl = self.changelog - qbasenode = bin(q.applied[0].rev) + qbasenode = q.applied[0].node if qbasenode not in cl.nodemap: self.ui.warn(_('mq status file refers to unknown node %s\n') % short(qbasenode)) @@ -2672,13 +2793,29 @@ q = repo.mq r = q.qrepo() if not r: - raise util.Abort('no queue repository') + raise util.Abort(_('no queue repository')) return orig(r.ui, r, *args, **kwargs) +def summary(orig, ui, repo, *args, **kwargs): + r = orig(ui, repo, *args, **kwargs) + q = repo.mq + m = [] + a, u = len(q.applied), len(q.unapplied(repo)) + if a: + m.append(ui.label(_("%d applied"), 'qseries.applied') % a) + if u: + m.append(ui.label(_("%d unapplied"), 'qseries.unapplied') % u) + if m: + ui.write("mq: %s\n" % ', '.join(m)) + else: + ui.note(_("mq: (empty queue)\n")) + return r + def uisetup(ui): mqopt = [('', 'mq', None, _("operate on patch repository"))] extensions.wrapcommand(commands.table, 'import', mqimport) + extensions.wrapcommand(commands.table, 'summary', summary) entry = extensions.wrapcommand(commands.table, 'init', mqinit) entry[1].extend(mqopt) @@ -2704,7 +2841,8 @@ ('U', 'noupdate', None, _('do not update the new working directories')), ('', 'uncompressed', None, _('use uncompressed transfer (fast over LAN)')), - ('p', 'patches', '', _('location of source patch repository')), + ('p', 'patches', '', + _('location of source patch repository'), _('REPO')), ] + commands.remoteopts, _('hg qclone [OPTION]... SOURCE [DEST]')), "qcommit|qci": @@ -2718,7 +2856,8 @@ "qdelete|qremove|qrm": (delete, [('k', 'keep', None, _('keep patch file')), - ('r', 'rev', [], _('stop managing a revision (DEPRECATED)'))], + ('r', 'rev', [], + _('stop managing a revision (DEPRECATED)'), _('REV'))], _('hg qdelete [-k] [-r REV]... [PATCH]...')), 'qfold': (fold, @@ -2736,12 +2875,14 @@ ('n', 'none', None, _('drop all guards'))], _('hg qguard [-l] [-n] [PATCH] [-- [+GUARD]... [-GUARD]...]')), 'qheader': (header, [], _('hg qheader [PATCH]')), - "^qimport": + "qimport": (qimport, [('e', 'existing', None, _('import file in patch directory')), - ('n', 'name', '', _('name of patch file')), + ('n', 'name', '', + _('name of patch file'), _('NAME')), ('f', 'force', None, _('overwrite existing files')), - ('r', 'rev', [], _('place existing revisions under mq control')), + ('r', 'rev', [], + _('place existing revisions under mq control'), _('REV')), ('g', 'git', None, _('use git extended diff format')), ('P', 'push', None, _('qpush after importing'))], _('hg qimport [-e] [-n NAME] [-f] [-g] [-P] [-r REV]... FILE...')), @@ -2749,15 +2890,17 @@ (init, [('c', 'create-repo', None, _('create queue repository'))], _('hg qinit [-c]')), - "qnew": + "^qnew": (new, [('e', 'edit', None, _('edit commit message')), ('f', 'force', None, _('import uncommitted changes (DEPRECATED)')), ('g', 'git', None, _('use git extended diff format')), ('U', 'currentuser', None, _('add "From: " to patch')), - ('u', 'user', '', _('add "From: " to patch')), + ('u', 'user', '', + _('add "From: " to patch'), _('USER')), ('D', 'currentdate', None, _('add "Date: " to patch')), - ('d', 'date', '', _('add "Date: " to patch')) + ('d', 'date', '', + _('add "Date: " to patch'), _('DATE')) ] + commands.walkopts + commands.commitopts, _('hg qnew [-e] [-m TEXT] [-l FILE] PATCH [FILE]...')), "qnext": (next, [] + seriesopts, _('hg qnext [-s]')), @@ -2765,7 +2908,8 @@ "^qpop": (pop, [('a', 'all', None, _('pop all patches')), - ('n', 'name', '', _('queue name to pop (DEPRECATED)')), + ('n', 'name', '', + _('queue name to pop (DEPRECATED)'), _('NAME')), ('f', 'force', None, _('forget any local changes to patched files'))], _('hg qpop [-a] [-n NAME] [-f] [PATCH | INDEX]')), "^qpush": @@ -2774,8 +2918,10 @@ ('l', 'list', None, _('list patch name in commit text')), ('a', 'all', None, _('apply all patches')), ('m', 'merge', None, _('merge from another queue (DEPRECATED)')), - ('n', 'name', '', _('merge queue name (DEPRECATED)'))], - _('hg qpush [-f] [-l] [-a] [-m] [-n NAME] [PATCH | INDEX]')), + ('n', 'name', '', + _('merge queue name (DEPRECATED)'), _('NAME')), + ('', 'move', None, _('reorder patch series and apply only the patch'))], + _('hg qpush [-f] [-l] [-a] [-m] [-n NAME] [--move] [PATCH | INDEX]')), "^qrefresh": (refresh, [('e', 'edit', None, _('edit commit message')), @@ -2785,11 +2931,11 @@ ('U', 'currentuser', None, _('add/update author field in patch with current user')), ('u', 'user', '', - _('add/update author field in patch with given user')), + _('add/update author field in patch with given user'), _('USER')), ('D', 'currentdate', None, _('add/update date field in patch with current date')), ('d', 'date', '', - _('add/update date field in patch with given date')) + _('add/update date field in patch with given date'), _('DATE')) ] + commands.walkopts + commands.commitopts, _('hg qrefresh [-I] [-X] [-e] [-m TEXT] [-l FILE] [-s] [FILE]...')), 'qrename|qmv': @@ -2802,7 +2948,8 @@ "qsave": (save, [('c', 'copy', None, _('copy patch directory')), - ('n', 'name', '', _('copy directory name')), + ('n', 'name', '', + _('copy directory name'), _('NAME')), ('e', 'empty', None, _('clear queue status file')), ('f', 'force', None, _('force copy'))] + commands.commitopts, _('hg qsave [-m TEXT] [-l FILE] [-c] [-n NAME] [-e] [-f]')), @@ -2818,7 +2965,7 @@ [('m', 'missing', None, _('print patches not in series')), ] + seriesopts, _('hg qseries [-ms]')), - "^strip": + "strip": (strip, [('f', 'force', None, _('force removal of changesets even if the ' 'working directory has uncommitted changes')), @@ -2826,7 +2973,7 @@ ' number greater than REV which are not' ' descendants of REV (DEPRECATED)')), ('n', 'nobackup', None, _('no backups'))], - _('hg strip [-f] [-b] [-n] REV')), + _('hg strip [-f] [-n] REV')), "qtop": (top, [] + seriesopts, _('hg qtop [-s]')), "qunapplied": (unapplied, @@ -2836,4 +2983,20 @@ (finish, [('a', 'applied', None, _('finish all applied changesets'))], _('hg qfinish [-a] [REV]...')), + 'qqueue': + (qqueue, + [ + ('l', 'list', False, _('list all available queues')), + ('c', 'create', False, _('create new queue')), + ('', 'delete', False, _('delete reference to queue')), + ], + _('[OPTION] [QUEUE]')), } + +colortable = {'qguard.negative': 'red', + 'qguard.positive': 'yellow', + 'qguard.unguarded': 'green', + 'qseries.applied': 'blue bold underline', + 'qseries.guarded': 'black bold', + 'qseries.missing': 'red bold', + 'qseries.unapplied': 'black bold'} diff -Nru mercurial-1.5.4/hgext/pager.py mercurial-1.6/hgext/pager.py --- mercurial-1.5.4/hgext/pager.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/pager.py 2010-07-01 18:06:27.000000000 +0100 @@ -45,8 +45,8 @@ If pager.attend is present, pager.ignore will be ignored. -To ignore global commands like "hg version" or "hg help", you have to -specify them in the global .hgrc +To ignore global commands like :hg:`version` or :hg:`help`, you have +to specify them in the global .hgrc ''' import sys, os, signal, shlex, errno @@ -78,12 +78,16 @@ raise def uisetup(ui): + if ui.plain(): + return + def pagecmd(orig, ui, options, cmd, cmdfunc): p = ui.config("pager", "pager", os.environ.get("PAGER")) if p and sys.stdout.isatty() and '--debugger' not in sys.argv: attend = ui.configlist('pager', 'attend', attended) if (cmd in attend or (cmd not in ui.configlist('pager', 'ignore') and not attend)): + ui.setconfig('ui', 'formatted', ui.formatted()) ui.setconfig('ui', 'interactive', False) _runpager(p) if ui.configbool('pager', 'quiet'): diff -Nru mercurial-1.5.4/hgext/patchbomb.py mercurial-1.6/hgext/patchbomb.py --- mercurial-1.5.4/hgext/patchbomb.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/patchbomb.py 2010-07-01 18:06:27.000000000 +0100 @@ -16,7 +16,7 @@ - The changeset description. - [Optional] The result of running diffstat on the patch. -- The patch itself, as generated by "hg export". +- The patch itself, as generated by :hg:`export`. 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 @@ -34,15 +34,16 @@ to = recipient1, recipient2, ... cc = cc1, cc2, ... bcc = bcc1, bcc2, ... + reply-to = address1, address2, ... Use ``[patchbomb]`` as configuration section name if you need to override global ``[email]`` address settings. -Then you can use the "hg email" command to mail a series of changesets -as a patchbomb. +Then you can use the :hg:`email` command to mail a series of +changesets as a patchbomb. To avoid sending patches prematurely, it is a good idea to first run -the "email" command with the "-n" option (test only). You will be +the :hg:`email` command with the "-n" option (test only). 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 @@ -75,7 +76,7 @@ import os, errno, socket, tempfile, cStringIO, time import email.MIMEMultipart, email.MIMEBase import email.Utils, email.Encoders, email.Generator -from mercurial import cmdutil, commands, hg, mail, patch, util +from mercurial import cmdutil, commands, hg, mail, patch, util, discovery from mercurial.i18n import _ from mercurial.node import bin @@ -105,6 +106,10 @@ raise util.Abort(_('diffstat rejected')) return s +def introneeded(opts, number): + '''is an introductory message required?''' + return number > 1 or opts.get('intro') or opts.get('desc') + def makepatch(ui, repo, patch, opts, _charsets, idx, total, patchname=None): desc = [] @@ -170,7 +175,7 @@ flag = ' ' + flag subj = desc[0].strip().rstrip('. ') - if total == 1 and not opts.get('intro'): + if not introneeded(opts, total): subj = '[PATCH%s] %s' % (flag, opts.get('subject') or subj) else: tlen = len(str(total)) @@ -182,9 +187,9 @@ def patchbomb(ui, repo, *revs, **opts): '''send changesets by email - By default, diffs are sent in the format generated by hg export, - one per message. The series starts with a "[PATCH 0 of N]" - introduction, which describes the series as a whole. + By default, diffs are sent in the format generated by + :hg:`export`, one per message. The series starts with a "[PATCH 0 + of N]" introduction, which describes the series as a whole. Each patch email has a Subject line of "[PATCH M of N] ...", using the first line of the changeset description as the subject text. @@ -192,7 +197,7 @@ description. Next, (optionally) if the diffstat program is installed and -d/--diffstat is used, the result of running diffstat on the patch. Finally, the patch itself, as generated by - "hg export". + :hg:`export`. By default the patch is included as text in the email body for easy reviewing. Using the -a/--attach option will instead create @@ -230,16 +235,24 @@ _charsets = mail._charsets(ui) - def outgoing(dest, revs): + bundle = opts.get('bundle') + date = opts.get('date') + mbox = opts.get('mbox') + outgoing = opts.get('outgoing') + rev = opts.get('rev') + # internal option used by pbranches + patches = opts.get('patches') + + def getoutgoing(dest, revs): '''Return the revisions present locally but not in dest''' dest = ui.expandpath(dest or 'default-push', dest or 'default') dest, branches = hg.parseurl(dest) revs, checkout = hg.addbranchrevs(repo, repo, branches, revs) if revs: revs = [repo.lookup(rev) for rev in revs] - other = hg.repository(cmdutil.remoteui(repo, opts), dest) + other = hg.repository(hg.remoteui(repo, opts), dest) ui.status(_('comparing with %s\n') % dest) - o = repo.findoutgoing(other) + o = discovery.findoutgoing(repo, other) if not o: ui.status(_("no changes found\n")) return [] @@ -249,7 +262,7 @@ def getpatches(revs): for r in cmdutil.revrange(repo, revs): output = cStringIO.StringIO() - patch.export(repo, [r], fp=output, + cmdutil.export(repo, [r], fp=output, opts=patch.diffopts(ui, opts)) yield output.getvalue().split('\n') @@ -266,38 +279,36 @@ pass os.rmdir(tmpdir) - if not (opts.get('test') or opts.get('mbox')): + if not (opts.get('test') or mbox): # really sending mail.validateconfig(ui) - if not (revs or opts.get('rev') - or opts.get('outgoing') or opts.get('bundle') - or opts.get('patches')): + if not (revs or rev or outgoing or bundle or patches): raise util.Abort(_('specify at least one changeset with -r or -o')) - if opts.get('outgoing') and opts.get('bundle'): + if outgoing and bundle: raise util.Abort(_("--outgoing mode always on with --bundle;" " do not re-specify --outgoing")) - if opts.get('outgoing') or opts.get('bundle'): + if outgoing or bundle: if len(revs) > 1: raise util.Abort(_("too many destinations")) dest = revs and revs[0] or None revs = [] - if opts.get('rev'): + if rev: if revs: raise util.Abort(_('use only one form to specify the revision')) - revs = opts.get('rev') + revs = rev - if opts.get('outgoing'): - revs = outgoing(dest, opts.get('rev')) - if opts.get('bundle'): + if outgoing: + revs = getoutgoing(dest, rev) + if bundle: opts['revs'] = revs # start - if opts.get('date'): - start_time = util.parsedate(opts.get('date')) + if date: + start_time = util.parsedate(date) else: start_time = util.makedate() @@ -329,7 +340,7 @@ len(patches), name) msgs.append(msg) - if len(patches) > 1 or opts.get('intro'): + if introneeded(opts, len(patches)): tlen = len(str(len(patches))) flag = ' '.join(opts.get('flag')) @@ -376,18 +387,17 @@ ui.config('patchbomb', 'from') or prompt(ui, 'From', ui.username())) - # internal option used by pbranches - patches = opts.get('patches') if patches: msgs = getpatchmsgs(patches, opts.get('patchnames')) - elif opts.get('bundle'): + elif bundle: msgs = getbundlemsgs(getbundle(dest)) else: msgs = getpatchmsgs(list(getpatches(revs))) def getaddrs(opt, prpt=None, default=None): - if opts.get(opt): - return mail.addrlistencode(ui, opts.get(opt), _charsets, + addrs = opts.get(opt.replace('-', '_')) + if addrs: + return mail.addrlistencode(ui, addrs, _charsets, opts.get('test')) addrs = (ui.config('email', opt) or @@ -400,6 +410,7 @@ to = getaddrs('to', 'To') cc = getaddrs('cc', 'Cc', '') bcc = getaddrs('bcc') + replyto = getaddrs('reply-to') ui.write('\n') @@ -438,10 +449,12 @@ m['Cc'] = ', '.join(cc) if bcc: m['Bcc'] = ', '.join(bcc) + if replyto: + m['Reply-To'] = ', '.join(replyto) if opts.get('test'): ui.status(_('Displaying '), subj, ' ...\n') ui.flush() - if 'PAGER' in os.environ: + if 'PAGER' in os.environ and not ui.plain(): fp = util.popen(os.environ['PAGER'], 'w') else: fp = ui @@ -454,9 +467,9 @@ raise if fp is not ui: fp.close() - elif opts.get('mbox'): + elif mbox: ui.status(_('Writing '), subj, ' ...\n') - fp = open(opts.get('mbox'), 'In-Reply-To' in m and 'ab+' or 'wb+') + fp = open(mbox, 'In-Reply-To' in m and 'ab+' or 'wb+') generator = email.Generator.Generator(fp, mangle_from_=True) # Should be time.asctime(), but Windows prints 2-characters day # of month instead of one. Make them print the same thing. @@ -489,6 +502,7 @@ ('n', 'test', None, _('print messages that would be sent')), ('m', 'mbox', '', _('write messages to mbox file instead of sending them')), + ('', 'reply-to', [], _('email addresses replies should be sent to')), ('s', 'subject', '', _('subject of first message (intro or single patch)')), ('', 'in-reply-to', '', @@ -508,14 +522,16 @@ ('b', 'bundle', None, _('send changes not in target as a binary bundle')), ('', 'bundlename', 'bundle', - _('name of the bundle attachment file')), - ('r', 'rev', [], _('a revision to send')), + _('name of the bundle attachment file'), _('NAME')), + ('r', 'rev', [], + _('a revision to send'), _('REV')), ('', 'force', None, _('run even when remote repository is unrelated ' '(with -b/--bundle)')), ('', 'base', [], _('a base changeset to specify instead of a destination ' - '(with -b/--bundle)')), + '(with -b/--bundle)'), + _('REV')), ('', 'intro', None, _('send an introduction email for a single patch')), ] + emailopts + commands.remoteopts, diff -Nru mercurial-1.5.4/hgext/progress.py mercurial-1.6/hgext/progress.py --- mercurial-1.5.4/hgext/progress.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/progress.py 2010-07-01 18:06:27.000000000 +0100 @@ -51,6 +51,9 @@ def spacejoin(*args): return ' '.join(s for s in args if s) +def shouldprint(ui): + return sys.stderr.isatty() or ui.configbool('progress', 'assume-tty') + class progbar(object): def __init__(self, ui): self.ui = ui @@ -69,6 +72,8 @@ default=['topic', 'bar', 'number']) def show(self, topic, pos, item, unit, total): + if not shouldprint(self.ui): + return termwidth = self.width() self.printed = True head = '' @@ -114,7 +119,7 @@ if tail: used += len(tail) + 1 progwidth = termwidth - used - 3 - if total: + if total and pos <= total: amt = pos * progwidth // total bar = '=' * (amt - 1) if amt > 0: @@ -137,9 +142,13 @@ sys.stderr.flush() def clear(self): + if not shouldprint(self.ui): + return sys.stderr.write('\r%s\r' % (' ' * self.width())) def complete(self): + if not shouldprint(self.ui): + return if self.ui.configbool('progress', 'clear-complete', default=True): self.clear() else: @@ -165,10 +174,10 @@ self.show(topic, pos, item, unit, total) return orig(topic, pos, item=item, unit=unit, total=total) - def write(self, orig, *args): + def write(self, orig, *args, **opts): if self.printed: self.clear() - return orig(*args) + return orig(*args, **opts) sharedprog = None @@ -177,8 +186,7 @@ # setconfig('progress', 'disable', 'True') to disable this extension if ui.configbool('progress', 'disable'): return - if ((sys.stderr.isatty() or ui.configbool('progress', 'assume-tty')) - and not ui.debugflag and not ui.quiet): + if shouldprint(ui) and not ui.debugflag and not ui.quiet: # we instantiate one globally shared progress bar to avoid # competing progress bars when multiple UI objects get created global sharedprog diff -Nru mercurial-1.5.4/hgext/purge.py mercurial-1.6/hgext/purge.py --- mercurial-1.5.4/hgext/purge.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/purge.py 2010-07-01 18:06:27.000000000 +0100 @@ -37,7 +37,7 @@ This means that purge will delete: - - Unknown files: files marked with "?" by "hg status" + - Unknown files: files marked with "?" by :hg:`status` - Empty directories: in fact Mercurial ignores directories unless they contain files under source control management @@ -45,7 +45,7 @@ - Modified and unmodified tracked files - Ignored files (unless --all is specified) - - New files added to the repository (with "hg add") + - New files added to the repository (with :hg:`add`) If directories are given on the command line, only files in these directories are considered. diff -Nru mercurial-1.5.4/hgext/rebase.py mercurial-1.6/hgext/rebase.py --- mercurial-1.5.4/hgext/rebase.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/rebase.py 2010-07-01 18:06:27.000000000 +0100 @@ -14,7 +14,7 @@ http://mercurial.selenic.com/wiki/RebaseExtension ''' -from mercurial import util, repair, merge, cmdutil, commands, error +from mercurial import hg, util, repair, merge, cmdutil, commands, error from mercurial import extensions, ancestor, copies, patch from mercurial.commands import templateopts from mercurial.node import nullrev @@ -69,6 +69,8 @@ If a rebase is interrupted to manually resolve a merge, it can be continued with --continue/-c or aborted with --abort/-a. + + Returns 0 on success, 1 if nothing to rebase. """ originalwd = target = None external = nullrev @@ -92,46 +94,43 @@ keepf = opts.get('keep', False) keepbranchesf = opts.get('keepbranches', False) detachf = opts.get('detach', False) + # keepopen is not meant for use on the command line, but by + # other extensions + keepopen = opts.get('keepopen', False) if contf or abortf: if contf and abortf: - raise error.ParseError('rebase', - _('cannot use both abort and continue')) + raise util.Abort(_('cannot use both abort and continue')) if collapsef: - raise error.ParseError( - 'rebase', _('cannot use collapse with continue or abort')) - + raise util.Abort( + _('cannot use collapse with continue or abort')) if detachf: - raise error.ParseError( - 'rebase', _('cannot use detach with continue or abort')) - + raise util.Abort(_('cannot use detach with continue or abort')) if srcf or basef or destf: - raise error.ParseError('rebase', + raise util.Abort( _('abort and continue do not allow specifying revisions')) (originalwd, target, state, collapsef, keepf, keepbranchesf, external) = restorestatus(repo) if abortf: - abort(repo, originalwd, target, state) - return + return abort(repo, originalwd, target, state) else: if srcf and basef: - raise error.ParseError('rebase', _('cannot specify both a ' - 'revision and a base')) + raise util.Abort(_('cannot specify both a ' + 'revision and a base')) if detachf: if not srcf: - raise error.ParseError( - 'rebase', _('detach requires a revision to be specified')) + raise util.Abort( + _('detach requires a revision to be specified')) if basef: - raise error.ParseError( - 'rebase', _('cannot specify a base with detach')) + raise util.Abort(_('cannot specify a base with detach')) cmdutil.bail_if_changed(repo) result = buildstate(repo, destf, srcf, basef, detachf) if not result: # Empty state built, nothing to rebase ui.status(_('nothing to rebase\n')) - return + return 1 else: originalwd, target, state = result if collapsef: @@ -140,8 +139,7 @@ if keepbranchesf: if extrafn: - raise error.ParseError( - 'rebase', _('cannot use both keepbranches and extrafn')) + raise util.Abort(_('cannot use both keepbranches and extrafn')) def extrafn(ctx, extra): extra['branch'] = ctx.branch() @@ -183,7 +181,7 @@ ui.note(_('rebase merging completed\n')) - if collapsef: + if collapsef and not keepopen: p1, p2 = defineparents(repo, min(state), target, state, targetancestors) commitmsg = 'Collapsed revision' @@ -205,10 +203,11 @@ ui.warn(_("warning: new changesets detected " "on source branch, not stripping\n")) else: - repair.strip(ui, repo, repo[min(rebased)].node(), "strip") + # backup the old csets by default + repair.strip(ui, repo, repo[min(rebased)].node(), "all") clearstatus(repo) - ui.status(_("rebase completed\n")) + ui.note(_("rebase completed\n")) if os.path.exists(repo.sjoin('undo')): util.unlink(repo.sjoin('undo')) if skipped: @@ -349,10 +348,10 @@ 'Update rebased mq patches - finalize and then import them' mqrebase = {} for p in repo.mq.applied: - if repo[p.rev].rev() in state: + if repo[p.node].rev() in state: repo.ui.debug('revision %d is an mq patch (%s), finalize it.\n' % - (repo[p.rev].rev(), p.name)) - mqrebase[repo[p.rev].rev()] = (p.name, isagitpatch(repo, p.name)) + (repo[p.node].rev(), p.name)) + mqrebase[repo[p.node].rev()] = (p.name, isagitpatch(repo, p.name)) if mqrebase: repo.mq.finish(repo, mqrebase.keys()) @@ -423,16 +422,19 @@ 'Restore the repository to its original state' if set(repo.changelog.descendants(target)) - set(state.values()): repo.ui.warn(_("warning: new changesets detected on target branch, " - "not stripping\n")) + "can't abort\n")) + return -1 else: # Strip from the first rebased revision merge.update(repo, repo[originalwd].rev(), False, True, False) - rebased = filter(lambda x: x > -1, state.values()) + rebased = filter(lambda x: x > -1 and x != target, state.values()) if rebased: strippoint = min(rebased) - repair.strip(repo.ui, repo, repo[strippoint].node(), "strip") + # no backup of rebased cset versions needed + repair.strip(repo.ui, repo, repo[strippoint].node()) clearstatus(repo) repo.ui.status(_('rebase aborted\n')) + return 0 def buildstate(repo, dest, src, base, detach): 'Define which revisions are going to be rebased and where' @@ -449,8 +451,8 @@ # This check isn't strictly necessary, since mq detects commits over an # applied patch. But it prevents messing up the working directory when # a partially completed rebase is blocked by mq. - if 'qtip' in repo.tags() and (repo[dest].hex() in - [s.rev for s in repo.mq.applied]): + if 'qtip' in repo.tags() and (repo[dest].node() in + [s.node for s in repo.mq.applied]): raise util.Abort(_('cannot rebase onto an applied mq patch')) if src: @@ -506,7 +508,14 @@ cmdutil.bail_if_changed(repo) revsprepull = len(repo) - orig(ui, repo, *args, **opts) + origpostincoming = commands.postincoming + def _dummy(*args, **kwargs): + pass + commands.postincoming = _dummy + try: + orig(ui, repo, *args, **opts) + finally: + commands.postincoming = origpostincoming revspostpull = len(repo) if revspostpull > revsprepull: rebase(ui, repo, **opts) @@ -514,7 +523,7 @@ dest = repo[branch].rev() if dest != repo['.'].rev(): # there was nothing to rebase we force an update - merge.update(repo, dest, False, False, False) + hg.update(repo, dest) else: orig(ui, repo, *args, **opts) @@ -529,10 +538,14 @@ "rebase": (rebase, [ - ('s', 'source', '', _('rebase from the specified changeset')), - ('b', 'base', '', _('rebase from the base of the specified changeset ' - '(up to greatest common ancestor of base and dest)')), - ('d', 'dest', '', _('rebase onto the specified changeset')), + ('s', 'source', '', + _('rebase from the specified changeset'), _('REV')), + ('b', 'base', '', + _('rebase from the base of the specified changeset ' + '(up to greatest common ancestor of base and dest)'), + _('REV')), + ('d', 'dest', '', + _('rebase onto the specified changeset'), _('REV')), ('', 'collapse', False, _('collapse the rebased changesets')), ('', 'keep', False, _('keep original changesets')), ('', 'keepbranches', False, _('keep original branch names')), diff -Nru mercurial-1.5.4/hgext/record.py mercurial-1.6/hgext/record.py --- mercurial-1.5.4/hgext/record.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/record.py 2010-07-01 18:06:27.000000000 +0100 @@ -293,6 +293,7 @@ _('&Quit, recording no changes'), _('&?')) r = ui.promptchoice("%s %s" % (query, resps), choices) + ui.write("\n") if r == 7: # ? doc = gettext(record.__doc__) c = doc.find('::') + 2 @@ -359,10 +360,10 @@ def record(ui, repo, *pats, **opts): '''interactively select changes to commit - If a list of files is omitted, all changes reported by "hg status" + If a list of files is omitted, all changes reported by :hg:`status` will be candidates for recording. - See 'hg help dates' for a list of formats valid for -d/--date. + See :hg:`help dates` for a list of formats valid for -d/--date. You will be prompted for whether to record changes to each modified file, and for files with multiple changes, for each @@ -389,7 +390,7 @@ def qrecord(ui, repo, patch, *pats, **opts): '''interactively record a new patch - See 'hg help qnew' & 'hg help record' for more information and + See :hg:`help qnew` & :hg:`help record` for more information and usage. ''' @@ -526,7 +527,18 @@ os.rmdir(backupdir) except OSError: pass - return cmdutil.commit(ui, repo, recordfunc, pats, opts) + + # wrap ui.write so diff output can be labeled/colorized + def wrapwrite(orig, *args, **kw): + label = kw.pop('label', '') + for chunk, l in patch.difflabel(lambda: args): + orig(chunk, label=label + l) + oldwrite = ui.write + extensions.wrapfunction(ui, 'write', wrapwrite) + try: + return cmdutil.commit(ui, repo, recordfunc, pats, opts) + finally: + ui.write = oldwrite cmdtable = { "record": @@ -550,7 +562,7 @@ (qrecord, # add qnew options, except '--force' - [opt for opt in mq.cmdtable['qnew'][1] if opt[1] != 'force'], + [opt for opt in mq.cmdtable['^qnew'][1] if opt[1] != 'force'], _('hg qrecord [OPTION]... PATCH [FILE]...')), } diff -Nru mercurial-1.5.4/hgext/relink.py mercurial-1.6/hgext/relink.py --- mercurial-1.5.4/hgext/relink.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/relink.py 2010-07-01 18:06:27.000000000 +0100 @@ -39,7 +39,7 @@ if not hasattr(util, 'samefile') or not hasattr(util, 'samedevice'): raise util.Abort(_('hardlinks are not supported on this system')) src = hg.repository( - cmdutil.remoteui(repo, opts), + hg.remoteui(repo, opts), ui.expandpath(origin or 'default-relink', origin or 'default')) if not src.local(): raise util.Abort('must specify local origin repository') @@ -48,7 +48,7 @@ try: remotelock = src.lock() try: - candidates = sorted(collect(src.store.path, ui)) + candidates = sorted(collect(src, ui)) targets = prune(candidates, src.store.path, repo.store.path, ui) do_relink(src.store.path, repo.store.path, targets, ui) finally: @@ -59,16 +59,32 @@ def collect(src, ui): seplen = len(os.path.sep) candidates = [] + live = len(src['tip'].manifest()) + # Your average repository has some files which were deleted before + # the tip revision. We account for that by assuming that there are + # 3 tracked files for every 2 live files as of the tip version of + # the repository. + # + # mozilla-central as of 2010-06-10 had a ratio of just over 7:5. + total = live * 3 // 2 + src = src.store.path + pos = 0 + ui.status(_("tip has %d files, estimated total number of files: %s\n") + % (live, total)) for dirpath, dirnames, filenames in os.walk(src): + dirnames.sort() relpath = dirpath[len(src) + seplen:] - for filename in filenames: + for filename in sorted(filenames): if not filename[-2:] in ('.d', '.i'): continue st = os.stat(os.path.join(dirpath, filename)) if not stat.S_ISREG(st.st_mode): continue + pos += 1 candidates.append((os.path.join(relpath, filename), st)) + ui.progress(_('collecting'), pos, filename, _('files'), total) + ui.progress(_('collecting'), None) ui.status(_('collected %d candidate storage files\n') % len(candidates)) return candidates @@ -90,7 +106,10 @@ return st targets = [] + total = len(candidates) + pos = 0 for fn, st in candidates: + pos += 1 srcpath = os.path.join(src, fn) tgt = os.path.join(dst, fn) ts = linkfilter(srcpath, tgt, st) @@ -98,7 +117,9 @@ ui.debug(_('not linkable: %s\n') % fn) continue targets.append((fn, ts.st_size)) + ui.progress(_('pruning'), pos, fn, _(' files'), total) + ui.progress(_('pruning'), None) ui.status(_('pruned down to %d probably relinkable files\n') % len(targets)) return targets @@ -145,7 +166,7 @@ except OSError, inst: ui.warn('%s: %s\n' % (tgt, str(inst))) - ui.progress(_('relinking'), None, unit=_(' files'), total=total) + ui.progress(_('relinking'), None) ui.status(_('relinked %d files (%d bytes reclaimed)\n') % (relinked, savedbytes)) diff -Nru mercurial-1.5.4/hgext/transplant.py mercurial-1.6/hgext/transplant.py --- mercurial-1.5.4/hgext/transplant.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/transplant.py 2010-07-01 18:06:27.000000000 +0100 @@ -16,7 +16,7 @@ from mercurial.i18n import _ import os, tempfile from mercurial import bundlerepo, changegroup, cmdutil, hg, merge, match -from mercurial import patch, revlog, util, error +from mercurial import patch, revlog, util, error, discovery class transplantentry(object): def __init__(self, lnode, rnode): @@ -341,7 +341,7 @@ node = revlog.bin(line[10:]) elif line.startswith('# Parent '): parents.append(revlog.bin(line[9:])) - elif not line.startswith('#'): + elif not line.startswith('# '): inmsg = True message.append(line) return (node, user, date, '\n'.join(message), parents) @@ -453,7 +453,7 @@ transplanted, otherwise you will be prompted to select the changesets you want. - hg transplant --branch REVISION --all will rebase the selected + :hg:`transplant --branch REVISION --all` will rebase the selected branch (up to the named revision) onto your current working directory. @@ -462,17 +462,18 @@ of a merged transplant, and you can merge descendants of them normally instead of transplanting them. - If no merges or revisions are provided, hg transplant will start - an interactive changeset browser. + If no merges or revisions are provided, :hg:`transplant` will + start an interactive changeset browser. If a changeset application fails, you can fix the merge by hand - and then resume where you left off by calling hg transplant - --continue/-c. + and then resume where you left off by calling :hg:`transplant + --continue/-c`. ''' def getremotechanges(repo, url): sourcerepo = ui.expandpath(url) source = hg.repository(ui, sourcerepo) - common, incoming, rheads = repo.findcommonincoming(source, force=True) + tmp = discovery.findcommonincoming(repo, source, force=True) + common, incoming, rheads = tmp if not incoming: return (source, None, None) @@ -591,15 +592,20 @@ cmdtable = { "transplant": (transplant, - [('s', 'source', '', _('pull patches from REPOSITORY')), - ('b', 'branch', [], _('pull patches from branch BRANCH')), + [('s', 'source', '', + _('pull patches from REPO'), _('REPO')), + ('b', 'branch', [], + _('pull patches from branch BRANCH'), _('BRANCH')), ('a', 'all', None, _('pull all changesets up to BRANCH')), - ('p', 'prune', [], _('skip over REV')), - ('m', 'merge', [], _('merge at REV')), + ('p', 'prune', [], + _('skip over REV'), _('REV')), + ('m', 'merge', [], + _('merge at REV'), _('REV')), ('', 'log', None, _('append transplant info to log message')), ('c', 'continue', None, _('continue last transplant session ' 'after repair')), - ('', 'filter', '', _('filter changesets through FILTER'))], - _('hg transplant [-s REPOSITORY] [-b BRANCH [-a]] [-p REV] ' + ('', 'filter', '', + _('filter changesets through command'), _('CMD'))], + _('hg transplant [-s REPO] [-b BRANCH [-a]] [-p REV] ' '[-m REV] [REV]...')) } diff -Nru mercurial-1.5.4/hgext/win32text.py mercurial-1.6/hgext/win32text.py --- mercurial-1.5.4/hgext/win32text.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/win32text.py 2010-07-01 18:06:27.000000000 +0100 @@ -7,6 +7,14 @@ '''perform automatic newline conversion + 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. + + We have therefore made the ``eol`` as an alternative. The ``eol`` + uses a version controlled file for its configuration and each clone + will therefore use the right settings from the start. + To perform automatic newline conversion, use:: [extensions] diff -Nru mercurial-1.5.4/hgext/zeroconf/__init__.py mercurial-1.6/hgext/zeroconf/__init__.py --- mercurial-1.5.4/hgext/zeroconf/__init__.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/zeroconf/__init__.py 2010-07-01 18:06:27.000000000 +0100 @@ -23,7 +23,9 @@ zc-test = http://example.com:8000/test ''' -import Zeroconf, socket, time, os +import socket, time, os + +import Zeroconf from mercurial import ui, hg, encoding from mercurial import extensions from mercurial.hgweb import hgweb_mod @@ -98,16 +100,17 @@ server.registerService(svc) class hgwebzc(hgweb_mod.hgweb): - def __init__(self, repo, name=None): - super(hgwebzc, self).__init__(repo, name) - name = self.reponame or os.path.basename(repo.root) + def __init__(self, repo, name=None, baseui=None): + super(hgwebzc, self).__init__(repo, name=name, baseui=baseui) + name = self.reponame or os.path.basename(self.repo.root) path = self.repo.ui.config("web", "prefix", "").strip('/') desc = self.repo.ui.config("web", "description", name) - publish(name, desc, path, int(repo.ui.config("web", "port", 8000))) + publish(name, desc, path, + int(self.repo.ui.config("web", "port", 8000))) class hgwebdirzc(hgwebdir_mod.hgwebdir): def __init__(self, conf, baseui=None): - super(hgwebdirzc, self).__init__(conf, baseui) + super(hgwebdirzc, self).__init__(conf, baseui=baseui) prefix = self.ui.config("web", "prefix", "").strip('/') + '/' for repo, path in self.repos: u = self.ui.copy() diff -Nru mercurial-1.5.4/hgext/zeroconf/Zeroconf.py mercurial-1.6/hgext/zeroconf/Zeroconf.py --- mercurial-1.5.4/hgext/zeroconf/Zeroconf.py 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgext/zeroconf/Zeroconf.py 2010-07-01 18:06:27.000000000 +0100 @@ -204,6 +204,13 @@ class BadTypeInNameException(Exception): pass +class BadDomainName(Exception): + def __init__(self, pos): + Exception.__init__(self, "at position %s" % pos) + +class BadDomainNameCircular(BadDomainName): + pass + # implementation classes class DNSEntry(object): @@ -598,10 +605,10 @@ next = off + 1 off = ((len & 0x3F) << 8) | ord(self.data[off]) if off >= first: - raise "Bad domain name (circular) at " + str(off) + raise BadDomainNameCircular(off) first = off else: - raise "Bad domain name at " + str(off) + raise BadDomainName(off) if next >= 0: self.offset = next diff -Nru mercurial-1.5.4/.hgignore mercurial-1.6/.hgignore --- mercurial-1.5.4/.hgignore 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/.hgignore 2010-07-01 18:06:26.000000000 +0100 @@ -25,6 +25,7 @@ MANIFEST patches mercurial/__version__.py +mercurial.egg-info Output/Mercurial-*.exe .DS_Store tags diff -Nru mercurial-1.5.4/.hgsigs mercurial-1.6/.hgsigs --- mercurial-1.5.4/.hgsigs 2010-06-01 16:54:03.000000000 +0100 +++ mercurial-1.6/.hgsigs 2010-07-01 18:06:31.000000000 +0100 @@ -22,3 +22,4 @@ 2b01dab594167bc0dd33331dbaa6dca3dca1b3aa 0 iEYEABECAAYFAku1IwIACgkQywK+sNU5EO9MjgCdHLVwkTZlNHxhcznZKBL1rjN+J7cAoLLWi9LTL6f/TgBaPSKOy1ublbaW 39f725929f0c48c5fb3b90c071fc3066012456ca 0 iEYEABECAAYFAkvclvsACgkQywK+sNU5EO9FSwCeL9i5x8ALW/LE5+lCX6MFEAe4MhwAn1ev5o6SX6GrNdDfKweiemfO2VBk fdcf80f26604f233dc4d8f0a5ef9d7470e317e8a 0 iEYEABECAAYFAkvsKTkACgkQywK+sNU5EO9qEACgiSiRGvTG2vXGJ65tUSOIYihTuFAAnRzRIqEVSw8M8/RGeUXRps0IzaCO +24fe2629c6fd0c74c90bd066e77387c2b02e8437 0 iEYEABECAAYFAkwFLRsACgkQywK+sNU5EO+pJACgp13tPI+pbwKZV+LeMjcQ4H6tCZYAoJebzhd6a8yYx6qiwpJxA9BXZNXy diff -Nru mercurial-1.5.4/.hgtags mercurial-1.6/.hgtags --- mercurial-1.5.4/.hgtags 2010-06-01 16:54:03.000000000 +0100 +++ mercurial-1.6/.hgtags 2010-07-01 18:06:31.000000000 +0100 @@ -34,3 +34,4 @@ 2b01dab594167bc0dd33331dbaa6dca3dca1b3aa 1.5.1 39f725929f0c48c5fb3b90c071fc3066012456ca 1.5.2 fdcf80f26604f233dc4d8f0a5ef9d7470e317e8a 1.5.3 +24fe2629c6fd0c74c90bd066e77387c2b02e8437 1.5.4 diff -Nru mercurial-1.5.4/hgweb.cgi mercurial-1.6/hgweb.cgi --- mercurial-1.5.4/hgweb.cgi 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgweb.cgi 2010-07-01 18:06:27.000000000 +0100 @@ -1,28 +1,17 @@ #!/usr/bin/env python # -# An example CGI script to use hgweb, edit as necessary +# An example hgweb CGI script, edit as necessary -# adjust python path if not a system-wide install: -#import sys -#sys.path.insert(0, "/path/to/python/lib") +# Path to repo or hgweb config to serve (see 'hg help hgweb') +config = "/path/to/repo/or/config" -# enable importing on demand to reduce startup time -from mercurial import demandimport; demandimport.enable() +# Uncomment and adjust if Mercurial is not installed system-wide: +#import sys; sys.path.insert(0, "/path/to/python/lib") # Uncomment to send python tracebacks to the browser if an error occurs: -#import cgitb -#cgitb.enable() - -# If you'd like to serve pages with UTF-8 instead of your default -# locale charset, you can do so by uncommenting the following lines. -# Note that this will cause your .hgrc files to be interpreted in -# UTF-8 and all your repo files to be displayed using UTF-8. -# -#import os -#os.environ["HGENCODING"] = "UTF-8" +#import cgitb; cgitb.enable() -from mercurial.hgweb.hgweb_mod import hgweb -import mercurial.hgweb.wsgicgi as wsgicgi - -application = hgweb("/path/to/repo", "repository name") +from mercurial import demandimport; demandimport.enable() +from mercurial.hgweb import hgweb, wsgicgi +application = hgweb(config) wsgicgi.launch(application) diff -Nru mercurial-1.5.4/hgwebdir.cgi mercurial-1.6/hgwebdir.cgi --- mercurial-1.5.4/hgwebdir.cgi 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/hgwebdir.cgi 1970-01-01 01:00:00.000000000 +0100 @@ -1,67 +0,0 @@ -#!/usr/bin/env python -# -# An example CGI script to export multiple hgweb repos, edit as necessary - -# adjust python path if not a system-wide install: -#import sys -#sys.path.insert(0, "/path/to/python/lib") - -# enable importing on demand to reduce startup time -from mercurial import demandimport; demandimport.enable() - -# Uncomment to send python tracebacks to the browser if an error occurs: -#import cgitb -#cgitb.enable() - -# If you'd like to serve pages with UTF-8 instead of your default -# locale charset, you can do so by uncommenting the following lines. -# Note that this will cause your .hgrc files to be interpreted in -# UTF-8 and all your repo files to be displayed using UTF-8. -# -#import os -#os.environ["HGENCODING"] = "UTF-8" - -from mercurial.hgweb.hgwebdir_mod import hgwebdir -import mercurial.hgweb.wsgicgi as wsgicgi - -# The config file looks like this. You can have paths to individual -# repos, collections of repos in a directory tree, or both. -# -# [paths] -# virtual/path1 = /real/path1 -# virtual/path2 = /real/path2 -# virtual/root = /real/root/* -# / = /real/root2/* -# virtual/root2 = /real/root2/** -# -# [collections] -# /prefix/to/strip/off = /root/of/tree/full/of/repos -# -# paths example: -# -# * First two lines mount one repository into one virtual path, like -# '/real/path1' into 'virtual/path1'. -# -# * The third entry mounts every mercurial repository found in '/real/root' -# in 'virtual/root'. This format is preferred over the [collections] one, -# since using absolute paths as configuration keys is not supported on every -# platform (especially on Windows). -# -# * The fourth entry is a special case mounting all repositories in -# /'real/root2' in the root of the virtual directory. -# -# * The fifth entry recursively finds all repositories under the real root, -# and mounts them using their relative path (to given real root) under the -# virtual root. -# -# collections example: say directory tree /foo contains repos /foo/bar, -# /foo/quux/baz. Give this config section: -# [collections] -# /foo = /foo -# Then repos will list as bar and quux/baz. -# -# Alternatively you can pass a list of ('virtual/path', '/real/path') tuples -# or use a dictionary with entries like 'virtual/path': '/real/path' - -application = hgwebdir('hgweb.config') -wsgicgi.launch(application) diff -Nru mercurial-1.5.4/i18n/da.po mercurial-1.6/i18n/da.po --- mercurial-1.5.4/i18n/da.po 2010-06-01 16:53:59.000000000 +0100 +++ mercurial-1.6/i18n/da.po 2010-07-01 18:06:27.000000000 +0100 @@ -17,9 +17,9 @@ msgstr "" "Project-Id-Version: Mercurial\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-05-08 22:29+0200\n" -"PO-Revision-Date: 2010-05-08 23:40+0200\n" -"Last-Translator: \n" +"POT-Creation-Date: 2010-07-01 14:56+0200\n" +"PO-Revision-Date: 2010-07-01 15:23+0200\n" +"Last-Translator: \n" "Language-Team: Danish\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -36,111 +36,294 @@ msgid "Commands" msgstr "Kommandoer" -msgid "" -" options:\n" -"\n" -msgstr "" -" tilvalg:\n" -"\n" +msgid " options:" +msgstr " tilvalg:" #, python-format +msgid " aliases: %s" +msgstr " aliaser %s:" + +msgid "hooks for controlling repository access" +msgstr "" + msgid "" -" aliases: %s\n" -"\n" +"This hook makes it possible to allow or deny write access to given\n" +"branches and paths of a repository when receiving incoming changesets\n" +"via pretxnchangegroup and pretxncommit." msgstr "" -" aliaser %s:\n" -"\n" msgid "" -"hooks for controlling repository access\n" -"\n" -"This hook makes it possible to allow or deny write access to portions\n" -"of a repository when receiving incoming changesets.\n" -"\n" "The authorization is matched based on the local user name on the\n" "system where the hook runs, and not the committer of the original\n" -"changeset (since the latter is merely informative).\n" -"\n" +"changeset (since the latter is merely informative)." +msgstr "" + +msgid "" "The acl hook is best used along with a restricted shell like hgsh,\n" -"preventing authenticating users from doing anything other than\n" -"pushing or pulling. The hook is not safe to use if users have\n" -"interactive shell access, as they can then disable the hook.\n" -"Nor is it safe if remote users share an account, because then there\n" -"is no way to distinguish them.\n" -"\n" -"To use this hook, configure the acl extension in your hgrc like this::\n" -"\n" -" [extensions]\n" -" acl =\n" -"\n" -" [hooks]\n" -" pretxnchangegroup.acl = python:hgext.acl.hook\n" -"\n" +"preventing authenticating users from doing anything other than pushing\n" +"or pulling. The hook is not safe to use if users have interactive\n" +"shell access, as they can then disable the hook. Nor is it safe if\n" +"remote users share an account, because then there is no way to\n" +"distinguish them." +msgstr "" + +msgid "The order in which access checks are performed is:" +msgstr "" + +msgid "" +"1) Deny list for branches (section ``acl.deny.branches``)\n" +"2) Allow list for branches (section ``acl.allow.branches``)\n" +"3) Deny list for paths (section ``acl.deny``)\n" +"4) Allow list for paths (section ``acl.allow``)" +msgstr "" + +msgid "The allow and deny sections take key-value pairs." +msgstr "" + +msgid "" +"Branch-based Access Control\n" +"---------------------------" +msgstr "" + +msgid "" +"Use the ``acl.deny.branches`` and ``acl.allow.branches`` sections to\n" +"have branch-based access control. Keys in these sections can be\n" +"either:" +msgstr "" + +msgid "" +"- a branch name, or\n" +"- an asterisk, to match any branch;" +msgstr "" + +msgid "The corresponding values can be either:" +msgstr "" + +msgid "" +"- a comma-separated list containing users and groups, or\n" +"- an asterisk, to match anyone;" +msgstr "" + +msgid "" +"Path-based Access Control\n" +"-------------------------" +msgstr "" + +msgid "" +"Use the ``acl.deny`` and ``acl.allow`` sections to have path-based\n" +"access control. Keys in these sections accept a subtree pattern (with\n" +"a glob syntax by default). The corresponding values follow the same\n" +"syntax as the other sections above." +msgstr "" + +msgid "" +"Groups\n" +"------" +msgstr "" + +msgid "" +"Group names must be prefixed with an ``@`` symbol. Specifying a group\n" +"name has the same effect as specifying all the users in that group." +msgstr "" + +msgid "" +"You can define group members in the ``acl.groups`` section.\n" +"If a group name is not defined there, and Mercurial is running under\n" +"a Unix-like system, the list of users will be taken from the OS.\n" +"Otherwise, an exception will be raised." +msgstr "" + +msgid "" +"Example Configuration\n" +"---------------------" +msgstr "" + +msgid "::" +msgstr "::" + +msgid " [hooks]" +msgstr " [hooks]" + +msgid "" +" # Use this if you want to check access restrictions at commit time\n" +" pretxncommit.acl = python:hgext.acl.hook" +msgstr "" + +msgid "" +" # Use this if you want to check access restrictions for pull, push,\n" +" # bundle and serve.\n" +" pretxnchangegroup.acl = python:hgext.acl.hook" +msgstr "" + +msgid "" " [acl]\n" -" # Check whether the source of incoming changes is in this list\n" -" # (\"serve\" == ssh or http, \"push\", \"pull\", \"bundle\")\n" -" sources = serve\n" -"\n" -"The allow and deny sections take a subtree pattern as key (with a glob\n" -"syntax by default), and a comma separated list of users as the\n" -"corresponding value. The deny list is checked before the allow list\n" -"is. ::\n" -"\n" -" [acl.allow]\n" -" # If acl.allow is not present, all users are allowed by default.\n" -" # An empty acl.allow section means no users allowed.\n" -" docs/** = doc_writer\n" -" .hgtags = release_engineer\n" -"\n" +" # Allow or deny access for incoming changes only if their source is\n" +" # listed here, let them pass otherwise. Source is \"serve\" for all\n" +" # remote access (http or ssh), \"push\", \"pull\" or \"bundle\" when the\n" +" # related commands are run locally.\n" +" # Default: serve\n" +" sources = serve" +msgstr "" + +msgid " [acl.deny.branches]" +msgstr " [acl.deny.branches]" + +msgid "" +" # Everyone is denied to the frozen branch:\n" +" frozen-branch = *" +msgstr "" + +msgid "" +" # A bad user is denied on all branches:\n" +" * = bad-user" +msgstr "" + +msgid " [acl.allow.branches]" +msgstr " [acl.allow.branches]" + +msgid "" +" # A few users are allowed on branch-a:\n" +" branch-a = user-1, user-2, user-3" +msgstr "" + +msgid "" +" # Only one user is allowed on branch-b:\n" +" branch-b = user-1" +msgstr "" + +msgid "" +" # The super user is allowed on any branch:\n" +" * = super-user" +msgstr "" + +msgid "" +" # Everyone is allowed on branch-for-tests:\n" +" branch-for-tests = *" +msgstr "" + +msgid "" " [acl.deny]\n" -" # If acl.deny is not present, no users are refused by default.\n" -" # An empty acl.deny section means all users allowed.\n" -" glob pattern = user4, user5\n" -" ** = user6\n" +" # This list is checked first. If a match is found, acl.allow is not\n" +" # checked. All users are granted access if acl.deny is not present.\n" +" # Format for both lists: glob pattern = user, ..., @group, ..." +msgstr "" + +msgid "" +" # To match everyone, use an asterisk for the user:\n" +" # my/glob/pattern = *" +msgstr "" + +msgid "" +" # user6 will not have write access to any file:\n" +" ** = user6" +msgstr "" + +msgid "" +" # Group \"hg-denied\" will not have write access to any file:\n" +" ** = @hg-denied" +msgstr "" + +msgid "" +" # Nobody will be able to change \"DONT-TOUCH-THIS.txt\", despite\n" +" # everyone being able to change all other files. See below.\n" +" src/main/resources/DONT-TOUCH-THIS.txt = *" +msgstr "" + +msgid "" +" [acl.allow]\n" +" # if acl.allow is not present, all users are allowed by default\n" +" # empty acl.allow = no users allowed" +msgstr "" + +msgid "" +" # User \"doc_writer\" has write access to any file under the \"docs\"\n" +" # folder:\n" +" docs/** = doc_writer" +msgstr "" + +msgid "" +" # User \"jack\" and group \"designers\" have write access to any file\n" +" # under the \"images\" folder:\n" +" images/** = jack, @designers" +msgstr "" + +msgid "" +" # Everyone (except for \"user6\" - see acl.deny above) will have write\n" +" # access to any file under the \"resources\" folder (except for 1\n" +" # file. See acl.deny):\n" +" src/main/resources/** = *" +msgstr "" + +msgid " .hgtags = release_engineer" +msgstr " .hgtags = release_engineer" + +#, python-format +msgid "group '%s' is undefined" +msgstr "" + +#, python-format +msgid "" +"config error - hook type \"%s\" cannot stop incoming changesets nor commits" +msgstr "" +"konfigurationsfejl - hook type \"%s\" kan ikke stoppe indgående ændringer " +"eller deponeringer" + +#, python-format +msgid "acl: user \"%s\" denied on branch \"%s\" (changeset \"%s\")" msgstr "" #, python-format -msgid "config error - hook type \"%s\" cannot stop incoming changesets" +msgid "acl: user \"%s\" not allowed on branch \"%s\" (changeset \"%s\")" msgstr "" -"konfigurationsfejl - hook type \"%s\" kan ikke stoppe indgående ændringer" #, python-format msgid "acl: access denied for changeset %s" msgstr "acl: adgang nægtet til ændring %s" +msgid "track a line of development with movable markers" +msgstr "" + msgid "" -"track a line of development with movable markers\n" -"\n" "Bookmarks are local movable markers to changesets. Every bookmark\n" "points to a changeset identified by its hash. If you commit a\n" "changeset that is based on a changeset that has a bookmark on it, the\n" -"bookmark shifts to the new changeset.\n" -"\n" -"It is possible to use bookmark names in every revision lookup (e.g. hg\n" -"merge, hg update).\n" -"\n" +"bookmark shifts to the new changeset." +msgstr "" + +msgid "" +"It is possible to use bookmark names in every revision lookup (e.g.\n" +":hg:`merge`, :hg:`update`)." +msgstr "" + +msgid "" "By default, when several bookmarks point to the same changeset, they\n" "will all move forward together. It is possible to obtain a more\n" "git-like experience by adding the following configuration option to\n" -"your .hgrc::\n" -"\n" +"your .hgrc::" +msgstr "" + +msgid "" " [bookmarks]\n" -" track.current = True\n" -"\n" +" track.current = True" +msgstr "" +" [bookmarks]\n" +" track.current = True" + +msgid "" "This will cause Mercurial to track the bookmark that you are currently\n" "using, and only update it. This is similar to git's approach to\n" "branching.\n" msgstr "" msgid "" -"track a line of development with movable markers\n" -"\n" " Bookmarks are pointers to certain commits that move when\n" " committing. Bookmarks are local. They can be renamed, copied and\n" -" deleted. It is possible to use bookmark names in 'hg merge' and\n" -" 'hg update' to merge and update respectively to a given bookmark.\n" -"\n" -" You can use 'hg bookmark NAME' to set a bookmark on the working\n" +" deleted. It is possible to use bookmark names in :hg:`merge` and\n" +" :hg:`update` to merge and update respectively to a given bookmark." +msgstr "" + +msgid "" +" You can use :hg:`bookmark NAME` to set a bookmark on the working\n" " directory's parent revision with the given name. If you specify\n" " a revision using -r REV (where REV may be an existing bookmark),\n" " the bookmark is assigned to that revision.\n" @@ -168,132 +351,241 @@ msgid "no bookmarks set\n" msgstr "der er ingen bogmærker\n" +#, python-format +msgid "updating bookmark %s\n" +msgstr "opdaterer bogmærke %s\n" + +#, python-format +msgid "not updating divergent bookmark %s\n" +msgstr "" + +#, python-format +msgid "updating bookmark %s failed!\n" +msgstr "opdatering af bogmærke %s fejlede!\n" + +#, python-format +msgid "remote bookmark %s not found!" +msgstr "fjern-bogmærke %s blev ikke fundet!" + +#, python-format +msgid "importing bookmark %s\n" +msgstr "importerer bogmærke %s\n" + +#, python-format +msgid "exporting bookmark %s\n" +msgstr "eksporterer bogmærke %s\n" + +#, python-format +msgid "deleting remote bookmark %s\n" +msgstr "sletter fjern-bogmærke %s\n" + +msgid "searching for changes\n" +msgstr "leder efter ændringer\n" + +msgid "no changes found\n" +msgstr "fandt ingen ændringer\n" + +#, python-format +msgid "comparing with %s\n" +msgstr "sammenligner med %s\n" + +msgid "bookmark to import" +msgstr "bogmærke der skal importeres" + +msgid "bookmark to export" +msgstr "bogmærke der skal eksporteres" + +msgid "compare bookmark" +msgstr "sammenlign bogmærke" + msgid "force" msgstr "gennemtving" +msgid "REV" +msgstr "REV" + msgid "revision" msgstr "revision" msgid "delete a given bookmark" msgstr "slet et givent bogmærke" +msgid "NAME" +msgstr "NAVN" + msgid "rename a given bookmark" msgstr "omdøb et givet bogmærke" msgid "hg bookmarks [-f] [-d] [-m NAME] [-r REV] [NAME]" msgstr "hg bookmarks [-f] [-d] [-m NAVN] [-r REV] [NAVN]" +msgid "hooks for integrating with the Bugzilla bug tracker" +msgstr "" + msgid "" -"hooks for integrating with the Bugzilla bug tracker\n" -"\n" "This hook extension adds comments on bugs in Bugzilla when changesets\n" "that refer to bugs by Bugzilla ID are seen. The hook does not change\n" -"bug status.\n" -"\n" +"bug status." +msgstr "" + +msgid "" "The hook updates the Bugzilla database directly. Only Bugzilla\n" -"installations using MySQL are supported.\n" -"\n" +"installations using MySQL are supported." +msgstr "" + +msgid "" "The hook relies on a Bugzilla script to send bug change notification\n" "emails. That script changes between Bugzilla versions; the\n" "'processmail' script used prior to 2.18 is replaced in 2.18 and\n" "subsequent versions by 'config/sendbugmail.pl'. Note that these will\n" "be run by Mercurial as the user pushing the change; you will need to\n" -"ensure the Bugzilla install file permissions are set appropriately.\n" -"\n" +"ensure the Bugzilla install file permissions are set appropriately." +msgstr "" + +msgid "" "The extension is configured through three different configuration\n" -"sections. These keys are recognized in the [bugzilla] section:\n" -"\n" +"sections. These keys are recognized in the [bugzilla] section:" +msgstr "" + +msgid "" "host\n" -" Hostname of the MySQL server holding the Bugzilla database.\n" -"\n" +" Hostname of the MySQL server holding the Bugzilla database." +msgstr "" + +msgid "" "db\n" -" Name of the Bugzilla database in MySQL. Default 'bugs'.\n" -"\n" +" Name of the Bugzilla database in MySQL. Default 'bugs'." +msgstr "" + +msgid "" "user\n" -" Username to use to access MySQL server. Default 'bugs'.\n" -"\n" +" Username to use to access MySQL server. Default 'bugs'." +msgstr "" + +msgid "" "password\n" -" Password to use to access MySQL server.\n" -"\n" +" Password to use to access MySQL server." +msgstr "" + +msgid "" "timeout\n" -" Database connection timeout (seconds). Default 5.\n" -"\n" +" Database connection timeout (seconds). Default 5." +msgstr "" + +msgid "" "version\n" " Bugzilla version. Specify '3.0' for Bugzilla versions 3.0 and later,\n" " '2.18' for Bugzilla versions from 2.18 and '2.16' for versions prior\n" -" to 2.18.\n" -"\n" +" to 2.18." +msgstr "" + +msgid "" "bzuser\n" " Fallback Bugzilla user name to record comments with, if changeset\n" -" committer cannot be found as a Bugzilla user.\n" -"\n" +" committer cannot be found as a Bugzilla user." +msgstr "" + +msgid "" "bzdir\n" " Bugzilla install directory. Used by default notify. Default\n" -" '/var/www/html/bugzilla'.\n" -"\n" +" '/var/www/html/bugzilla'." +msgstr "" + +msgid "" "notify\n" " The command to run to get Bugzilla to send bug change notification\n" " emails. Substitutes from a map with 3 keys, 'bzdir', 'id' (bug id)\n" " and 'user' (committer bugzilla email). Default depends on version;\n" " from 2.18 it is \"cd %(bzdir)s && perl -T contrib/sendbugmail.pl\n" -" %(id)s %(user)s\".\n" -"\n" +" %(id)s %(user)s\"." +msgstr "" + +msgid "" "regexp\n" " Regular expression to match bug IDs in changeset commit message.\n" " Must contain one \"()\" group. The default expression matches 'Bug\n" " 1234', 'Bug no. 1234', 'Bug number 1234', 'Bugs 1234,5678', 'Bug\n" -" 1234 and 5678' and variations thereof. Matching is case insensitive.\n" -"\n" +" 1234 and 5678' and variations thereof. Matching is case insensitive." +msgstr "" + +msgid "" "style\n" -" The style file to use when formatting comments.\n" -"\n" +" The style file to use when formatting comments." +msgstr "" + +msgid "" "template\n" " Template to use when formatting comments. Overrides style if\n" " specified. In addition to the usual Mercurial keywords, the\n" -" extension specifies::\n" -"\n" +" extension specifies::" +msgstr "" + +msgid "" " {bug} The Bugzilla bug ID.\n" " {root} The full pathname of the Mercurial repository.\n" " {webroot} Stripped pathname of the Mercurial repository.\n" -" {hgweb} Base URL for browsing Mercurial repositories.\n" -"\n" +" {hgweb} Base URL for browsing Mercurial repositories." +msgstr "" + +msgid "" " Default 'changeset {node|short} in repo {root} refers '\n" -" 'to bug {bug}.\\ndetails:\\n\\t{desc|tabindent}'\n" -"\n" +" 'to bug {bug}.\\ndetails:\\n\\t{desc|tabindent}'" +msgstr "" + +msgid "" "strip\n" " The number of slashes to strip from the front of {root} to produce\n" -" {webroot}. Default 0.\n" -"\n" +" {webroot}. Default 0." +msgstr "" + +msgid "" "usermap\n" " Path of file containing Mercurial committer ID to Bugzilla user ID\n" " mappings. If specified, the file should contain one mapping per\n" -" line, \"committer\"=\"Bugzilla user\". See also the [usermap] section.\n" -"\n" +" line, \"committer\"=\"Bugzilla user\". See also the [usermap] section." +msgstr "" + +msgid "" "The [usermap] section is used to specify mappings of Mercurial\n" "committer ID to Bugzilla user ID. See also [bugzilla].usermap.\n" -"\"committer\"=\"Bugzilla user\"\n" -"\n" -"Finally, the [web] section supports one entry:\n" -"\n" +"\"committer\"=\"Bugzilla user\"" +msgstr "" + +msgid "Finally, the [web] section supports one entry:" +msgstr "" + +msgid "" "baseurl\n" " Base URL for browsing Mercurial repositories. Reference from\n" -" templates as {hgweb}.\n" -"\n" -"Activating the extension::\n" -"\n" +" templates as {hgweb}." +msgstr "" + +msgid "Activating the extension::" +msgstr "" + +msgid "" " [extensions]\n" -" bugzilla =\n" -"\n" +" bugzilla =" +msgstr "" +" [extensions]\n" +" bugzilla =" + +msgid "" " [hooks]\n" " # run bugzilla hook on every change pulled or pushed in here\n" -" incoming.bugzilla = python:hgext.bugzilla.hook\n" -"\n" -"Example configuration:\n" -"\n" +" incoming.bugzilla = python:hgext.bugzilla.hook" +msgstr "" + +msgid "Example configuration:" +msgstr "" + +msgid "" "This example configuration is for a collection of Mercurial\n" "repositories in /var/local/hg/repos/ used with a local Bugzilla 3.2\n" -"installation in /opt/bugzilla-3.2. ::\n" -"\n" +"installation in /opt/bugzilla-3.2. ::" +msgstr "" + +msgid "" " [bugzilla]\n" " host=localhost\n" " password=XYZZY\n" @@ -303,20 +595,42 @@ " template=Changeset {node|short} in {root|basename}.\n" " {hgweb}/{webroot}/rev/{node|short}\\n\n" " {desc}\\n\n" -" strip=5\n" -"\n" +" strip=5" +msgstr "" +" [bugzilla]\n" +" host=localhost\n" +" password=XYZZY\n" +" version=3.0\n" +" bzuser=unknown@domain.com\n" +" bzdir=/opt/bugzilla-3.2\n" +" template=Changeset {node|short} in {root|basename}.\n" +" {hgweb}/{webroot}/rev/{node|short}\\n\n" +" {desc}\\n\n" +" strip=5" + +msgid "" " [web]\n" -" baseurl=http://dev.domain.com/hg\n" -"\n" +" baseurl=http://dev.domain.com/hg" +msgstr "" +" [web]\n" +" baseurl=http://dev.domain.com/hg" + +msgid "" " [usermap]\n" -" user@emaildomain.com=user.name@bugzilladomain.com\n" -"\n" -"Commits add a comment to the Bugzilla bug record of the form::\n" -"\n" +" user@emaildomain.com=user.name@bugzilladomain.com" +msgstr "" +" [usermap]\n" +" user@emaildomain.com=user.name@bugzilladomain.com" + +msgid "Commits add a comment to the Bugzilla bug record of the form::" +msgstr "" + +msgid "" " Changeset 3b16791d6642 in repository-name.\n" -" http://dev.domain.com/hg/repository-name/rev/3b16791d6642\n" -"\n" -" Changeset commit comment. Bug 1234.\n" +" http://dev.domain.com/hg/repository-name/rev/3b16791d6642" +msgstr "" + +msgid " Changeset commit comment. Bug 1234.\n" msgstr "" #, python-format @@ -384,7 +698,7 @@ #, python-format msgid "hook type %s does not pass a changeset id" -msgstr "hook type %s overfører ikke noget ændrings-ID" +msgstr "" #, python-format msgid "database error: %s" @@ -393,9 +707,10 @@ msgid "command to display child changesets" msgstr "kommando til at vise børne-ændringer" +msgid "show the children of the given or working directory revision" +msgstr "vis børnene til arbejdskataloget eller en given revision" + msgid "" -"show the children of the given or working directory revision\n" -"\n" " Print the children of the working directory's revisions. If a\n" " revision is given via -r/--rev, the children of that revision will\n" " be printed. If a file argument is given, revision in which the\n" @@ -403,8 +718,6 @@ " argument to --rev if given) is printed.\n" " " msgstr "" -"vis børnene til arbejdskataloget eller en given revision\n" -"\n" " Udskriv arbejdskatalogets børnerevisioner. Hvis en revision er\n" " angivet med -r/--rev, udskrives børnene til denne revision.\n" " Hvis en fil er angivet, udskrives revisionen i hvilken filen sidst\n" @@ -425,77 +738,80 @@ msgid "Revision %d is a merge, ignoring...\n" msgstr "Revision %d er en sammenføjning; ignorerer...\n" -#, python-format -msgid "generating stats: %d%%" -msgstr "genererer statistik: %d%%" +msgid "analyzing" +msgstr "analyserer" + +msgid "histogram of changes to the repository" +msgstr "histogram over ændringer i depotet" msgid "" -"histogram of changes to the repository\n" -"\n" " This command will display a histogram representing the number\n" " of changed lines or revisions, grouped according to the given\n" " template. The default template will group changes by author.\n" " The --dateformat option may be used to group the results by\n" -" date instead.\n" -"\n" -" Statistics are based on the number of changed lines, or\n" -" alternatively the number of matching revisions if the\n" -" --changesets option is specified.\n" -"\n" -" Examples::\n" -"\n" -" # display count of changed lines for every committer\n" -" hg churn -t '{author|email}'\n" -"\n" -" # display daily activity graph\n" -" hg churn -f '%H' -s -c\n" -"\n" -" # display activity of developers by month\n" -" hg churn -f '%Y-%m' -s -c\n" -"\n" -" # display count of lines changed in every year\n" -" hg churn -f '%Y' -s\n" -"\n" -" It is possible to map alternate email addresses to a main address\n" -" by providing a file using the following format::\n" -"\n" -" \n" -"\n" -" Such a file may be specified with the --aliases option, otherwise\n" -" a .hgchurn file will be looked for in the working directory root.\n" -" " +" date instead." msgstr "" -"histogram over ændringer i depotet\n" -"\n" " Denne kommando vil vise et histogram som repræsenterer antallet af\n" " ændrede linier eller revisioner, grupperet efter en given\n" " skabelon. Standardskabelonen vil gruppere ændringer efter\n" " forfatter. Med --dateformat tilvalget kan resultaterne i stedet\n" -" grupperes efter dato.\n" -"\n" +" grupperes efter dato." + +msgid "" +" Statistics are based on the number of changed lines, or\n" +" alternatively the number of matching revisions if the\n" +" --changesets option is specified." +msgstr "" " Statistikken er basseret på antallet af ændrede linier eller\n" " alternativt på antallet af matchende revisioner, hvis --changesets\n" -" tilvalget er specificeret.\n" -"\n" -" Eksempler::\n" -"\n" +" tilvalget er specificeret." + +msgid " Examples::" +msgstr " Eksempler::" + +msgid "" +" # display count of changed lines for every committer\n" +" hg churn -t '{author|email}'" +msgstr "" " # viser antaller af ændrede linier for hver bruger\n" -" hg churn -t '{author|email}'\n" -"\n" +" hg churn -t '{author|email}'" + +msgid "" +" # display daily activity graph\n" +" hg churn -f '%H' -s -c" +msgstr "" " # viser graf over daglig aktivitet\n" -" hg churn -f '%H' -s -c\n" -"\n" +" hg churn -f '%H' -s -c" + +msgid "" +" # display activity of developers by month\n" +" hg churn -f '%Y-%m' -s -c" +msgstr "" " # viser månedlig aktivitet af udviklerne\n" -" hg churn -f '%Y-%m' -s -c\n" -"\n" +" hg churn -f '%Y-%m' -s -c" + +msgid "" +" # display count of lines changed in every year\n" +" hg churn -f '%Y' -s" +msgstr "" " # viser antallet af linier ændret hvert år\n" -" hg churn -f '%Y' -s\n" -"\n" +" hg churn -f '%Y' -s" + +msgid "" +" It is possible to map alternate email addresses to a main address\n" +" by providing a file using the following format::" +msgstr "" " Det er muligt at afbilde alternative e-mail-adresser til\n" -" hoved-adresser ved at bruge en fil med følgende format::\n" -"\n" -" \n" -"\n" +" hoved-adresser ved at bruge en fil med følgende format::" + +msgid " = " +msgstr " = " + +msgid "" +" Such a file may be specified with the --aliases option, otherwise\n" +" a .hgchurn file will be looked for in the working directory root.\n" +" " +msgstr "" " En sådan fil kan angivet med --aliases tilvalget. Som standard\n" " bruges .hgchurn i arbejdskatalogets rod, hvis denne findes.\n" " " @@ -503,12 +819,21 @@ msgid "count rate for the specified revision or range" msgstr "lav statistik for de specificerede revisioner" +msgid "DATE" +msgstr "DATO" + msgid "count rate for revisions matching date spec" msgstr "lav statistik for revisioner som matcher dato specifikationen" +msgid "TEMPLATE" +msgstr "MØNSTER" + msgid "template to group changesets" msgstr "skabelon for gruppering af ændringer" +msgid "FORMAT" +msgstr "FORMAT" + msgid "strftime-compatible format for grouping by date" msgstr "strftime-kompatibelt format til gruppering efter dato" @@ -521,48 +846,84 @@ msgid "display added/removed lines separately" msgstr "vil tilføjede/fjernede linier separat" +msgid "FILE" +msgstr "FIL" + msgid "file with email aliases" msgstr "fil med email-aliaser" -msgid "show progress" -msgstr "vis fremskridt" +msgid "hg churn [-d DATE] [-r REV] [--aliases FILE] [FILE]" +msgstr "hg churn [-d DATO] [-r REV] [--aliases FIL] [FIL]" -msgid "hg churn [-d DATE] [-r REV] [--aliases FILE] [--progress] [FILE]" -msgstr "hg churn [-d DATO] [-r REV] [--aliases FIL] [--progress] [FIL]" +msgid "colorize output from some commands" +msgstr "farvelæg output for nogle kommandoer" msgid "" -"colorize output from some commands\n" -"\n" "This extension modifies the status and resolve commands to add color to " "their\n" "output to reflect file status, the qseries command to add color to reflect\n" "patch status (applied, unapplied, missing), and to diff-related\n" "commands to highlight additions, removals, diff headers, and trailing\n" -"whitespace.\n" -"\n" +"whitespace." +msgstr "" +"Denne udvidelse ændrer status- og resolve-kommandoerne så de tilføjer\n" +"farve til deres output for at afspejle filstatus, qseries-kommandoen\n" +"så den tilføjer farve for at afspejle status for rettelsen (anvendt,\n" +"ikke-anvendt, manglende), og diff-relaterede kommandoer så de\n" +"fremhæver tilføjelser, fjernelser, diff-hoveder og mellemrum i\n" +"slutningen af linier." + +msgid "" "Other effects in addition to color, like bold and underlined text, are\n" "also available. Effects are rendered with the ECMA-48 SGR control\n" "function (aka ANSI escape codes). This module also provides the\n" -"render_text function, which can be used to add effects to any text.\n" -"\n" -"Default effects may be overridden from the .hgrc file::\n" -"\n" +"render_text function, which can be used to add effects to any text." +msgstr "" +"Ud over farver er der også andre effekter tilgængelig, såsom fed og\n" +"understreget tekst. Effekterne bliver renderet med ECMA-48 SGR\n" +"kontrolfunktionen (aka ANSI escape codes). Dette modul indeholder også\n" +"render_text funktionen som kan bruges til at tilføje effekter til\n" +"vilkårlig tekst." + +msgid "Default effects may be overridden from the .hgrc file::" +msgstr "Standardeffekterne som kan overskrives fra en .hgrc fil::" + +msgid "" " [color]\n" " status.modified = blue bold underline red_background\n" " status.added = green bold\n" " status.removed = red bold blue_background\n" " status.deleted = cyan bold underline\n" " status.unknown = magenta bold underline\n" -" status.ignored = black bold\n" -"\n" +" status.ignored = black bold" +msgstr "" +" [color]\n" +" status.modified = blue bold underline red_background\n" +" status.added = green bold\n" +" status.removed = red bold blue_background\n" +" status.deleted = cyan bold underline\n" +" status.unknown = magenta bold underline\n" +" status.ignored = black bold" + +msgid "" " # 'none' turns off all effects\n" " status.clean = none\n" -" status.copied = none\n" -"\n" +" status.copied = none" +msgstr "" +" # 'none' slår alle effekter fra\n" +" status.clean = none\n" +" status.copied = none" + +msgid "" " qseries.applied = blue bold underline\n" " qseries.unapplied = black bold\n" -" qseries.missing = red bold\n" -"\n" +" qseries.missing = red bold" +msgstr "" +" qseries.applied = blue bold underline\n" +" qseries.unapplied = black bold\n" +" qseries.missing = red bold" + +msgid "" " diff.diffline = bold\n" " diff.extended = cyan bold\n" " diff.file_a = red bold\n" @@ -571,46 +932,8 @@ " diff.deleted = red\n" " diff.inserted = green\n" " diff.changed = white\n" -" diff.trailingwhitespace = bold red_background\n" -"\n" -" resolve.unresolved = red bold\n" -" resolve.resolved = green bold\n" -"\n" -" bookmarks.current = green\n" +" diff.trailingwhitespace = bold red_background" msgstr "" -"farvelæg output for nogle kommandoer\n" -"\n" -"Denne udvidelse ændrer status- og resolve-kommandoerne så de tilføjer\n" -"farve til deres output for at afspejle filstatus, qseries-kommandoen\n" -"så den tilføjer farve for at afspejle status for rettelsen (anvendt,\n" -"ikke-anvendt, manglende), og diff-relaterede kommandoer så de\n" -"fremhæver tilføjelser, fjernelser, diff-hoveder og mellemrum i\n" -"slutningen af linier.\n" -"\n" -"Ud over farver er der også andre effekter tilgængelig, såsom fed og\n" -"understreget tekst. Effekterne bliver renderet med ECMA-48 SGR\n" -"kontrolfunktionen (aka ANSI escape codes). Dette modul indeholder også\n" -"render_text funktionen som kan bruges til at tilføje effekter til\n" -"vilkårlig tekst.\n" -"\n" -"Standardeffekterne som kan overskrives fra en .hgrc fil::\n" -"\n" -" [color]\n" -" status.modified = blue bold underline red_background\n" -" status.added = green bold\n" -" status.removed = red bold blue_background\n" -" status.deleted = cyan bold underline\n" -" status.unknown = magenta bold underline\n" -" status.ignored = black bold\n" -"\n" -" # 'none' slår alle effekter fra\n" -" status.clean = none\n" -" status.copied = none\n" -"\n" -" qseries.applied = blue bold underline\n" -" qseries.unapplied = black bold\n" -" qseries.missing = red bold\n" -"\n" " diff.diffline = bold\n" " diff.extended = cyan bold\n" " diff.file_a = red bold\n" @@ -619,31 +942,56 @@ " diff.deleted = red\n" " diff.inserted = green\n" " diff.changed = white\n" -" diff.trailingwhitespace = bold red_background\n" -"\n" -" resolve.unresolved = red bold\\n\"\n" -" resolve.resolved = green bold\\n\"\n" -"\n" -" bookmarks.current = green\n" +" diff.trailingwhitespace = bold red_background" -msgid "when to colorize (always, auto, or never)" -msgstr "hvornår der skal farvelægges (altid, automatisk eller aldrig)" +msgid "" +" resolve.unresolved = red bold\n" +" resolve.resolved = green bold" +msgstr "" +" resolve.unresolved = red bold\n" +" resolve.resolved = green bold" + +msgid " bookmarks.current = green" +msgstr " bookmarks.current = green" + +msgid "" +"The color extension will try to detect whether to use ANSI codes or\n" +"Win32 console APIs, unless it is made explicit::" +msgstr "" + +msgid "" +" [color]\n" +" mode = ansi" +msgstr "" +" [color]\n" +" mode = ansi" -msgid "don't colorize output (DEPRECATED)" -msgstr "farvelæg ikke output (FORÆLDET)" +msgid "Any value other than 'ansi', 'win32', or 'auto' will disable color." +msgstr "" #, python-format msgid "ignoring unknown color/effect %r (configured in color.%s)\n" msgstr "ignorerer ukendt farve/effekt %r (konfigureret i color.%s)\n" +msgid "win32console not found, please install pywin32\n" +msgstr "win32console blev ikke fundet, installer venligst pywin32\n" + +msgid "when to colorize (always, auto, or never)" +msgstr "hvornår der skal farvelægges (altid, automatisk eller aldrig)" + +msgid "TYPE" +msgstr "TYPE" + msgid "import revisions from foreign VCS repositories into Mercurial" msgstr "importer revisioner fra fremmede VCS depoter ind i Mercurial" +msgid "convert a foreign SCM repository to a Mercurial one." +msgstr "" + +msgid " Accepted source formats [identifiers]:" +msgstr "" + msgid "" -"convert a foreign SCM repository to a Mercurial one.\n" -"\n" -" Accepted source formats [identifiers]:\n" -"\n" " - Mercurial [hg]\n" " - CVS [cvs]\n" " - Darcs [darcs]\n" @@ -652,72 +1000,112 @@ " - Monotone [mtn]\n" " - GNU Arch [gnuarch]\n" " - Bazaar [bzr]\n" -" - Perforce [p4]\n" -"\n" -" Accepted destination formats [identifiers]:\n" -"\n" +" - Perforce [p4]" +msgstr "" " - Mercurial [hg]\n" -" - Subversion [svn] (history on branches is not preserved)\n" -"\n" -" If no revision is given, all revisions will be converted.\n" -" Otherwise, convert will only import up to the named revision\n" -" (given in a format understood by the source).\n" -"\n" +" - CVS [cvs]\n" +" - Darcs [darcs]\n" +" - git [git]\n" +" - Subversion [svn]\n" +" - Monotone [mtn]\n" +" - GNU Arch [gnuarch]\n" +" - Bazaar [bzr]\n" +" - Perforce [p4]" + +msgid " Accepted destination formats [identifiers]:" +msgstr "" + +msgid "" +" - Mercurial [hg]\n" +" - Subversion [svn] (history on branches is not preserved)" +msgstr "" + +msgid "" +" If no revision is given, all revisions will be converted.\n" +" Otherwise, convert will only import up to the named revision\n" +" (given in a format understood by the source)." +msgstr "" + +msgid "" " If no destination directory name is specified, it defaults to the\n" " basename of the source with '-hg' appended. If the destination\n" -" repository doesn't exist, it will be created.\n" -"\n" +" repository doesn't exist, it will be created." +msgstr "" + +msgid "" " By default, all sources except Mercurial will use --branchsort.\n" " Mercurial uses --sourcesort to preserve original revision numbers\n" -" order. Sort modes have the following effects:\n" -"\n" +" order. Sort modes have the following effects:" +msgstr "" + +msgid "" " --branchsort convert from parent to child revision when possible,\n" " which means branches are usually converted one after\n" -" the other. It generates more compact repositories.\n" -"\n" +" the other. It generates more compact repositories." +msgstr "" + +msgid "" " --datesort sort revisions by date. Converted repositories have\n" " good-looking changelogs but are often an order of\n" " magnitude larger than the same ones generated by\n" -" --branchsort.\n" -"\n" +" --branchsort." +msgstr "" + +msgid "" " --sourcesort try to preserve source revisions order, only\n" -" supported by Mercurial sources.\n" -"\n" +" supported by Mercurial sources." +msgstr "" + +msgid "" " If isn't given, it will be put in a default location\n" " (/.hg/shamap by default). The is a simple text file\n" " that maps each source commit ID to the destination ID for that\n" -" revision, like so::\n" -"\n" -" \n" -"\n" +" revision, like so::" +msgstr "" + +msgid " " +msgstr "" + +msgid "" " If the file doesn't exist, it's automatically created. It's\n" " updated on each commit copied, so convert-repo can be interrupted\n" -" and can be run repeatedly to copy new commits.\n" -"\n" +" and can be run repeatedly to copy new commits." +msgstr "" + +msgid "" " The [username mapping] file is a simple text file that maps each\n" " source commit author to a destination commit author. It is handy\n" " for source SCMs that use unix logins to identify authors (eg:\n" " CVS). One line per author mapping and the line format is:\n" -" srcauthor=whatever string you want\n" -"\n" +" srcauthor=whatever string you want" +msgstr "" + +msgid "" " The filemap is a file that allows filtering and remapping of files\n" " and directories. Comment lines start with '#'. Each line can\n" -" contain one of the following directives::\n" -"\n" -" include path/to/file\n" -"\n" -" exclude path/to/file\n" -"\n" -" rename from/file to/file\n" -"\n" +" contain one of the following directives::" +msgstr "" + +msgid " include path/to/file" +msgstr "" + +msgid " exclude path/to/file" +msgstr "" + +msgid " rename from/file to/file" +msgstr "" + +msgid "" " The 'include' directive causes a file, or all files under a\n" " directory, to be included in the destination repository, and the\n" " exclusion of all other files and directories not explicitly\n" " included. The 'exclude' directive causes files or directories to\n" " be omitted. The 'rename' directive renames a file or directory. To\n" " rename from a subdirectory into the root of the repository, use\n" -" '.' as the path to rename to.\n" -"\n" +" '.' as the path to rename to." +msgstr "" + +msgid "" " The splicemap is a file that allows insertion of synthetic\n" " history, letting you specify the parents of a revision. This is\n" " useful if you want to e.g. give a Subversion merge two parents, or\n" @@ -730,8 +1118,10 @@ " should be used as the new parents for that node. For example, if\n" " you have merged \"release-1.0\" into \"trunk\", then you should\n" " specify the revision on \"trunk\" as the first parent and the one on\n" -" the \"release-1.0\" branch as the second.\n" -"\n" +" the \"release-1.0\" branch as the second." +msgstr "" + +msgid "" " The branchmap is a file that allows you to rename a branch when it is\n" " being brought in from whatever external repository. When used in\n" " conjunction with a splicemap, it allows for a powerful combination\n" @@ -741,11 +1131,15 @@ " \"original_branch_name\" is the name of the branch in the source\n" " repository, and \"new_branch_name\" is the name of the branch is the\n" " destination repository. This can be used to (for instance) move code\n" -" in one repository from \"default\" to a named branch.\n" -"\n" +" in one repository from \"default\" to a named branch." +msgstr "" + +msgid "" " Mercurial Source\n" -" ----------------\n" -"\n" +" ----------------" +msgstr "" + +msgid "" " --config convert.hg.ignoreerrors=False (boolean)\n" " ignore integrity errors when reading. Use it to fix Mercurial\n" " repositories with missing revlogs, by converting from and to\n" @@ -754,11 +1148,15 @@ " store original revision ID in changeset (forces target IDs to\n" " change)\n" " --config convert.hg.startrev=0 (hg revision identifier)\n" -" convert start revision and its descendants\n" -"\n" +" convert start revision and its descendants" +msgstr "" + +msgid "" " CVS Source\n" -" ----------\n" -"\n" +" ----------" +msgstr "" + +msgid "" " CVS source will use a sandbox (i.e. a checked-out copy) from CVS\n" " to indicate the starting point of what will be converted. Direct\n" " access to the repository files is not needed, unless of course the\n" @@ -767,10 +1165,13 @@ " commands to find files to convert. This means that unless a\n" " filemap is given, all files under the starting directory will be\n" " converted, and that any directory reorganization in the CVS\n" -" sandbox is ignored.\n" -"\n" -" The options shown are the defaults.\n" -"\n" +" sandbox is ignored." +msgstr "" + +msgid " The options shown are the defaults." +msgstr "" + +msgid "" " --config convert.cvsps.cache=True (boolean)\n" " Set to False to disable remote log caching, for testing and\n" " debugging purposes.\n" @@ -797,16 +1198,22 @@ " Specify a Python function to be called after the changesets\n" " are calculated from the the CVS log. The function is passed\n" " a list with the changeset entries, and can modify the changesets\n" -" in-place, or add or delete them.\n" -"\n" +" in-place, or add or delete them." +msgstr "" + +msgid "" " An additional \"debugcvsps\" Mercurial command allows the builtin\n" " changeset merging code to be run without doing a conversion. Its\n" " parameters and output are similar to that of cvsps 2.1. Please see\n" -" the command help for more details.\n" -"\n" +" the command help for more details." +msgstr "" + +msgid "" " Subversion Source\n" -" -----------------\n" -"\n" +" -----------------" +msgstr "" + +msgid "" " Subversion source detects classical trunk/branches/tags layouts.\n" " By default, the supplied \"svn://repo/path/\" source URL is\n" " converted as a single branch. If \"svn://repo/path/trunk\" exists it\n" @@ -816,58 +1223,80 @@ " converted branches. Default \"trunk\", \"branches\" and \"tags\" values\n" " can be overridden with following options. Set them to paths\n" " relative to the source URL, or leave them blank to disable auto\n" -" detection.\n" -"\n" +" detection." +msgstr "" + +msgid "" " --config convert.svn.branches=branches (directory name)\n" " specify the directory containing branches\n" " --config convert.svn.tags=tags (directory name)\n" " specify the directory containing tags\n" " --config convert.svn.trunk=trunk (directory name)\n" -" specify the name of the trunk branch\n" -"\n" +" specify the name of the trunk branch" +msgstr "" + +msgid "" " Source history can be retrieved starting at a specific revision,\n" " instead of being integrally converted. Only single branch\n" -" conversions are supported.\n" -"\n" +" conversions are supported." +msgstr "" + +msgid "" " --config convert.svn.startrev=0 (svn revision number)\n" -" specify start Subversion revision.\n" -"\n" +" specify start Subversion revision." +msgstr "" + +msgid "" " Perforce Source\n" -" ---------------\n" -"\n" +" ---------------" +msgstr "" + +msgid "" " The Perforce (P4) importer can be given a p4 depot path or a\n" " client specification as source. It will convert all files in the\n" " source to a flat Mercurial repository, ignoring labels, branches\n" " and integrations. Note that when a depot path is given you then\n" " usually should specify a target directory, because otherwise the\n" -" target may be named ...-hg.\n" -"\n" +" target may be named ...-hg." +msgstr "" + +msgid "" " It is possible to limit the amount of source history to be\n" -" converted by specifying an initial Perforce revision.\n" -"\n" +" converted by specifying an initial Perforce revision." +msgstr "" + +msgid "" " --config convert.p4.startrev=0 (perforce changelist number)\n" -" specify initial Perforce revision.\n" -"\n" +" specify initial Perforce revision." +msgstr "" + +msgid "" " Mercurial Destination\n" -" ---------------------\n" -"\n" +" ---------------------" +msgstr "" + +msgid "" " --config convert.hg.clonebranches=False (boolean)\n" " dispatch source branches in separate clones.\n" " --config convert.hg.tagsbranch=default (branch name)\n" " tag revisions branch name\n" " --config convert.hg.usebranchnames=True (boolean)\n" -" preserve branch names\n" -"\n" -" " +" preserve branch names" +msgstr "" + +msgid " " +msgstr " " + +msgid "create changeset information from CVS" msgstr "" msgid "" -"create changeset information from CVS\n" -"\n" " This command is intended as a debugging tool for the CVS to\n" " Mercurial converter, and can be used as a direct replacement for\n" -" cvsps.\n" -"\n" +" cvsps." +msgstr "" + +msgid "" " Hg debugcvsps reads the CVS rlog for current directory (or any\n" " named directory) in the CVS repository, and converts the log to a\n" " series of changesets based on matching commit log entries and\n" @@ -945,7 +1374,7 @@ msgstr "%s ser ikke ud som et Bazaar depot" msgid "Bazaar modules could not be loaded" -msgstr "Bazaar-modulerne kunne ikke indlæses" +msgstr "Bazaar modulerne kunne ikke indlæses" msgid "" "warning: lightweight checkouts may cause conversion failures, try with a " @@ -1003,6 +1432,15 @@ msgid "%s: unknown repository type" msgstr "%s: ukendt depottype" +msgid "retrieving file" +msgstr "henter fil" + +msgid "revisions" +msgstr "revisioner" + +msgid "scanning" +msgstr "" + #, python-format msgid "unknown sort mode: %s" msgstr "ukendt sortering: %s" @@ -1047,6 +1485,9 @@ msgid "source: %s\n" msgstr "kilde: %s\n" +msgid "converting" +msgstr "konverterer" + #, python-format msgid "assuming destination %s\n" msgstr "antager mål %s\n" @@ -1059,11 +1500,11 @@ #, python-format msgid "%s does not look like a CVS checkout" -msgstr "%s ser ikke ud som et CVS arbejdskatalog" +msgstr "%s ser ikke ud som et CVS checkout" #, python-format msgid "revision %s is not a patchset number" -msgstr "revision %s er ikke et patchset-nummer" +msgstr "" #, python-format msgid "connecting to %s\n" @@ -1189,7 +1630,7 @@ msgstr "%s ser ikke ud som et Git depot" msgid "cannot retrieve git heads" -msgstr "kan ikke hente git-hoveder" +msgstr "kan ikke hente hoveder fra git" #, python-format msgid "cannot read %r object at %s" @@ -1233,7 +1674,7 @@ #, python-format msgid "could not create hg repository %s as sink" -msgstr "kunne ikke oprette hg depot %s som mål" +msgstr "" #, python-format msgid "pulling from %s into %s\n" @@ -1329,13 +1770,12 @@ msgstr "svn: fandt ingen revisioner efter startrevision %d" #, python-format -msgid "no tags found at revision %d\n" -msgstr "ingen mærkater fundet ved revision %d\n" - -#, python-format msgid "%s not found up to revision %d" msgstr "%s blev ikke fundet op til revision %d" +msgid "scanning paths" +msgstr "skanner stier" + #, python-format msgid "found parent of branch %s at %d: %s\n" msgstr "fandt forælder til gren %s ved %d: %s\n" @@ -1365,41 +1805,244 @@ msgid "XXX TAGS NOT IMPLEMENTED YET\n" msgstr "XXX MÆRKATER ER IKKE IMPLEMENTERET ENDNU\n" +msgid "automatically manage newlines in repository files" +msgstr "automatisk håndtering af linieskift i depotfiler" + +msgid "" +"This extension allows you to manage the type of line endings (CRLF or\n" +"LF) that are used in the repository and in the local working\n" +"directory. That way you can get CRLF line endings on Windows and LF on\n" +"Unix/Mac, thereby letting everybody use their OS native line endings." +msgstr "" +"Denne udvidelse lader dig håndtere linieskifttypen (CRLF eller LF) som\n" +"bruges i depotet og i det lokale arbejdskatalog. På den måde kan du få\n" +"CRLF linieskift på Windows og LF på Linux/Mac, og således lade alle\n" +"bruge de linieskift der passer til deres OS." + +msgid "" +"The extension reads its configuration from a versioned ``.hgeol``\n" +"configuration file every time you run an ``hg`` command. The\n" +"``.hgeol`` file use the same syntax as all other Mercurial\n" +"configuration files. It uses two sections, ``[patterns]`` and\n" +"``[repository]``." +msgstr "" +"Udvidelsen læser sin konfiguration fra en versioneret ``.hgeol``\n" +"konfigurationsfil hver gang du udfører en ``hg`` kommando. Denne\n" +"``.hgeol`` fil bruger samme syntaks som alle andre Mercurial\n" +"konfigurationsfiler. Den bruger to sektioner: ``[patterns]`` og\n" +"``[repository]``." + +msgid "" +"The ``[patterns]`` section specifies the line endings used in the\n" +"working directory. The format is specified by a file pattern. The\n" +"first match is used, so put more specific patterns first. The\n" +"available line endings are ``LF``, ``CRLF``, and ``BIN``." +msgstr "" +"Sektionen ``[patterns]`` angiver hvilken type linieskift der skal\n" +"bruges i arbejdskataloget. Typen er angivet ved et filmønster. Den\n" +"første træffer bliver brugt, så skriv mere specifikke mønstre først.\n" +"De mulige linieskifttyper er ``LF``, ``CRLF`` og ``BIN``." + +msgid "" +"Files with the declared format of ``CRLF`` or ``LF`` are always\n" +"checked out in that format and files declared to be binary (``BIN``)\n" +"are left unchanged. Additionally, ``native`` is an alias for the\n" +"platform's default line ending: ``LF`` on Unix (including Mac OS X)\n" +"and ``CRLF`` on Windows. Note that ``BIN`` (do nothing to line\n" +"endings) is Mercurial's default behaviour; it is only needed if you\n" +"need to override a later, more general pattern." +msgstr "" +"Filer deklareret som ``CRLF`` eller ``LF`` bliver altid hentet ud i\n" +"dette format og filer deklareret som binære (``BIN``) bliver ikke\n" +"ændret. Desuden er ``native`` et alias for platforms normale\n" +"linieskift: ``LF`` på Unix (samt Mac OS X) og ``CRLF`` på Windows.\n" +"Bemærk at ``BIN`` (gør ingenting ved linieskift) er Mercurials\n" +"standardopførsel; det er kun nødvendigt at bruge den hvis du skal\n" +"overskrive et senere og mere generelt mønster." + +msgid "" +"The optional ``[repository]`` section specifies the line endings to\n" +"use for files stored in the repository. It has a single setting,\n" +"``native``, which determines the storage line endings for files\n" +"declared as ``native`` in the ``[patterns]`` section. It can be set to\n" +"``LF`` or ``CRLF``. The default is ``LF``. For example, this means\n" +"that on Windows, files configured as ``native`` (``CRLF`` by default)\n" +"will be converted to ``LF`` when stored in the repository. Files\n" +"declared as ``LF``, ``CRLF``, or ``BIN`` in the ``[patterns]`` section\n" +"are always stored as-is in the repository." +msgstr "" +"Den valgfrie ``[repository]`` sektion angiver linieskifttypen der\n" +"bruges når filer gemmes i depotet. Den har en enkelt indstilling,\n" +"``native``, som bestemmer typen af linieskift for filer som er\n" +"deklareret som ``native`` i ``[patterns]`` sektionen. Den kan sættes\n" +"til ``LF`` eller ``CRLF``. Standardindstillingen er ``LF``. Som et\n" +"eksempel betyder dette på Windows, at filer konfigureret som\n" +"``native`` vil blive konverteret fra ``CRLF`` til ``LF`` når de gemmes\n" +"i depotet. Filer som er deklareret som ``LF``, ``CRLF`` eller ``BIN``\n" +"i ``[patterns]`` sektionen bliver altid gemt uden ændring i depotet." + +msgid "Example versioned ``.hgeol`` file::" +msgstr "Et eksempel på en versioneret ``.hgeol`` fil::" + +msgid "" +" [patterns]\n" +" **.py = native\n" +" **.vcproj = CRLF\n" +" **.txt = native\n" +" Makefile = LF\n" +" **.jpg = BIN" +msgstr "" +" [patterns]\n" +" **.py = native\n" +" **.vcproj = CRLF\n" +" **.txt = native\n" +" Makefile = LF\n" +" **.jpg = BIN" + +msgid "" +" [repository]\n" +" native = LF" +msgstr "" +" [repository]\n" +" native = LF" + +msgid "" +"The extension uses an optional ``[eol]`` section in your hgrc file\n" +"(not the ``.hgeol`` file) for settings that control the overall\n" +"behavior. There are two settings:" +msgstr "" +"Udvidelsen bruger en valgfri ``[eol]`` sektion i den hgrc fil (ikke\n" +"``.hgeol`` filen) til at bestemme den overordnede opførsel. Der er to\n" +"indstillinger:" + +msgid "" +"- ``eol.native`` (default ``os.linesep``) can be set to ``LF`` or\n" +" ``CRLF`` override the default interpretation of ``native`` for\n" +" checkout. This can be used with :hg:`archive` on Unix, say, to\n" +" generate an archive where files have line endings for Windows." +msgstr "" +"- ``eol.native`` (standard er ``os.linesep``) kan sættes til ``LF``\n" +" eller ``CRLF`` for at overskrive den sædvanlige fortolkning af\n" +" ``native`` når filer hentes ud. Dette kan f.eks. bruges med\n" +" :hg:`archive` på Unix til at lave et arkiv hvor filerne har\n" +" linieskift til Windows." + +msgid "" +"- ``eol.only-consistent`` (default True) can be set to False to make\n" +" the extension convert files with inconsistent EOLs. Inconsistent\n" +" means that there is both ``CRLF`` and ``LF`` present in the file.\n" +" Such files are normally not touched under the assumption that they\n" +" have mixed EOLs on purpose." +msgstr "" +"- ``eol.only-consistent`` (standard er True) kan sættes til False for\n" +" at lade udvidelsen konvertere filer med inkonsistente linieskift.\n" +" Inkonsistent betyder at der er både ``CRLF`` og ``LF`` linieskift\n" +" til stedet i filen. Sådanne filer bliver normalt ikke rørt under\n" +" antagelse af at de har miksede linieskift med vilje." + +msgid "" +"See :hg:`help patterns` for more information about the glob patterns\n" +"used.\n" +msgstr "" +"Se :hg:`help patterns` for mere information on de brugte\n" +"glob-mønstre.\n" + +#, python-format +msgid "%s should not have CRLF line endings" +msgstr "%s skulle ikke have CRLF linieskift" + +#, python-format +msgid "%s should not have LF line endings" +msgstr "%s skulle ikke have LF linieskift" + +msgid "the eol extension is incompatible with the win32text extension" +msgstr "eol-udvidelsen er inkompatibel med win32text-udvidelsen" + +#, python-format +msgid "ignoring unknown EOL style '%s' from %s\n" +msgstr "ignorerer ukendt linieskifttype '%s' fra %s\n" + +#, python-format +msgid "inconsistent newline style in %s\n" +msgstr "inkonsistent linieskift i %s\n" + +msgid "command to allow external programs to compare revisions" +msgstr "" + msgid "" -"command to allow external programs to compare revisions\n" -"\n" "The extdiff Mercurial extension allows you to use external programs\n" "to compare revisions, or revision with working directory. The external\n" "diff programs are called with a configurable set of options and two\n" "non-option arguments: paths to directories containing snapshots of\n" -"files to compare.\n" -"\n" +"files to compare." +msgstr "" + +msgid "" "The extdiff extension also allows to configure new diff commands, so\n" -"you do not need to type \"hg extdiff -p kdiff3\" always. ::\n" -"\n" +"you do not need to type :hg:`extdiff -p kdiff3` always. ::" +msgstr "" + +msgid "" " [extdiff]\n" " # add new command that runs GNU diff(1) in 'context diff' mode\n" " cdiff = gdiff -Nprc5\n" " ## or the old way:\n" " #cmd.cdiff = gdiff\n" -" #opts.cdiff = -Nprc5\n" -"\n" +" #opts.cdiff = -Nprc5" +msgstr "" + +msgid "" " # add new command called vdiff, runs kdiff3\n" -" vdiff = kdiff3\n" -"\n" +" vdiff = kdiff3" +msgstr "" + +msgid "" " # add new command called meld, runs meld (no need to name twice)\n" -" meld =\n" -"\n" +" meld =" +msgstr "" + +msgid "" " # add new command called vimdiff, runs gvimdiff with DirDiff plugin\n" " # (see http://www.vim.org/scripts/script.php?script_id=102) Non\n" " # English user, be sure to put \"let g:DirDiffDynamicDiffText = 1\" in\n" " # your .vimrc\n" -" vimdiff = gvim -f '+next' '+execute \"DirDiff\" argv(0) argv(1)'\n" -"\n" -"You can use -I/-X and list of file or directory names like normal \"hg\n" -"diff\" command. The extdiff extension makes snapshots of only needed\n" -"files, so running the external diff program will actually be pretty\n" -"fast (at least faster than having to compare the entire tree).\n" +" vimdiff = gvim -f '+next' '+execute \"DirDiff\" argv(0) argv(1)'" +msgstr "" + +msgid "Tool arguments can include variables that are expanded at runtime::" +msgstr "" + +msgid "" +" $parent1, $plabel1 - filename, descriptive label of first parent\n" +" $child, $clabel - filename, descriptive label of child revision\n" +" $parent2, $plabel2 - filename, descriptive label of second parent\n" +" $parent is an alias for $parent1." +msgstr "" + +msgid "" +"The extdiff extension will look in your [diff-tools] and [merge-tools]\n" +"sections for diff tool arguments, when none are specified in [extdiff]." +msgstr "" + +msgid "" +" [extdiff]\n" +" kdiff3 =" +msgstr "" +" [extdiff]\n" +" kdiff3 =" + +msgid "" +" [diff-tools]\n" +" kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child" +msgstr "" +" [diff-tools]\n" +" kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child" + +msgid "" +"You can use -I/-X and list of file or directory names like normal\n" +":hg:`diff` command. The extdiff extension makes snapshots of only\n" +"needed files, so running the external diff program will actually be\n" +"pretty fast (at least faster than having to compare the entire tree).\n" msgstr "" #, python-format @@ -1416,18 +2059,23 @@ msgid "cleaning up temp directory\n" msgstr "rydder midlertidigt katalog op\n" -msgid "" -"use external program to diff repository (or selected files)\n" -"\n" +msgid "use external program to diff repository (or selected files)" +msgstr "" + +msgid "" " Show differences between revisions for the specified files, using\n" " an external program. The default program used is diff, with\n" -" default options \"-Npru\".\n" -"\n" +" default options \"-Npru\"." +msgstr "" + +msgid "" " To select a different program, use the -p/--program option. The\n" " program will be passed the names of two directories to compare. To\n" " pass additional options to the program, use -o/--option. These\n" -" will be passed before the names of the directories to compare.\n" -"\n" +" will be passed before the names of the directories to compare." +msgstr "" + +msgid "" " When two revision arguments are given, then changes are shown\n" " between those revisions. If only one revision is specified then\n" " that revision is compared to the working directory, and, when no\n" @@ -1435,9 +2083,15 @@ " to its parent." msgstr "" +msgid "CMD" +msgstr "KMD" + msgid "comparison program to run" msgstr "sammenligningsprogram der skal køres" +msgid "OPT" +msgstr "" + msgid "pass option to comparison program" msgstr "videregiv argument til sammenligningsprogram" @@ -1448,17 +2102,13 @@ msgstr "hg extdiff [TILVALG]... [FIL]..." #, python-format +msgid "use %(path)s to diff repository (or selected files)" +msgstr "" + +#, python-format msgid "" -"use %(path)s to diff repository (or selected files)\n" -"\n" " Show differences between revisions for the specified files, using\n" -" the %(path)s program.\n" -"\n" -" When two revision arguments are given, then changes are shown\n" -" between those revisions. If only one revision is specified then\n" -" that revision is compared to the working directory, and, when no\n" -" revisions are specified, the working directory files are compared\n" -" to its parent." +" the %(path)s program." msgstr "" #, python-format @@ -1468,25 +2118,34 @@ msgid "pull, update and merge in one command" msgstr "træk, opdater og sammenføj i en kommando" +msgid "pull changes from a remote repository, merge new changes if needed." +msgstr "" + msgid "" -"pull changes from a remote repository, merge new changes if needed.\n" -"\n" " This finds all changes from the repository at the specified path\n" -" or URL and adds them to the local repository.\n" -"\n" +" or URL and adds them to the local repository." +msgstr "" + +msgid "" " If the pulled changes add a new branch head, the head is\n" " automatically merged, and the result of the merge is committed.\n" " Otherwise, the working directory is updated to include the new\n" -" changes.\n" -"\n" +" changes." +msgstr "" + +msgid "" " When a merge occurs, the newly pulled changes are assumed to be\n" " \"authoritative\". The head of the new changes is used as the first\n" " parent, with local changes as the second. To switch the merge\n" -" order, use --switch-parent.\n" -"\n" -" See 'hg help dates' for a list of formats valid for -d/--date.\n" +" order, use --switch-parent." +msgstr "" + +msgid "" +" See :hg:`help dates` for a list of formats valid for -d/--date.\n" " " msgstr "" +" Se :hg:`help dates` for en liste af gyldige formater til -d/--date.\n" +" " msgid "" "working dir not at branch tip (use \"hg update\" to check out branch tip)" @@ -1587,22 +2246,15 @@ msgid "No valid signature for %s\n" msgstr "Ingen gyldig signatur for %s\n" +msgid "add a signature for the current or given revision" +msgstr "tilføj en underskrift til den aktuelle eller en given revision" + msgid "" -"add a signature for the current or given revision\n" -"\n" " If no revision is given, the parent of the working directory is used,\n" -" or tip if no revision is checked out.\n" -"\n" -" See 'hg help dates' for a list of formats valid for -d/--date.\n" -" " +" or tip if no revision is checked out." msgstr "" -"tilføj en underskrift til den aktuelle eller en given revision\n" -"\n" " Hvis der ikke angives en revision, så bruges forældren til\n" -" arbejdskataloget, eller tip, hvis der ikke er hentet en revision.\n" -"\n" -" Se 'hg help dates' for en liste af gyldige formater til -d/--date.\n" -" " +" arbejdskataloget, eller tip, hvis der ikke er hentet en revision." msgid "uncommitted merge - please provide a specific revision" msgstr "udeponeret sammenføjning - angiv venligst en specifik revision" @@ -1633,9 +2285,15 @@ msgid "do not commit the sigfile after signing" msgstr "deponer ikke signaturfilen efter underskrivning" +msgid "ID" +msgstr "ID" + msgid "the key id to sign with" msgstr "nøgle ID der skal underskrives med" +msgid "TEXT" +msgstr "" + msgid "commit message" msgstr "deponeringsbesked" @@ -1648,15 +2306,14 @@ msgid "hg sigs" msgstr "hg sigs" +msgid "command to view revision graphs from a shell" +msgstr "kommando til at se revisionsgrafer fra en kommandofortolker" + msgid "" -"command to view revision graphs from a shell\n" -"\n" "This extension adds a --graph option to the incoming, outgoing and log\n" "commands. When this options is given, an ASCII representation of the\n" "revision graph is also shown.\n" msgstr "" -"kommando til at se revisionsgrafer fra en kommandofortolker\n" -"\n" "Denne udvidelser tilføjer et --graph tilvalg til incoming-, outgoing-\n" "og log-kommandoerne. Når dette tilvalg bruges, så vil en\n" "ASCII-repræsentation af revisionsgrafen også blive vist.\n" @@ -1665,34 +2322,30 @@ msgid "--graph option is incompatible with --%s" msgstr "--graph tilvalget er ikke kompatibelt med --%s" +msgid "show revision history alongside an ASCII revision graph" +msgstr "vis revisionshistorie ved siden af en ASCII revisionsgraf" + msgid "" -"show revision history alongside an ASCII revision graph\n" -"\n" " Print a revision history alongside a revision graph drawn with\n" -" ASCII characters.\n" -"\n" +" ASCII characters." +msgstr "" +" Udskriver en revisionshistorie ved siden af en revisionsgraf\n" +" tegnet med ASCII-tegn." + +msgid "" " Nodes printed as an @ character are parents of the working\n" " directory.\n" " " msgstr "" -"vis revisionshistorie ved siden af en ASCII revisionsgraf\n" -"\n" -" Udskriver en revisionshistorie ved siden af en revisionsgraf\n" -" tegnet med ASCII-tegn.\n" -"\n" " Knuder udskrevet med et @-tegn er forældre til arbejdskataloget.\n" " " -#, python-format -msgid "comparing with %s\n" -msgstr "sammenligner med %s\n" - -msgid "no changes found\n" -msgstr "fandt ingen ændringer\n" - msgid "show the revision DAG" msgstr "vis revisionsgrafen" +msgid "NUM" +msgstr "TAL" + msgid "limit number of changes displayed" msgstr "begræns antaln viste ændringer" @@ -1705,12 +2358,15 @@ msgid "hg glog [OPTION]... [FILE]" msgstr "hg glog [TILVALG]... [FIL]" +msgid "hooks for integrating with the CIA.vc notification service" +msgstr "" + msgid "" -"hooks for integrating with the CIA.vc notification service\n" -"\n" "This is meant to be run as a changegroup or incoming hook. To\n" -"configure it, set the following options in your hgrc::\n" -"\n" +"configure it, set the following options in your hgrc::" +msgstr "" + +msgid "" " [cia]\n" " # your registered CIA user name\n" " user = foo\n" @@ -1730,13 +2386,17 @@ " # Make sure to set email.from if you do this.\n" " #url = http://cia.vc/\n" " # print message instead of sending it (optional)\n" -" #test = False\n" -"\n" +" #test = False" +msgstr "" + +msgid "" " [hooks]\n" " # one of these:\n" " changegroup.cia = python:hgcia.hook\n" -" #incoming.cia = python:hgcia.hook\n" -"\n" +" #incoming.cia = python:hgcia.hook" +msgstr "" + +msgid "" " [web]\n" " # If you want hyperlinks (optional)\n" " baseurl = http://server/path/to/repo\n" @@ -1753,32 +2413,47 @@ msgid "email.from must be defined when sending by email" msgstr "email.from skal være defineret ved afsendelse af email" +msgid "browse the repository in a graphical way" +msgstr "" + msgid "" -"browse the repository in a graphical way\n" -"\n" "The hgk extension allows browsing the history of a repository in a\n" "graphical way. It requires Tcl/Tk version 8.4 or later. (Tcl/Tk is not\n" -"distributed with Mercurial.)\n" -"\n" +"distributed with Mercurial.)" +msgstr "" + +msgid "" "hgk consists of two parts: a Tcl script that does the displaying and\n" "querying of information, and an extension to Mercurial named hgk.py,\n" "which provides hooks for hgk to get information. hgk can be found in\n" "the contrib directory, and the extension is shipped in the hgext\n" -"repository, and needs to be enabled.\n" -"\n" -"The hg view command will launch the hgk Tcl script. For this command\n" +"repository, and needs to be enabled." +msgstr "" + +msgid "" +"The :hg:`view` command will launch the hgk Tcl script. For this command\n" "to work, hgk must be in your search path. Alternately, you can specify\n" -"the path to hgk in your .hgrc file::\n" -"\n" +"the path to hgk in your .hgrc file::" +msgstr "" + +msgid "" " [hgk]\n" -" path=/location/of/hgk\n" -"\n" +" path=/location/of/hgk" +msgstr "" + +msgid "" "hgk can make use of the extdiff extension to visualize revisions.\n" -"Assuming you had already configured extdiff vdiff command, just add::\n" -"\n" +"Assuming you had already configured extdiff vdiff command, just add::" +msgstr "" + +msgid "" " [hgk]\n" -" vdiff=vdiff\n" -"\n" +" vdiff=vdiff" +msgstr "" +" [hgk]\n" +" vdiff=vdiff" + +msgid "" "Revisions context menu will now display additional entries to fire\n" "vdiff on hovered and selected revisions.\n" msgstr "" @@ -1864,31 +2539,28 @@ msgid "hg debug-rev-list [OPTION]... REV..." msgstr "hg debug-rev-list [TILVALG]... REV..." +msgid "syntax highlighting for hgweb (requires Pygments)" +msgstr "syntaksfarvelægning til hgweb (kræver Pygments)" + msgid "" -"syntax highlighting for hgweb (requires Pygments)\n" -"\n" "It depends on the Pygments syntax highlighting library:\n" -"http://pygments.org/\n" -"\n" -"There is a single configuration option::\n" -"\n" -" [web]\n" -" pygments_style =